basethird

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 11 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 IResponse

type IResponse interface {
	GetErrno() int32

	GetErrmsg() string

	GetData() string
}

type PostFile

type PostFile string

type Request

type Request struct {
	*httplib.BeegoHTTPRequest
}

type RpcThird

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

封装 rpc 的基础类

func (*RpcThird) Call

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

func (*RpcThird) GetConn

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

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