service

package
v0.0.0-...-05fb1d9 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RefreshCallbackFn = func(refreshToken string, accessToken string, expireTime string) {
}
View Source
var RefreshFailCallbackFn = func(err error) {
}

Functions

func Prettify

func Prettify(i interface{}) string

Types

type AccessTokenCredential

type AccessTokenCredential struct {
	AccessToken  string
	RefreshToken string
	// contains filtered or unexported fields
}

type AccessTokenResponse

type AccessTokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpireTime   string `json:"expire_time"`
}

type BaseClient

type BaseClient struct {
	RegionId     string `json:"regionId" xml:"regionId"`
	Protocol     string `json:"protocol" xml:"protocol"`
	Endpoint     string `json:"endpoint" xml:"endpoint"`
	DomainId     string `json:"domainId" xml:"domainId"`
	ClientId     string `json:"clientId" xml:"clientId"`
	UserAgent    string `json:"useragent" xml:"useragent"`
	ClientSecret string `json:"clientSecret" xml:"clientSecret"`
	Nickname     string `json:"nickname" xml:"nickname"`
	// contains filtered or unexported fields
}

func (*BaseClient) AppendUserAgent

func (client *BaseClient) AppendUserAgent(useragent string)

func (*BaseClient) Default

func (client *BaseClient) Default(realStr, defaultStr string) string

func (*BaseClient) DefaultNumber

func (client *BaseClient) DefaultNumber(realNum, defaultNum int) int

func (*BaseClient) GetAccessKeyId

func (client *BaseClient) GetAccessKeyId() (string, error)

func (*BaseClient) GetAccessKeySecret

func (client *BaseClient) GetAccessKeySecret() (string, error)

func (*BaseClient) GetAccessToken

func (client *BaseClient) GetAccessToken() (string, error)

func (*BaseClient) GetExpireTime

func (client *BaseClient) GetExpireTime() string

func (*BaseClient) GetHost

func (client *BaseClient) GetHost(host, defaultValue string) string

func (*BaseClient) GetPathname

func (client *BaseClient) GetPathname(nickName string, path string) string

func (*BaseClient) GetProtocol

func (client *BaseClient) GetProtocol(protocol, defaultValue string) string

func (*BaseClient) GetRFC2616Date

func (client *BaseClient) GetRFC2616Date() string

func (*BaseClient) GetRefreshToken

func (client *BaseClient) GetRefreshToken() string

func (*BaseClient) GetSignature

func (client *BaseClient) GetSignature(request *tea.Request) string

func (*BaseClient) GetUserAgent

func (client *BaseClient) GetUserAgent() string

func (*BaseClient) InitClient

func (client *BaseClient) InitClient(config map[string]interface{}) error

func (*BaseClient) IsStatusCode

func (client *BaseClient) IsStatusCode(response *tea.Response, code int) bool

func (*BaseClient) NotEmpty

func (client *BaseClient) NotEmpty(value string) bool

func (*BaseClient) ReadAsJSON

func (client *BaseClient) ReadAsJSON(response *tea.Response) (map[string]interface{}, error)

func (*BaseClient) SetAccessToken

func (client *BaseClient) SetAccessToken(token string)

func (*BaseClient) SetExpireTime

func (client *BaseClient) SetExpireTime(expireTime string) error

func (*BaseClient) SetRefreshToken

func (client *BaseClient) SetRefreshToken(token string)

func (*BaseClient) SetUserAgent

func (client *BaseClient) SetUserAgent(useragent string)

func (*BaseClient) ToJSONString

func (client *BaseClient) ToJSONString(request interface{}) io.Reader

func (*BaseClient) ToQuery

func (client *BaseClient) ToQuery(request interface{}) map[string]string

type Sorter

type Sorter struct {
	Keys []string
	Vals []string
}

Sorter defines the key-value structure for storing the sorted data in signHeader.

func (*Sorter) Len

func (hs *Sorter) Len() int

Len is an additional function for function SignHeader.

func (*Sorter) Less

func (hs *Sorter) Less(i, j int) bool

Less is an additional function for function SignHeader.

func (*Sorter) Sort

func (hs *Sorter) Sort()

Sort is an additional function for function SignHeader.

func (*Sorter) Swap

func (hs *Sorter) Swap(i, j int)

Swap is an additional function for function SignHeader.

Jump to

Keyboard shortcuts

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