Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrKeyringUnavailable indicates the OS keyring is not accessible.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
Types ¶
type Config ¶
type Config struct {
Domain string `koanf:"domain" yaml:"domain"`
Token string `koanf:"token" yaml:"token"`
// TokenSource indicates where the token was loaded from (not persisted).
TokenSource TokenSource `koanf:"-" yaml:"-"`
}
type TokenSource ¶ added in v0.2.0
type TokenSource string
TokenSource describes where the token was resolved from.
const ( TokenSourceNone TokenSource = "none" TokenSourceKeyring TokenSource = "keyring" TokenSourceEnv TokenSource = "env" TokenSourceFile TokenSource = "file" )
func SetToken ¶ added in v0.2.0
func SetToken(path, token string) (TokenSource, error)
SetToken stores the token using the most secure available backend. It tries the OS keyring first; if unavailable, falls back to the config file. Returns the storage location used and any error.
Click to show internal directories.
Click to hide internal directories.