storetoken

package
v0.0.0-...-e20221d Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 4 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

StorageTokenSource will be used by our config.TokenSource method

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

TokenSource can be passed a token which is stored, or when a new one is retrieved, that's stored

type Storage

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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