Documentation
¶
Overview ¶
Package store defines the composite store interface for Chronicle. Each subsystem defines its own store interface; the composite embeds them all.
Index ¶
- type Adapter
- func (a *Adapter) Accept(ctx context.Context, r acceptance.Request, h *chash.Chain, ...) (*acceptance.Receipt, error)
- func (a *Adapter) AppendWithChain(ctx context.Context, event *audit.Event, h *chash.Chain) error
- func (a *Adapter) CreateStreamInfo(ctx context.Context, info *chronicle.StreamInfo) error
- func (a *Adapter) GetStored(ctx context.Context, eventID id.ID) (*audit.Event, error)
- func (a *Adapter) GetStreamByScope(ctx context.Context, appID, tenantID string) (*chronicle.StreamInfo, error)
- func (a *Adapter) UpdateStreamHead(ctx context.Context, streamID id.ID, hash string, seq uint64) error
- func (a *Adapter) UpdateStreamScheme(ctx context.Context, streamID id.ID, scheme string, since uint64) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
Store
}
Adapter wraps a composite Store to implement chronicle.Storer, bridging the gap between stream.Stream and chronicle.StreamInfo to avoid import cycles.
func (*Adapter) Accept ¶
func (a *Adapter) Accept(ctx context.Context, r acceptance.Request, h *chash.Chain, prepare func(*audit.Event) error) (*acceptance.Receipt, error)
Accept preserves the backend receipt-first acceptance capability.
func (*Adapter) AppendWithChain ¶
AppendWithChain preserves the configured chain for mixed legacy writers.
func (*Adapter) CreateStreamInfo ¶
CreateStreamInfo creates a new stream from StreamInfo.
func (*Adapter) GetStored ¶
GetStored returns an event in its stored form, for hash verification.
The wrapped store may decrypt on read, and a decrypted event no longer matches the digest computed over the stored bytes. This forwards the capability so verification still sees what was persisted; stores that never transform events simply fall back to Get.
func (*Adapter) GetStreamByScope ¶
func (a *Adapter) GetStreamByScope(ctx context.Context, appID, tenantID string) (*chronicle.StreamInfo, error)
GetStreamByScope returns stream info for a given app+tenant scope.
type Store ¶
type Store interface {
audit.Store
stream.Store
verify.Store
erasure.Store
retention.Store
compliance.ReportStore
checkpoint.Store
// Migrate runs all schema migrations.
Migrate(ctx context.Context) error
// Ping checks database connectivity.
Ping(ctx context.Context) error
// Close closes the store connection.
Close() error
}
Store is the aggregate persistence interface. Each subsystem store is a composable interface — same pattern as ControlPlane.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package memory provides an in-memory implementation of the Chronicle store.
|
Package memory provides an in-memory implementation of the Chronicle store. |
|
Package mongo implements the Chronicle store interface using grove ORM with the MongoDB driver.
|
Package mongo implements the Chronicle store interface using grove ORM with the MongoDB driver. |
|
Package postgres implements the Chronicle store interface using grove ORM.
|
Package postgres implements the Chronicle store interface using grove ORM. |
|
Package redis implements the Chronicle store interface using Grove KV with the Redis driver.
|
Package redis implements the Chronicle store interface using Grove KV with the Redis driver. |
|
Package sealedstore decrypts sealed audit events on the way out of a store.
|
Package sealedstore decrypts sealed audit events on the way out of a store. |
|
Package sqlite implements the Chronicle store interface using grove ORM with the SQLite driver.
|
Package sqlite implements the Chronicle store interface using grove ORM with the SQLite driver. |