Documentation ¶
Overview ¶
Package token provides utilities for caching Gmail auth token. TOOD(bzz) rename to auth?
Index ¶
- func FromContext(ctx context.Context) (*oauth2.Token, bool)
- func FromFile(file string) (*oauth2.Token, error)
- func FromWeb(config *oauth2.Config) *oauth2.Token
- func LabelFromContext(ctx context.Context) (string, bool)
- func NewLabelContext(parent context.Context, cookies []*http.Cookie) context.Context
- func NewLabelCookie(label string) *http.Cookie
- func NewSessionContext(parent context.Context, cookies []*http.Cookie) context.Context
- func NewSessionCookie(token *oauth2.Token) *http.Cookie
- func Save(path string, token *oauth2.Token)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returnes the token, saved from the cookies, if any.
func LabelFromContext ¶
LabelFromContext returnes the label, saved from the cookies, if any.
func NewLabelContext ¶
NewLabelContext reads label cookie, returnes context with the label set to it, if any.
func NewLabelCookie ¶
NewLabelCookie returns a new cookie with the token set.
func NewSessionContext ¶
NewSessionContext reads session cookie, returnes context with the token set to it, if any.
func NewSessionCookie ¶
NewSessionCookie returns a new cookie with the token set.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.