Documentation ¶
Index ¶
- type GraphRequest
- type GraphRequestOption
- type Option
- type RestyClient
- func (c *RestyClient) AddHeader(k, v string)
- func (c *RestyClient) CheckUrlExist(url string) (bool, error)
- func (c *RestyClient) Delete(url string) (*resty.Response, error)
- func (c *RestyClient) FormatJson(resp *resty.Response) (string, error)
- func (c *RestyClient) Get(url string) (*resty.Response, error)
- func (c *RestyClient) GetWithQueryMap(url string, query map[string]string) (*resty.Response, error)
- func (c *RestyClient) Init()
- func (c *RestyClient) Json(resp *resty.Response, target interface{}) (interface{}, error)
- func (c *RestyClient) Ok(resp *resty.Response) bool
- func (c *RestyClient) PostData(data interface{}) *resty.Request
- func (c *RestyClient) PostFormData(data map[string]string) *resty.Request
- func (c *RestyClient) PostGraph(req *GraphRequest, url string) (*resty.Response, error)
- func (c *RestyClient) PostJson(data interface{}) *resty.Request
- func (c *RestyClient) RemoveProxy()
- func (c *RestyClient) SetBearer(token string)
- func (c *RestyClient) SetHostURL(url string)
- func (c *RestyClient) SetLowerToken(token string)
- func (c *RestyClient) SetProxy(proxy string)
- func (c *RestyClient) SetToken(token string)
- func (c *RestyClient) SetUrlParam(key, value string)
- type RestyOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphRequest ¶
type GraphRequest struct {
// contains filtered or unexported fields
}
func NewGraphRequest ¶
func NewGraphRequest(q string) *GraphRequest
func (*GraphRequest) Var ¶
func (req *GraphRequest) Var(key string, value interface{})
func (*GraphRequest) VarStruct ¶
func (req *GraphRequest) VarStruct(i interface{}, opts ...Option)
type GraphRequestOption ¶
type GraphRequestOption struct {
TagName string
}
type RestyClient ¶
type RestyClient struct { Client *resty.Client // contains filtered or unexported fields }
func NewBearClient ¶
func NewBearClient(token string) *RestyClient
func NewClient ¶
func NewClient(ops ...RestyOption) *RestyClient
func (*RestyClient) AddHeader ¶
func (c *RestyClient) AddHeader(k, v string)
func (*RestyClient) CheckUrlExist ¶
func (c *RestyClient) CheckUrlExist(url string) (bool, error)
func (*RestyClient) Delete ¶
func (c *RestyClient) Delete(url string) (*resty.Response, error)
func (*RestyClient) FormatJson ¶
func (c *RestyClient) FormatJson(resp *resty.Response) (string, error)
func (*RestyClient) Get ¶
func (c *RestyClient) Get(url string) (*resty.Response, error)
func (*RestyClient) GetWithQueryMap ¶
func (c *RestyClient) GetWithQueryMap(url string, query map[string]string) (*resty.Response, error)
func (*RestyClient) Init ¶
func (c *RestyClient) Init()
func (*RestyClient) Json ¶
func (c *RestyClient) Json(resp *resty.Response, target interface{}) (interface{}, error)
func (*RestyClient) Ok ¶
func (c *RestyClient) Ok(resp *resty.Response) bool
func (*RestyClient) PostData ¶
func (c *RestyClient) PostData(data interface{}) *resty.Request
func (*RestyClient) PostFormData ¶
func (c *RestyClient) PostFormData(data map[string]string) *resty.Request
func (*RestyClient) PostGraph ¶
func (c *RestyClient) PostGraph(req *GraphRequest, url string) (*resty.Response, error)
func (*RestyClient) PostJson ¶
func (c *RestyClient) PostJson(data interface{}) *resty.Request
func (*RestyClient) RemoveProxy ¶
func (c *RestyClient) RemoveProxy()
func (*RestyClient) SetBearer ¶
func (c *RestyClient) SetBearer(token string)
func (*RestyClient) SetHostURL ¶
func (c *RestyClient) SetHostURL(url string)
func (*RestyClient) SetLowerToken ¶
func (c *RestyClient) SetLowerToken(token string)
func (*RestyClient) SetProxy ¶
func (c *RestyClient) SetProxy(proxy string)
func (*RestyClient) SetToken ¶
func (c *RestyClient) SetToken(token string)
func (*RestyClient) SetUrlParam ¶
func (c *RestyClient) SetUrlParam(key, value string)
type RestyOption ¶
type RestyOption func(o *option)
func WithHostUrl ¶
func WithHostUrl(url string) RestyOption
func WithLowerTokenHeader ¶
func WithLowerTokenHeader(token string) RestyOption
func WithProxy ¶
func WithProxy(proxy string) RestyOption
func WithTokenHeader ¶
func WithTokenHeader(token string) RestyOption
Click to show internal directories.
Click to hide internal directories.