store

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package store defines the composite store interface for Chronicle. Each subsystem defines its own store interface; the composite embeds them all.

Index

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 NewAdapter

func NewAdapter(s Store) *Adapter

NewAdapter wraps a Store as a chronicle.Storer.

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

func (a *Adapter) AppendWithChain(ctx context.Context, event *audit.Event, h *chash.Chain) error

AppendWithChain preserves the configured chain for mixed legacy writers.

func (*Adapter) CreateStreamInfo

func (a *Adapter) CreateStreamInfo(ctx context.Context, info *chronicle.StreamInfo) error

CreateStreamInfo creates a new stream from StreamInfo.

func (*Adapter) GetStored

func (a *Adapter) GetStored(ctx context.Context, eventID id.ID) (*audit.Event, error)

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.

func (*Adapter) UpdateStreamHead

func (a *Adapter) UpdateStreamHead(ctx context.Context, streamID id.ID, hash string, seq uint64) error

UpdateStreamHead delegates to the underlying store.

func (*Adapter) UpdateStreamScheme

func (a *Adapter) UpdateStreamScheme(ctx context.Context, streamID id.ID, scheme string, since uint64) error

UpdateStreamScheme delegates to the underlying store.

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.
mongo module
postgres module
redis module
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.
sqlite module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL