Documentation
¶
Index ¶
- Constants
- type TokenSet
- func ParseTokenSetFromJson(jsonData []byte, tokenSet *TokenSet) (*TokenSet, error)
- func RefreshAccessToken(tokenSet *TokenSet, clientID string, clientSecret string) (*TokenSet, error)
- func RequestAccessToken(authCode string, clientID string, clientSecret string, redirectURI string) (*TokenSet, error)
- type TokenState
Constants ¶
View Source
const ( Active = iota // should be active, attempt to use as-is Refresh = iota // use refresh token to renew the token Expired = iota // expired or refresh token not available )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenSet ¶
TokenSet is what is needed to access a GAE API.
func ParseTokenSetFromJson ¶
supplied tokenSet may be nil, in which case a new one will be created.
func RefreshAccessToken ¶
func RefreshAccessToken(tokenSet *TokenSet, clientID string, clientSecret string) (*TokenSet, error)
RefreshAccessToken uses the refresh token to renew an access token.
func RequestAccessToken ¶
func RequestAccessToken(authCode string, clientID string, clientSecret string, redirectURI string) (*TokenSet, error)
RequestAccessToken takes code obtained from previous step and converts it into a token.
func (*TokenSet) GetState ¶
func (tokenSet *TokenSet) GetState() TokenState
type TokenState ¶
func NewTokenState ¶
func NewTokenState(valuesMap []int, current int) *TokenState
this needs to be duplicated for each enum type
Click to show internal directories.
Click to hide internal directories.