basethird

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body string

type HttpThird

type HttpThird struct {
	Domain           string
	Hostname         string
	ConnectTimeout   int
	ReadWriteTimeout int
	// contains filtered or unexported fields
}

func (*HttpThird) Delete

func (a *HttpThird) Delete(api string, params map[string]interface{}) (*Request, error)

@todo 放在 url 上的参数

func (*HttpThird) Get

func (a *HttpThird) Get(api string, params map[string]interface{}) (*Request, error)

func (*HttpThird) Head

func (a *HttpThird) Head(api string, params map[string]interface{}) (*Request, error)

func (*HttpThird) Post

func (a *HttpThird) Post(api string, params map[string]interface{}) (*Request, error)

func (*HttpThird) Put

func (a *HttpThird) Put(api string, params map[string]interface{}) (*Request, error)

func (*HttpThird) SetBaseAuth

func (a *HttpThird) SetBaseAuth(username, password string)

func (*HttpThird) SetHeader

func (a *HttpThird) SetHeader(headers map[string]string)

func (*HttpThird) SetLogInfoFlag

func (a *HttpThird) SetLogInfoFlag(on bool)

设置是否要关闭 info 日志

type PostFile

type PostFile string

type Request

type Request struct {
	*httplib.BeegoHTTPRequest
}

type RpcThird

type RpcThird struct {
	sync.Mutex
	Address  string
	Timeout  int
	SslOn    bool
	CertFile string
	Hostname string
	// contains filtered or unexported fields
}

封装 rpc 的基础类

func (*RpcThird) Call

func (a *RpcThird) Call(f func(conn *grpc.ClientConn, ctx context.Context) (proto.Message, error), params interface{}) (proto.Message, error)

func (*RpcThird) GetConn

func (a *RpcThird) GetConn() (*grpc.ClientConn, error)

@todo reconnect

func (*RpcThird) GetCtx

func (a *RpcThird) GetCtx() (context.Context, context.CancelFunc)

Jump to

Keyboard shortcuts

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