Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound indicates that a secret key does not exist. ErrNotFound = errors.New("secrets: not found") // ErrReadOnly indicates that the selected store does not support writes. ErrReadOnly = errors.New("secrets: read-only store") // ErrNotImplemented indicates that the requested backend is only a placeholder. ErrNotImplemented = errors.New("secrets: not implemented") )
Functions ¶
This section is empty.
Types ¶
type CipherStore ¶
type CipherStore struct {
// contains filtered or unexported fields
}
CipherStore wraps a Store and encrypts values at rest.
func NewCipherStore ¶
func NewCipherStore(store Store, key []byte) (*CipherStore, error)
NewCipherStore creates a store that encrypts values with AES-GCM.
func (*CipherStore) Delete ¶
func (c *CipherStore) Delete(key string) error
type EnvStore ¶
type EnvStore struct{}
EnvStore provides read-only access to environment variables.
func NewEnvStore ¶
func NewEnvStore() *EnvStore
NewEnvStore creates a new environment-backed secret store.
type FallbackStore ¶
type FallbackStore struct {
// contains filtered or unexported fields
}
FallbackStore tries the primary store first, then falls back to secondary.
func NewFallbackStore ¶
func NewFallbackStore(primary, secondary Store) *FallbackStore
NewFallbackStore creates a store that tries primary first, then falls back to secondary.
func (*FallbackStore) Delete ¶
func (f *FallbackStore) Delete(key string) error
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is a thread-safe in-memory store intended for tests and ephemeral use.
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
NewMemoryStore creates a new in-memory store.
func (*MemoryStore) Delete ¶
func (s *MemoryStore) Delete(key string) error
Delete removes a secret from the in-memory store.
type PrefixStore ¶
type PrefixStore struct {
// contains filtered or unexported fields
}
PrefixStore adds a namespace prefix to keys.
func NewPrefixStore ¶
func NewPrefixStore(store Store, prefix string) *PrefixStore
NewPrefixStore wraps a Store and prepends the given prefix to all keys.
func (*PrefixStore) Delete ¶
func (p *PrefixStore) Delete(key string) error
type Store ¶
type Store interface {
Set(key string, value []byte) error
Get(key string) ([]byte, error)
Delete(key string) error
}
Store is the shared contract for secret backends.
type VaultStore ¶
type VaultStore struct{}
VaultStore is a placeholder for an external secret manager implementation.
func NewVaultStore ¶
func NewVaultStore() *VaultStore
NewVaultStore creates a placeholder Vault-backed store.
func (*VaultStore) Delete ¶
func (v *VaultStore) Delete(key string) error
Delete reports that the placeholder Vault store is not implemented yet.