Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTokenNotFound is the expected error if the token is not found. ErrTokenNotFound = errors.New("token was not found") // ErrInvalidToken is the expected error if the token is not a valid. ErrInvalidToken = errors.New("invalid token") )
Functions ¶
This section is empty.
Types ¶
type FileRepository ¶
type FileRepository struct {
// contains filtered or unexported fields
}
func NewFileRepository ¶
func NewFileRepository(dir string) (*FileRepository, error)
func (*FileRepository) Close ¶
func (r *FileRepository) Close() error
Close closes the keyring repository.
type Repository ¶
type Repository interface { Get(key string) (*oauth2.Token, error) Set(key string, token *oauth2.Token) error Close() error }
Repository is responsible to store tokens somewhere.
type TokenManager ¶
type TokenManager struct {
// contains filtered or unexported fields
}
TokenManager allows to store and retrieve Token from a repository.
func New ¶
func New(repo Repository) *TokenManager
New returns a TokenManager using the specified repo.
func (*TokenManager) Close ¶
func (tm *TokenManager) Close() error
Close closes the token repository.
Click to show internal directories.
Click to hide internal directories.