Documentation ¶
Overview ¶
Package secretstorage provides a generic interface for storing and retrieving data from a secret storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is a not found error. ErrNotFound = keyring.ErrNotFound // ErrUnsupportedType is an unsupported type error. ErrUnsupportedType = errors.New("unsupported type") )
Functions ¶
This section is empty.
Types ¶
type KeyringStorage ¶
type KeyringStorage[V any] struct { // contains filtered or unexported fields }
KeyringStorage is a storage implementation that uses the OS keyring.
func NewKeyringStorage ¶
func NewKeyringStorage[V any](opts ...KeyringStorageOption) *KeyringStorage[V]
NewKeyringStorage creates a new KeyringStorage that uses the OS keyring.
func (*KeyringStorage[V]) Delete ¶
func (ss *KeyringStorage[V]) Delete(service string, key string) error
Delete deletes the value for the given key.
type KeyringStorageOption ¶
type KeyringStorageOption interface {
// contains filtered or unexported methods
}
KeyringStorageOption is an option to configure KeyringStorage.
func WithKeyring ¶
func WithKeyring(k keyring.Keyring) KeyringStorageOption
WithKeyring sets the keyring to use.
Click to show internal directories.
Click to hide internal directories.