Documentation
¶
Index ¶
- type HttpThird
- func (a *HttpThird) Delete(api string, params map[string]interface{}, opts ...*grequests.RequestOptions) (*Response, error)
- 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) 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)
- type PostFile
- type Response
- type RpcThird
- func (a *RpcThird) Call(f func(conn *grpc.ClientConn, ctx context.Context) (proto.Message, error), ...) (proto.Message, error)
- func (a *RpcThird) GetConn() (*grpc.ClientConn, error)
- func (a *RpcThird) GetCtx() (context.Context, context.CancelFunc)
- func (a *RpcThird) SetAfterUnaryClientInterceptor(unary UnaryClientInterceptor)
- func (a *RpcThird) SetBeforeStreamClientInterceptor(stream StreamClientInterceptor)
- func (a *RpcThird) SetBeforeUnaryClientInterceptor(unary UnaryClientInterceptor)
- 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 HttpThird ¶
type HttpThird struct { Domain string Hostname string ConnectTimeout int ReadWriteTimeout int // contains filtered or unexported fields }
封装 http 接口的基础类
func (*HttpThird) SetBaseAuth ¶
func (*HttpThird) SetMaxConnsPerHost ¶
func (*HttpThird) SetMaxIdleConnsPerHost ¶
func (*HttpThird) SetTLSClientConfig ¶
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) SetAfterUnaryClientInterceptor ¶
func (a *RpcThird) SetAfterUnaryClientInterceptor(unary UnaryClientInterceptor)
func (*RpcThird) SetBeforeStreamClientInterceptor ¶
func (a *RpcThird) SetBeforeStreamClientInterceptor(stream StreamClientInterceptor)
func (*RpcThird) SetBeforeUnaryClientInterceptor ¶
func (a *RpcThird) SetBeforeUnaryClientInterceptor(unary UnaryClientInterceptor)
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.