token

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package token represents an oauth2.TokenSource which has the ability to refresh the access token through the oauth server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source provides a Source with support for refreshing from the acd server.

func New

func New(path string) (*Source, error)

New returns a new Source implementing oauth2.TokenSource. The path must exist on the filesystem and must be of permissions 0600.

func (*Source) Token

func (ts *Source) Token() (*oauth2.Token, error)

Token returns an oauth2.Token. If the cached token (in (*Source).path) has expired, it will fetch the token from the server and cache it before returning it.

Jump to

Keyboard shortcuts

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