Versions in this module Expand all Collapse all v1 v1.11.0 Nov 4, 2026 Changes in this version + var Migrations = func() *migrate.Group { ... }() + type ArchiveModel struct + AppID string + Category string + CreatedAt string + EventCount int64 + FromTimestamp string + ID string + PolicyID string + SinkName string + SinkRef string + TenantID string + ToTimestamp string + type CheckpointModel struct + Algorithm string + AppID string + CreatedAt string + EventCount int64 + FromHash string + FromSeq uint64 + ID string + PrevCheckpoint string + SignKeyID string + Signature []byte + SignedPayload string + StreamID string + TenantID string + ToHash string + ToSeq uint64 + type ErasureModel struct + AppID string + CreatedAt string + EventsAffected int64 + ID string + KeyDestroyed int + LegacyKeyRetained int + Reason string + RequestedBy string + Status string + SubjectID string + TenantID string + type EventModel struct + Action string + AppID string + Category string + CreatedAt string + EncryptionKeyID string + Erased int + ErasedAt string + ErasureID string + Hash string + HashKeyID string + HashScheme string + ID string + IP string + Metadata string + Outcome string + PrevHash string + Reason string + RequestID string + Resource string + ResourceID string + Sequence uint64 + SessionID string + Severity string + StreamID string + SubjectID string + TenantID string + Timestamp string + UserAgent string + UserID string + type Option func(*Store) + func WithHasher(h *hash.Chain) Option + type ReportModel struct + AppID string + CreatedAt string + Data string + Format string + GeneratedBy string + ID string + PeriodFrom string + PeriodTo string + TenantID string + Title string + Type string + type RetentionPolicyModel struct + AppID string + Archive int + Category string + CreatedAt string + Duration int64 + ID string + TenantID string + UpdatedAt string + type Store struct + func New(db *grove.DB, opts ...Option) *Store + func (s *Store) Aggregate(ctx context.Context, q *audit.AggregateQuery) (*audit.AggregateResult, error) + func (s *Store) Append(ctx context.Context, event *audit.Event) error + func (s *Store) AppendBatch(ctx context.Context, events []*audit.Event) error + func (s *Store) AppendCheckpoint(ctx context.Context, cp *checkpoint.Checkpoint) error + func (s *Store) ByUser(ctx context.Context, userID string, opts audit.TimeRange) (*audit.QueryResult, error) + func (s *Store) CheckpointsInRange(ctx context.Context, streamID id.ID, fromSeq, toSeq uint64) ([]*checkpoint.Checkpoint, error) + func (s *Store) Close() error + func (s *Store) CompleteErasure(ctx context.Context, erasureID id.ID, o erasure.Outcome) error + func (s *Store) Count(ctx context.Context, q *audit.CountQuery) (int64, error) + func (s *Store) CountBySubject(ctx context.Context, sq erasure.SubjectQuery) (int64, error) + func (s *Store) CountErasures(ctx context.Context, sc erasure.Scope) (int64, error) + func (s *Store) CreateStream(ctx context.Context, st *stream.Stream) error + func (s *Store) DeletePolicy(ctx context.Context, policyID id.ID) error + func (s *Store) DeleteReport(ctx context.Context, reportID id.ID) error + func (s *Store) EventRange(ctx context.Context, streamID id.ID, fromSeq, toSeq uint64) ([]*audit.Event, error) + func (s *Store) EventsOlderThan(ctx context.Context, pq retention.PurgeQuery) ([]*audit.Event, error) + func (s *Store) Gaps(ctx context.Context, streamID id.ID, fromSeq, toSeq uint64) ([]uint64, error) + func (s *Store) Get(ctx context.Context, eventID id.ID) (*audit.Event, error) + func (s *Store) GetCheckpoint(ctx context.Context, checkpointID id.ID) (*checkpoint.Checkpoint, error) + func (s *Store) GetErasure(ctx context.Context, erasureID id.ID) (*erasure.Erasure, error) + func (s *Store) GetPolicy(ctx context.Context, policyID id.ID) (*retention.Policy, error) + func (s *Store) GetReport(ctx context.Context, reportID id.ID) (*compliance.Report, error) + func (s *Store) GetStream(ctx context.Context, streamID id.ID) (*stream.Stream, error) + func (s *Store) GetStreamByScope(ctx context.Context, appID, tenantID string) (*stream.Stream, error) + func (s *Store) LastHash(ctx context.Context, streamID id.ID) (string, error) + func (s *Store) LastSequence(ctx context.Context, streamID id.ID) (uint64, error) + func (s *Store) LatestCheckpoint(ctx context.Context, streamID id.ID) (*checkpoint.Checkpoint, error) + func (s *Store) ListArchives(ctx context.Context, opts retention.ListOpts) ([]*retention.Archive, error) + func (s *Store) ListCheckpoints(ctx context.Context, streamID id.ID, opts checkpoint.ListOpts) ([]*checkpoint.Checkpoint, error) + func (s *Store) ListErasures(ctx context.Context, opts erasure.ListOpts) ([]*erasure.Erasure, error) + func (s *Store) ListPolicies(ctx context.Context, opts retention.ListPoliciesOpts) ([]*retention.Policy, error) + func (s *Store) ListReports(ctx context.Context, opts compliance.ListOpts) ([]*compliance.Report, error) + func (s *Store) ListStreams(ctx context.Context, opts stream.ListOpts) ([]*stream.Stream, error) + func (s *Store) MarkErased(ctx context.Context, sq erasure.SubjectQuery, erasureID id.ID) (int64, error) + func (s *Store) Migrate(ctx context.Context) error + func (s *Store) Ping(ctx context.Context) error + func (s *Store) PurgeEvents(ctx context.Context, eventIDs []id.ID) (int64, error) + func (s *Store) Query(ctx context.Context, q *audit.Query) (*audit.QueryResult, error) + func (s *Store) RecordArchive(ctx context.Context, a *retention.Archive) error + func (s *Store) RecordErasure(ctx context.Context, e *erasure.Erasure) error + func (s *Store) SavePolicy(ctx context.Context, p *retention.Policy) error + func (s *Store) SaveReport(ctx context.Context, r *compliance.Report) error + func (s *Store) SetHasher(h *hash.Chain) + func (s *Store) SubjectKeyUsage(ctx context.Context, subjectID string) ([]erasure.KeyUsage, error) + func (s *Store) UpdateStreamHead(ctx context.Context, streamID id.ID, hash string, seq uint64) error + func (s *Store) UpdateStreamScheme(ctx context.Context, streamID id.ID, scheme string, since uint64) error + type StreamModel struct + AppID string + CreatedAt string + HeadHash string + HeadSeq uint64 + ID string + Scheme string + SchemeSince uint64 + TenantID string + UpdatedAt string Other modules containing this package github.com/xraph/chronicle