audit

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package audit records admin-relevant actions to the audit_log table. Meta must never contain flags or password hashes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger writes audit entries. Failures are logged, not propagated — an audit write must never fail the action it records.

func New

func New(q *gen.Queries, log *slog.Logger) *Logger

New builds an audit logger.

func (*Logger) Log

func (l *Logger) Log(ctx context.Context, actorID uuid.UUID, action, subjectType, subjectID string, meta map[string]any)

Log records one action. actorID may be uuid.Nil for system actions.

Jump to

Keyboard shortcuts

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