Documentation ¶
Index ¶
- Constants
- Variables
- type IOptionFun
- type Option
- func (o *Option) AddBody(body interface{}) error
- func (o *Option) AddHeader(header map[string]string) map[string]string
- func (o *Option) AddParam(param map[string]string) map[string]string
- func (o *Option) GetBody() []byte
- func (o *Option) GetHeader() map[string]string
- func (o *Option) GetParam() map[string]string
- type SampleProvider
- func (p *SampleProvider) Byte(out *guzzle.Response) ([]byte, error)
- func (p *SampleProvider) Do(method, uri string, option IOptionFun) *guzzle.Response
- func (p *SampleProvider) Json(out *guzzle.Response, useStruct interface{}) (interface{}, error)
- func (p *SampleProvider) SetBaseAuth(username, password string) *SampleProvider
- func (p *SampleProvider) SetDebug(v bool) *SampleProvider
- func (p *SampleProvider) SetTransport(transportFn func() *http.Transport) *SampleProvider
- func (p *SampleProvider) SetValidateHost(v bool) *SampleProvider
- func (p *SampleProvider) Xml(out *guzzle.Response, useStruct interface{}) (interface{}, error)
Constants ¶
View Source
const ( GetMethod = "GET" PostMethod = "POST" PutMethod = "PUT" PatchMethod = "PATCH" DeleteMethod = "DELETE" )
Variables ¶
View Source
var NewProvider = func(scheme, instance string) (*SampleProvider, error) { return New(scheme, instance) }
Functions ¶
This section is empty.
Types ¶
type IOptionFun ¶ added in v1.0.4
type Option ¶ added in v1.0.4
type SampleProvider ¶
type SampleProvider struct { Address string Scheme string HttpClient *guzzle.Client Log logx.Logger Context context.Context }
func New ¶
func New(scheme, address string) (*SampleProvider, error)
func (*SampleProvider) Byte ¶ added in v1.0.7
func (p *SampleProvider) Byte(out *guzzle.Response) ([]byte, error)
func (*SampleProvider) Do ¶ added in v1.0.4
func (p *SampleProvider) Do(method, uri string, option IOptionFun) *guzzle.Response
func (*SampleProvider) Json ¶ added in v1.0.7
func (p *SampleProvider) Json(out *guzzle.Response, useStruct interface{}) (interface{}, error)
func (*SampleProvider) SetBaseAuth ¶ added in v1.0.4
func (p *SampleProvider) SetBaseAuth(username, password string) *SampleProvider
func (*SampleProvider) SetDebug ¶ added in v1.0.4
func (p *SampleProvider) SetDebug(v bool) *SampleProvider
func (*SampleProvider) SetTransport ¶ added in v1.0.4
func (p *SampleProvider) SetTransport(transportFn func() *http.Transport) *SampleProvider
func (*SampleProvider) SetValidateHost ¶ added in v1.0.4
func (p *SampleProvider) SetValidateHost(v bool) *SampleProvider
Click to show internal directories.
Click to hide internal directories.