Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyAlreadyExists = errors.New("key already exists")
View Source
var ErrNotFound = errors.New("key not found")
ErrNotFound indicates that the specified crypto storage entry couldn't be found.
Functions ¶
This section is empty.
Types ¶
type KVStorage ¶
type KVStorage struct {
// contains filtered or unexported fields
}
func (KVStorage) DeleteSecret ¶
type Storage ¶
type Storage interface {
// Ping checks if the server is available and the credentials are correct.
Ping() error
// GetSecret from the storage backend and return its value.
GetSecret(key string) ([]byte, error)
// StoreSecret stores the secret under the key in the storage backend.
StoreSecret(key string, value []byte) error
// DeleteSecret the key under the given key in the storage backend.
DeleteSecret(key string) error
// ListKeys returns a list of all keys in the storage backend.
ListKeys() ([]string, error)
}
Storage interface containing functions for storing and retrieving keys.
func NewKVStore ¶
NewKVStore creates a new Vault backend using the kv version 1 secret engine: https://www.vaultproject.io/docs/secrets/kv It currently only supports token authentication which should be provided by the token param. If config.Address is empty, the VAULT_ADDR environment should be set. If config.Token is empty, the VAULT_TOKEN environment should be is set.
Click to show internal directories.
Click to hide internal directories.