auditpostgres

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package auditpostgres provides a supported Postgres-backed audit recorder.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTable reports that a configured table name is not a safe SQL identifier.
	ErrInvalidTable = errors.New("invalid audit table")
	// ErrStoreNotConfigured reports that the store or pool was not configured.
	ErrStoreNotConfigured = errors.New("audit postgres store not configured")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Table string
	Clock func() time.Time
}

Options configures the Postgres audit store.

type Store

type Store struct {
	Pool ports.DatabasePool
	// contains filtered or unexported fields
}

Store writes audit events to Postgres.

func New

func New(pool ports.DatabasePool, opts Options) *Store

New creates a Postgres-backed audit recorder.

func (*Store) HealthChecker

func (s *Store) HealthChecker() ports.HealthChecker

HealthChecker returns a Postgres audit dependency health checker.

func (*Store) Record

func (s *Store) Record(ctx context.Context, event audit.Event) error

Record stores an audit event.

Jump to

Keyboard shortcuts

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