Versions in this module Expand all Collapse all v0 v0.4.1 May 13, 2021 Changes in this version type Option + func WithMaxRetries(i uint64) Option v0.4.0 May 13, 2021 Changes in this version + func HmacSha256(data, key string) string + func Timestamp() string + type Client struct + func NewClient(endpoint Endpoint, accessID, accessKey string, opts ...Option) (c *Client) + func (c *Client) Do(r *http.Request) (res *http.Response, err error) + func (c *Client) DoAndParse(r Request, resp interface{}) (err error) + func (c *Client) Parse(res *http.Response, resp interface{}) error + func (c *Client) PlainSign(timestamp string) string + func (c *Client) Request(r Request) (req *http.Request, err error) + func (c *Client) Token() (token string, err error) + func (c *Client) TokenSign(token, timestamp string) string + type Endpoint string + const APIEndpointCN + const APIEndpointEU + const APIEndpointIN + const APIEndpointUS + type Error struct + Code int + Msg string + func (e Error) Error() string + type HTTPClient interface + Do func(*http.Request) (*http.Response, error) + type MemoryStore struct + func (s *MemoryStore) Refresh(c *Client) (err error) + func (s *MemoryStore) Token() string + type Option func(o *options) + func WithHTTPClient(c HTTPClient) Option + func WithLogger(l log.Logger) Option + func WithTokenStore(s TokenStorage) Option + type Request interface + Method func() string + URL func() string + type RequestBody interface + Body func() interface{} + type Response struct + Code int + Msg string + Result json.RawMessage + Success bool + Timestamp int64 + type TokenRequest struct + func (t *TokenRequest) Method() string + func (t *TokenRequest) SetRefresh(token string) + func (t *TokenRequest) URL() string + type TokenResponse struct + AccessToken string + ExpireTime int + RefreshToken string + UID string + type TokenStorage interface + Refresh func(c *Client) error + Token func() string