client

package
v0.0.8-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAPI

type OpenAPI struct {
	Client *resty.Client
	*Option
}

func New

func New(url string, options ...OptionFunc) *OpenAPI

New 新建客户端

func (*OpenAPI) Ping

func (x *OpenAPI) Ping(ctx context.Context) (result map[string]interface{}, err error)

Ping 测试

func (*OpenAPI) R

func (x *OpenAPI) R(method string, path string) *resty.Request

R 创建请求

func (*OpenAPI) SetAuthorization

func (x *OpenAPI) SetAuthorization(req *resty.Request)

SetAuthorization 设置应用认证

type Option

type Option struct {
	Key    string
	Secret string
}

type OptionFunc

type OptionFunc func(x *OpenAPI)

func SetCertification

func SetCertification(key string, secret string) OptionFunc

SetCertification 设置认证

Jump to

Keyboard shortcuts

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