accesstoken

package
v0.133.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenFilePath

func TokenFilePath() string

TokenFilePath returns the path to the token file.

Types

type T

type T struct {
	TokenType    string    `yaml:"tokenType"`
	TokenExpiry  time.Time `yaml:"tokenExpiry"`
	AccessToken  string    `yaml:"accessToken"`
	RefreshToken string    `yaml:"refreshToken"`
}

T is the token.

func LoadToken

func LoadToken(ctx context.Context, c *configs.C) (*T, error)

LoadToken loads the token from a file.

type TokenExchanger

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

TokenExchanger exchanges a code for a token.

func NewTokenExchanger

func NewTokenExchanger(c *configs.C) (*TokenExchanger, error)

NewTokenExchanger creates a new token exchanger.

func (*TokenExchanger) LoginURL

func (e *TokenExchanger) LoginURL() (string, error)

LoginURL returns a URL to login.

func (*TokenExchanger) ObtainToken

func (e *TokenExchanger) ObtainToken(ctx context.Context, code string) error

ObtainToken obtains a token from the issuer.

Jump to

Keyboard shortcuts

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