oauthstore

package
v0.0.0-...-3029327 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToken

func GetToken(ctx context.Context, conf Config) (*oauth2.Token, error)

func StorageTokenSource

func StorageTokenSource(ctx context.Context, c *Config, t *oauth2.Token) oauth2.TokenSource

Types

type Config

type Config struct {
	*oauth2.Config
	Storage
}

func (*Config) Client

func (c *Config) Client(ctx context.Context, t *oauth2.Token) *http.Client

func (*Config) Exchange

func (c *Config) Exchange(ctx context.Context, code string) (*oauth2.Token, error)

func (*Config) TokenSource

func (c *Config) TokenSource(ctx context.Context, t *oauth2.Token) oauth2.TokenSource

type FileStorage

type FileStorage struct {
	Path string
	// contains filtered or unexported fields
}

func (*FileStorage) GetToken

func (f *FileStorage) GetToken() (*oauth2.Token, error)

func (*FileStorage) SetToken

func (f *FileStorage) SetToken(t *oauth2.Token) error

type Storage

type Storage interface {
	GetToken() (*oauth2.Token, error)
	SetToken(*oauth2.Token) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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