Versions in this module Expand all Collapse all v1 v1.0.0 Aug 26, 2026 Changes in this version + const MaxAuditBatch + const MaxCommandCursorBytes + const MaxCommandPageSize + const MaxCommandRetentionBatch + var ErrAuditAnchorNotFound = errors.New("postgres: audit anchor not found") + var ErrAuditHashInvalid = errors.New("postgres: invalid audit hash") + var ErrAuditSequenceExhausted = errors.New("postgres: audit sequence exhausted") + var ErrCommandNotFound = errors.New("postgres: command not found") + var ErrCompletionConflict = errors.New("postgres: terminal command result conflicts with stored result") + var ErrDesiredStateConflict = errors.New("postgres: desired state update conflict") + var ErrDesiredStateNotFound = errors.New("postgres: desired state not found") + var ErrIdempotencyConflict = errors.New("postgres: idempotency key conflicts with stored command") + var ErrInvalidAuditRequest = errors.New("postgres: invalid audit request") + var ErrInvalidAuditState = errors.New("postgres: invalid audit state") + var ErrInvalidCommandRequest = errors.New("postgres: invalid command request") + var ErrInvalidCommandRetentionRequest = errors.New("postgres: invalid command retention request") + var ErrInvalidCommandRetentionState = errors.New("postgres: invalid command retention state") + var ErrInvalidCommandState = errors.New("postgres: invalid command state") + var ErrInvalidDesiredLookup = errors.New("postgres: invalid desired-state lookup") + var ErrInvalidMigrationDatabase = errors.New("postgres: migration database is nil") + var ErrInvalidRuntimePool = errors.New("postgres: invalid runtime pool") + var ErrNilBeginner = errors.New("postgres: transaction beginner is nil") + var ErrNilQueryer = errors.New("postgres: queryer is nil") + var ErrResultNotTerminal = errors.New("postgres: command result is not terminal") + func MigrationSource() (migrations.Source, error) + func NewMigrationRunner(database *sql.DB) (*migrations.Runner, error) + type AuditPage struct + Entries []history.Entry + NextSequence uint64 + type AuditStore struct + func NewAuditStore(beginner gopostgres.Beginner) (*AuditStore, error) + func (s *AuditStore) AuditSensitiveAccess(ctx context.Context, access controlplane.SensitiveAccess) error + func (s *AuditStore) ListTenant(ctx context.Context, tenant string, after uint64, limit uint32) (AuditPage, error) + func (s *AuditStore) RetainBefore(ctx context.Context, tenant string, cutoff time.Time, batchSize uint32) (RetentionResult, error) + func (s *AuditStore) VerifyTenant(ctx context.Context, tenant string, pageSize uint32) (VerificationReport, error) + type CommandPage struct + NextCursor string + Records []CommandRecord + type CommandRecord struct + Command controlplane.Command + Result controlplane.CommandResult + type CommandRetentionResult struct + Deleted uint32 + type CommandStore struct + func NewCommandStore(beginner gopostgres.Beginner) (*CommandStore, error) + func (s *CommandStore) Get(ctx context.Context, tenant string, key string) (controlplane.CommandResult, error) + func (s *CommandStore) ListTenant(ctx context.Context, tenant string, cursor string, limit uint32) (CommandPage, error) + func (s *CommandStore) RetainCommandsBefore(ctx context.Context, tenant string, cutoff time.Time, batchSize uint32) (CommandRetentionResult, error) + type DesiredStore struct + func NewDesiredStore(queryer rowQueryer) (*DesiredStore, error) + func (s *DesiredStore) Get(ctx context.Context, tenant string, target controlplane.Target) (control.DesiredRecord, error) + type Journal struct + func NewJournal(beginner gopostgres.Beginner) (*Journal, error) + func (j *Journal) Accept(ctx context.Context, command controlplane.Command) (controlplane.CommandResult, bool, error) + func (j *Journal) Complete(ctx context.Context, result controlplane.CommandResult) error + func (j *Journal) MarkAcknowledged(ctx context.Context, result controlplane.CommandResult) error + func (j *Journal) MarkDispatched(ctx context.Context, result controlplane.CommandResult) error + type PoolReadiness struct + func (readiness *PoolReadiness) Ready(ctx context.Context) error + type RetentionResult struct + AnchorHash history.Hash + AnchorSequence uint64 + Deleted uint32 + RetainedThrough time.Time + type Runtime struct + Audit *AuditStore + Commands *CommandStore + Desired *DesiredStore + Journal *Journal + Readiness *PoolReadiness + func NewRuntime(pool *gopostgres.Pool) (*Runtime, error) + type VerificationReport struct + Events uint64 + HeadHash history.Hash + HeadSequence uint64