Documentation
¶
Overview ¶
Package secrets keeps Blitz's secrets (API keys) out of its settings files: in the macOS Keychain, in the Secret Service on Linux (GNOME Keyring, KWallet), or, where neither is available, in an owner-only file beside the settings. A settings file refers to a stored secret as "keychain:<name>" (Ref); config resolves the reference when it loads.
Index ¶
Constants ¶
const RefPrefix = "keychain:"
RefPrefix marks a settings value that names a stored secret.
const Service = "dev.blitz"
Service is the name secrets are stored under (the keychain item's service, the Secret Service attribute).
Variables ¶
var ErrNotFound = errors.New("no such secret")
ErrNotFound: no secret is stored under the name.
Functions ¶
func SetDefault ¶
func SetDefault(s Store)
SetDefault replaces the store Default returns (tests, and the service once it knows its settings directory).
Types ¶
type FileStore ¶
type FileStore struct {
Path string
// contains filtered or unexported fields
}
FileStore keeps secrets in a TOML file.
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory keeps secrets in memory, for tests.