Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store handles credential storage with keyring preference and file fallback.
func NewStore ¶
func NewStore(opts StoreOptions) *Store
NewStore creates a credential store. It probes the system keyring and falls back to file storage if unavailable.
func (*Store) FallbackWarning ¶
FallbackWarning returns a warning message if the store fell back to file storage, or empty string if using keyring.
func (*Store) MigrateToKeyring ¶
MigrateToKeyring migrates credentials from file to keyring. No-op if keyring is not available.
func (*Store) UsingKeyring ¶
UsingKeyring returns true if the store is using the system keyring.
type StoreOptions ¶
type StoreOptions struct {
// ServiceName is the keyring service name (e.g., "basecamp", "fizzy").
ServiceName string
// DisableEnvVar is the env var name that disables keyring (e.g., "BASECAMP_NO_KEYRING").
// When set to any non-empty value, forces file-based storage.
DisableEnvVar string
// FallbackDir is the directory for file-based credential storage.
FallbackDir string
}
StoreOptions configures credential storage.
Click to show internal directories.
Click to hide internal directories.