Documentation ¶
Index ¶
- type Caller
- type HttpInterceptor
- type HttpThird
- func (a *HttpThird) AddInterceptor(hi HttpInterceptor)
- func (a *HttpThird) Delete(api string, params map[string]interface{}, opts ...*grequests.RequestOptions) (*Response, error)
- func (a *HttpThird) DisableDefaultInterceptor()
- func (a *HttpThird) Get(api string, params map[string]interface{}, opts ...*grequests.RequestOptions) (*Response, error)
- func (a *HttpThird) Head(api string, opts ...*grequests.RequestOptions) (*Response, error)
- func (a *HttpThird) InitConfig(configSection string) error
- func (a *HttpThird) Options(api string, opts ...*grequests.RequestOptions) (*Response, error)
- func (a *HttpThird) Patch(api string, params map[string]interface{}, opts ...*grequests.RequestOptions) (*Response, error)
- func (a *HttpThird) Post(api string, params map[string]interface{}, opts ...*grequests.RequestOptions) (*Response, error)
- func (a *HttpThird) Put(api string, params map[string]interface{}, opts ...*grequests.RequestOptions) (*Response, error)
- func (a *HttpThird) SetBaseAuth(username, password string)
- func (a *HttpThird) SetHeader(headers map[string]string)
- func (a *HttpThird) SetLogInfoFlag(on bool)
- func (a *HttpThird) SetMaxConnsPerHost(num int)
- func (a *HttpThird) SetMaxIdleConnsPerHost(num int)
- func (a *HttpThird) SetTLSClientConfig(cfg *tls.Config)
- func (a *HttpThird) SetTLSInsecure()
- type PostFile
- type Response
- type RpcThird
- func (a *RpcThird) AddStreamClientInterceptor(sci grpc.StreamClientInterceptor)
- func (a *RpcThird) AddUnaryClientInterceptor(uci grpc.UnaryClientInterceptor)
- func (a *RpcThird) DisableDefaultStreamInterceptor()
- func (a *RpcThird) DisableDefaultUnaryInterceptor()
- func (a *RpcThird) GetConn() (*grpc.ClientConn, error)
- func (a *RpcThird) GetCtx() (context.Context, context.CancelFunc)
- func (a *RpcThird) InitConfig(configSection string) error
- func (a *RpcThird) SetLogInfoFlag(on bool)
- type StreamClientInterceptor
- type UnaryClientInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Caller ¶ added in v1.6.0
type Caller func(method, uri string, ro *grequests.RequestOptions) (resp *Response, err error)
type HttpInterceptor ¶ added in v1.6.0
type HttpThird ¶
type HttpThird struct { Address string Hostname string ConnectTimeout int ReadWriteTimeout int SslOn bool CertFile string // contains filtered or unexported fields }
封装 http 接口的基础类
func (*HttpThird) AddInterceptor ¶ added in v1.6.0
func (a *HttpThird) AddInterceptor(hi HttpInterceptor)
func (*HttpThird) DisableDefaultInterceptor ¶ added in v1.6.0
func (a *HttpThird) DisableDefaultInterceptor()
func (*HttpThird) InitConfig ¶ added in v1.3.1
func (*HttpThird) SetBaseAuth ¶
func (*HttpThird) SetMaxConnsPerHost ¶
func (*HttpThird) SetMaxIdleConnsPerHost ¶
func (*HttpThird) SetTLSClientConfig ¶
func (*HttpThird) SetTLSInsecure ¶ added in v1.3.1
func (a *HttpThird) SetTLSInsecure()
type Response ¶
func ErrResponse ¶ added in v1.6.0
type RpcThird ¶
type RpcThird struct { sync.Mutex Address string Timeout int MaxRecvMsgsizeMb int MaxSendMsgsizeMb int SslOn bool CertFile string Hostname string // contains filtered or unexported fields }
封装 rpc 的基础类
func (*RpcThird) AddStreamClientInterceptor ¶ added in v1.4.10
func (a *RpcThird) AddStreamClientInterceptor(sci grpc.StreamClientInterceptor)
func (*RpcThird) AddUnaryClientInterceptor ¶ added in v1.4.10
func (a *RpcThird) AddUnaryClientInterceptor(uci grpc.UnaryClientInterceptor)
func (*RpcThird) DisableDefaultStreamInterceptor ¶ added in v1.4.10
func (a *RpcThird) DisableDefaultStreamInterceptor()
func (*RpcThird) DisableDefaultUnaryInterceptor ¶ added in v1.4.10
func (a *RpcThird) DisableDefaultUnaryInterceptor()
func (*RpcThird) InitConfig ¶ added in v1.3.1
type StreamClientInterceptor ¶
type StreamClientInterceptor func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, opts ...grpc.CallOption) error
type UnaryClientInterceptor ¶
type UnaryClientInterceptor func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, opts ...grpc.CallOption) error
Click to show internal directories.
Click to hide internal directories.