gaeAccessToken

package
v0.0.0-...-afe0929 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

type TokenSet struct {
	AccessToken  string
	IDToken      string
	RefreshToken string
	ExpiresOn    time.Time
}

TokenSet is what is needed to access a GAE API.

func ParseTokenSetFromJson

func ParseTokenSetFromJson(jsonData []byte, tokenSet *TokenSet) (*TokenSet, error)

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

func (*TokenSet) Log

func (p *TokenSet) Log(s string)

type TokenState

type TokenState struct {
	*enum.Enumint
}

func NewTokenState

func NewTokenState(valuesMap []int, current int) *TokenState

this needs to be duplicated for each enum type

Jump to

Keyboard shortcuts

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