Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.2.0

type Client struct {
	*client.Client
	*Option
}

func New

func New(url string, options ...OptionFunc) (x *Client, err error)

New 创建

func (*Client) Excel added in v0.3.0

func (x *Client) Excel(ctx context.Context, name string, sheets Sheets) (err error)

func (*Client) GetCities added in v0.2.0

func (x *Client) GetCities(ctx context.Context, country string, state string, fields []string) (data []model.City, err error)

func (*Client) GetCountries added in v0.2.0

func (x *Client) GetCountries(ctx context.Context, fields []string) (data []model.Country, err error)

func (*Client) GetIp added in v0.2.0

func (x *Client) GetIp(ctx context.Context, ip string) (data M, err error)

GetIp 获取 Ip

func (*Client) GetStates added in v0.2.0

func (x *Client) GetStates(ctx context.Context, country string, fields []string) (data []model.State, err error)

func (*Client) Ping added in v0.2.0

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

Ping 测试

func (*Client) R added in v0.2.0

func (x *Client) R(method string, path string) *OpenAPI

R 创建请求

type Cos added in v0.3.0

type Cos struct {
	Url       string `env:"URL"`
	SecretID  string `env:"SECRETID"`
	SecretKey string `env:"SECRETKEY"`
}

type ExcelMetadata added in v0.3.0

type ExcelMetadata struct {
	Name  string   `msgpack:"name"`
	Parts []string `msgpack:"parts"`
}

type M added in v0.2.0

type M = map[string]interface{}

type OpenAPI

type OpenAPI struct {
	Client *Client
	Method string
	Path   string
	Header map[string]string
	Query  url.Values
	Body   []byte
}

func (*OpenAPI) Send added in v0.2.0

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

func (*OpenAPI) SetAuthorization

func (x *OpenAPI) SetAuthorization() string

func (*OpenAPI) SetData added in v0.2.0

func (x *OpenAPI) SetData(v interface{}) *OpenAPI

func (*OpenAPI) SetHeaders added in v0.2.0

func (x *OpenAPI) SetHeaders(v map[string]string) *OpenAPI

func (*OpenAPI) SetQuery added in v0.2.0

func (x *OpenAPI) SetQuery(v url.Values) *OpenAPI

type Option

type Option struct {
	Url    string
	Key    string
	Secret string
	Cos
}

type OptionFunc

type OptionFunc func(x *Client)

func SetApiGateway added in v0.2.0

func SetApiGateway(key string, secret string) OptionFunc

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

func SetCos added in v0.3.0

func SetCos(url string, id string, key string) OptionFunc

SetCos 设置对象存储 https://cloud.tencent.com/document/product/436

type Sheets added in v0.3.0

type Sheets map[string][][]interface{}

Jump to

Keyboard shortcuts

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