Versions in this module Expand all Collapse all v0 v0.3.0 Oct 5, 2026 Changes in this version type Config + MaxConns int32 + MaxOperations int v0.2.0 Oct 3, 2026 Changes in this version + const Append + const Export + const ModuleVersion + const Query + var ErrConfiguration = errors.New("invalid audit configuration") + var ErrConflict = errors.New("audit preparation already consumed") + var ErrInput = errors.New("invalid audit input") + var ErrLimited = errors.New("audit capacity exceeded") + var ErrUnavailable = errors.New("audit unavailable") + func AppendInTx(parent context.Context, tx pgx.Tx, prepared Prepared) error + func Migrate(ctx context.Context, dsn string) error + type Config struct + Now func() time.Time + type Event struct + Action string + Authority string + Outcome string + Target string + type Module struct + func NewPostgres(dsn string, config Config, logger *slog.Logger) (*Module, error) + func (m *Module) Descriptor() achrix.Descriptor + func (m *Module) FailureCount() uint64 + func (m *Module) Ready(parent context.Context) error + func (m *Module) Start(ctx context.Context) error + func (m *Module) Stop(ctx context.Context) error + type Page struct + NextCursor string + Records []Record + type Prepared struct + type Record struct + Action string + Actor achrix.Principal + Authority string + ID string + OccurredAt time.Time + Outcome string + Target string + type Service struct + func NewService(app *achrix.Application, module *Module) (*Service, error) + func (s *Service) Append(parent context.Context, actor achrix.Principal, event Event) (Record, error) + func (s *Service) CheckDatabase(dsn string) error + func (s *Service) Export(ctx context.Context, actor achrix.Principal, target, cursor string, limit int) (Page, error) + func (s *Service) Prepare(ctx context.Context, actor achrix.Principal, event Event) (Prepared, error) + func (s *Service) Query(ctx context.Context, actor achrix.Principal, target, cursor string, limit int) (Page, error)