Documentation
¶
Index ¶
Constants ¶
View Source
const (
// AccountName is the keychain account identifier used across all platforms.
AccountName = "m31a"
)
Variables ¶
View Source
var ( // (e.g., D-Bus not running on Linux, security CLI missing on macOS). ErrKeychainUnavailable = errors.New("keychain unavailable") // ErrKeyNotFound is returned when a requested key does not exist in the keychain. ErrKeyNotFound = errors.New("key not found") // ErrKeychainDecrypt is returned when the keychain secret blob is corrupted // or unreadable (e.g., GPG decryption failure on Linux pass backend). ErrKeychainDecrypt = errors.New("keychain secret blob is corrupted or unreadable") // ErrNotImplemented is returned on platforms where keychain operations // are not supported. ErrNotImplemented = errors.New("not implemented on this platform") )
Functions ¶
This section is empty.
Types ¶
type Keychain ¶
type Keychain interface {
// Get retrieves the value for the given service name.
// Returns ErrKeyNotFound if the key does not exist.
// Returns ErrKeychainUnavailable if the keychain backend is unavailable.
Get(service string) (string, error)
// Set stores a value for the given service name.
// If a value already exists for this service, it is overwritten.
// Returns ErrKeychainUnavailable if the keychain backend is unavailable.
Set(service, value string) error
// Delete removes the value for the given service name.
// Returns ErrKeyNotFound if the key does not exist.
// Returns ErrKeychainUnavailable if the keychain backend is unavailable.
Delete(service string) error
}
Keychain provides OS-native secure storage for API keys. Each platform implements this interface using the native secret storage mechanism.
Click to show internal directories.
Click to hide internal directories.