1 Star 0 Fork 0

肖金光 / goclean

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
client.go 537 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaojg-mbp 提交于 2024-03-07 16:51 . go11day08.02补充 RESTful SDK
package restful
import (
"net/http"
"gitee.com/aviptle/goclean/go11jin/vblog01/apps/blog"
"github.com/infraboard/mcube/client/rest"
)
func NewClient(token string) *Client {
// 获取一个RestfulClient
c := rest.NewRESTClient()
// axios
c.SetBaseURL("http://127.0.0.1:8010")
c.SetCookie(&http.Cookie{
Name: "token",
Value: token,
})
return &Client{
c: c,
}
}
// address, 核心http client
type Client struct {
c *rest.RESTClient
}
func (c *Client) BlogClient() blog.Service {
return &BlogClient{
c: c.c,
}
}
Go
1
https://gitee.com/aviptle/goclean.git
git@gitee.com:aviptle/goclean.git
aviptle
goclean
goclean
6b9efd2ceda8

搜索帮助