Versions in this module Expand all Collapse all v1 v1.0.0 May 12, 2023 Changes in this version + const ErrCodeOK + type Client struct + Endpoint Endpoint + HttpClient *http.Client + Token *Token + TokenStorage TokenStorage + func (clt *Client) ExchangeToken(code string) (token *Token, err error) + func (clt *Client) GetToken(autoRefresh bool) (tk *Token, err error) + func (clt *Client) RefreshToken(refreshToken string) (token *Token, err error) + type Endpoint interface + ExchangeTokenURL func(code string) string + RefreshTokenURL func(refreshToken string) string + type Error struct + ErrCode int64 + ErrMsg string + func (err *Error) Error() string + type Token struct + AccessToken string + CreatedAt int64 + ExpiresIn int64 + OpenId string + RefreshToken string + Scope string + UnionId string + func (token *Token) Expired() bool + type TokenStorage interface + PutToken func(*Token) error + Token func() (*Token, error)