Files
shhh/pkg/secretsstore/store.go

21 lines
633 B
Go

package secretsstore
type SecretsStore interface {
// Get retrieves the value associated with the provided key from the store.
Get(key Key) ([]byte, error)
// Put stores or replaces the value associated with the provided key.
Put(key Key, val []byte) error
// Delete removes the key and value from the store, deleting a non-existing key is a no-op.
Delete(key Key) error
}
// New returns a SecretsStore that uses the file at path for storage.
// path is created if it doesn't exist.
func New(path string) (SecretsStore, error) {
bstore, err := newBboltStore(path)
if err != nil {
return nil, err
}
return bstore, nil
}