Documentation
¶
Overview ¶
Package store defines the persistence seam for Console. Store is the plugin interface; concrete backends (SQLite by default, Postgres later) live in subpackages and are selected at startup. Nothing above this package knows which backend is in use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckStore ¶
type CheckStore interface {
RecordCheck(ctx context.Context, c core.Check) error
LatestCheck(ctx context.Context, component string) (core.Check, error)
LatestChecks(ctx context.Context) ([]core.Check, error)
}
CheckStore persists health-check observations. RecordCheck appends; the Latest* methods read back the most recent state.
type ComponentStore ¶
type ComponentStore interface {
CreateComponent(ctx context.Context, c core.Component) error
GetComponent(ctx context.Context, key string) (core.Component, error)
ListComponents(ctx context.Context) ([]core.Component, error)
UpdateComponent(ctx context.Context, c core.Component) error
DeleteComponent(ctx context.Context, key string) error
}
ComponentStore persists monitored components.
type FlagStore ¶
type FlagStore interface {
CreateFlag(ctx context.Context, f core.Flag) error
GetFlag(ctx context.Context, key string) (core.Flag, error)
ListFlags(ctx context.Context) ([]core.Flag, error)
UpdateFlag(ctx context.Context, f core.Flag) error
DeleteFlag(ctx context.Context, key string) error
}
FlagStore persists feature flags.
type Store ¶
type Store interface {
FlagStore
ComponentStore
CheckStore
// Ping verifies the backend is reachable.
Ping(ctx context.Context) error
// Close releases any held resources.
Close() error
}
Store persists Console's domain objects. Implementations must be safe for concurrent use. All lookups return core.ErrNotFound when the key is absent; creates return core.ErrConflict when the key already exists.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package postgres provides a Postgres-backed implementation of store.Store.
|
Package postgres provides a Postgres-backed implementation of store.Store. |
|
Package sqlite provides a SQLite-backed implementation of store.Store.
|
Package sqlite provides a SQLite-backed implementation of store.Store. |