api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Zlib Imports: 6 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, data token.Data) *Api

func (*Api) GetAppId

func (api *Api) GetAppId() 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) Upload

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

type GetTokenFunc

type GetTokenFunc func(appId string, data token.Data) (string, error)

type HeadFunc

type HeadFunc func(acsKey string, h *http2.Header)

type Options

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

type OptionsFunc

type OptionsFunc func(opts *Options)

type ResCallBack

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

type SetTokenFunc

type SetTokenFunc func(appId string, token string)

type UrlFunc

type UrlFunc func(acsToken string, uri string) string

Jump to

Keyboard shortcuts

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