Documentation
¶
Overview ¶
Package memory provides a bounded process-local audit sink for tests and development. It is not durable and must not be used as a compliance store.
Index ¶
- type Config
- type Store
- func (store *Store) Append(ctx context.Context, record audit.Record) (audit.AppendResult, error)
- func (store *Store) AppendBatch(ctx context.Context, records []audit.Record) (audit.BatchResult, error)
- func (store *Store) Export(ctx context.Context, query audit.Query, consume func(audit.Record) error) error
- func (store *Store) Query(ctx context.Context, query audit.Query) (audit.Page, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config declares all process-local capacity limits. Its zero value is invalid so tests cannot accidentally create an unbounded store.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a bounded concurrency-safe in-memory sink. Its context-aware gate owns records, insertion order, and the byte counter; no caller callback runs while the gate is held.
func (*Store) Append ¶
Append stores one record or reports an idempotent duplicate. Capacity and duplicate conflicts are confirmed rejections.
func (*Store) AppendBatch ¶
func (store *Store) AppendBatch(ctx context.Context, records []audit.Record) (audit.BatchResult, error)
AppendBatch validates and commits the entire batch atomically in input order. A returned error means no member of that call was added.