api

package
v0.5.24 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Zlib Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	// contains filtered or unexported fields
}

func New

func New(tk token.Token, options ...OptionsFunc) *Api

func NewWithData

func NewWithData(tk token.Token, d data.D) *Api

func (*Api) AppId added in v0.1.2

func (api *Api) AppId() string

func (*Api) Request

func (api *Api) Request(method, uri string, buf []byte, resCb ResCallBack) error

func (*Api) ResetToken

func (api *Api) ResetToken()

func (*Api) Secret added in v0.1.2

func (api *Api) Secret() string

func (*Api) Upload

func (api *Api) Upload(uri string, file interface{}, resCb ResCallBack) error

type GetTokenFunc

type GetTokenFunc func(appId string, d data.D) (string, error)

type HeadFunc

type HeadFunc func(acsToken string, h *http.Header)

type Options

type Options struct {
	Token        string
	AppId        string
	Secret       string
	TryCount     int
	UrlFunc      UrlFunc
	HeadFunc     HeadFunc
	SetTokenFunc SetTokenFunc
	GetTokenFunc GetTokenFunc
	Data         data.D
}

type OptionsFunc

type OptionsFunc func(opts *Options)

type ResCallBack

type ResCallBack func(hp *commonhttp.Http, body []byte) error

type SetTokenFunc

type SetTokenFunc func(appId string, token string)

type UrlFunc

type UrlFunc func(acsToken string, d data.D, uri string) string

Jump to

Keyboard shortcuts

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