resty_client

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

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 Option

type Option func(o *GraphRequestOption)

func WithTagName

func WithTagName(name string) Option

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL