client

package
v0.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type M added in v0.2.0

type M = map[string]interface{}

type OpenAPI

type OpenAPI struct {
	Client *client.Client
	Url    string
	*Option
}

func New

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

New 创建客户端

func (*OpenAPI) Do

func (x *OpenAPI) Do(ctx context.Context, req *protocol.Request) (resp *protocol.Response, err error)

Do 发起请求

func (*OpenAPI) Ip added in v0.1.0

func (x *OpenAPI) Ip(ctx context.Context, ip string) (result M, err error)

Ip 获取 Ip

func (*OpenAPI) Ping

func (x *OpenAPI) Ping(ctx context.Context) (result M, err error)

Ping 测试

func (*OpenAPI) R

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

R 创建请求

type Option

type Option struct {
	Key    string
	Secret string
}

type OptionFunc

type OptionFunc func(x *OpenAPI)

func SetApiGateway added in v0.2.0

func SetApiGateway(key string, secret string) OptionFunc

SetApiGateway 设置网关认证 https://cloud.tencent.com/document/product/628/55088

Jump to

Keyboard shortcuts

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