Documentation
¶
Overview ¶
Package audit centralizes audit_log writes so mutating handlers can record their actions with a single call. Write failures are returned so the caller decides whether to fail the operation or carry on (typical webapi call sites swallow the error after a slog.Warn — audit is advisory, not load-bearing).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Entry ¶
type Entry struct {
OrgID pgtype.UUID
Actor string
Action string
TargetKind string
TargetID *uuid.UUID
Detail map[string]any
}
Entry is one audit event ready to persist.
Zero-value fields map to NULL:
- Actor="" → NULL (use "system" when the caller is not a user)
- TargetKind="" → NULL
- TargetID=nil → NULL
- Detail=nil → JSON {}
Click to show internal directories.
Click to hide internal directories.