Documentation
¶
Overview ¶
Package store defines the composite store interface for Keysmith.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrKeyNotFound = errors.New("keysmith: key not found") ErrPolicyNotFound = errors.New("keysmith: policy not found") ErrScopeNotFound = errors.New("keysmith: scope not found") ErrRotationNotFound = errors.New("keysmith: rotation record not found") )
Not-found sentinels. Every backend returns these (possibly wrapped), so callers can tell a missing row from a failed query with errors.Is. The root keysmith package re-exports them under the same names.
var ErrKeyConflict = errors.New("keysmith: key changed since it was read")
ErrKeyConflict is returned by key.Store.UpdateIfVersion when the key exists but its stored version is not the one the caller read: another write landed in between. Every backend returns it (possibly wrapped), and the root keysmith package re-exports it under the same name.
Functions ¶
Types ¶
type Store ¶
type Store interface {
// Keys returns the key store.
Keys() key.Store
// Policies returns the policy store.
Policies() policy.Store
// Usages returns the usage store.
Usages() usage.Store
// Rotations returns the rotation store.
Rotations() rotation.Store
// Scopes returns the scope store.
Scopes() scope.Store
// Migrate runs database migrations.
Migrate(ctx context.Context) error
// Ping checks database connectivity.
Ping(ctx context.Context) error
// Close releases database resources.
Close() error
}
Store composes all Keysmith subsystem stores via accessor methods. Implementations must provide all subsystem stores plus lifecycle methods.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package memory provides an in-memory implementation of store.Store for testing.
|
Package memory provides an in-memory implementation of store.Store for testing. |
|
Package mongo provides a MongoDB implementation of store.Store using grove ORM.
|
Package mongo provides a MongoDB implementation of store.Store using grove ORM. |
|
Package postgres provides a PostgreSQL implementation of store.Store using grove ORM.
|
Package postgres provides a PostgreSQL implementation of store.Store using grove ORM. |
|
Package sqlite provides a SQLite implementation of store.Store using grove ORM.
|
Package sqlite provides a SQLite implementation of store.Store using grove ORM. |