Documentation
¶
Overview ¶
Package token provides utilities for storing and retrieving data from a local file store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTokenExpired is returned from Get when a token is past its expiration. ErrTokenExpired = errors.New("expired") // ErrNotExist is returned when a token doesn't exist. ErrNotExist = errors.New("does not exist") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store can store and retrieve tokens from the local file system.
func NewChronoctlStore ¶ added in v1.12.0
NewChronoctlStore creates a new token store in the user's local cache directory to store short-lived chronoctl credentials
func NewFileStore ¶
NewFileStore returns a token store that stores tokens on disk relative to a given root. All files will have 0600 permissions. That is, they are only readable by the user putting them on disk.
Paths passed to storage methods must be valid filesystem paths. Paths also must be file paths, not directories.
func (*Store) GetDefaultOrg ¶ added in v1.12.0
GetDefaultOrg returns the default org within the store
func (*Store) SetDefaultOrg ¶ added in v1.12.0
SetDefaultOrg sets the token for the default org