Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Record ¶
Record logs an audit event for an authenticated handler. It reads the actor from the Echo context (set by AuthMiddleware). Errors are logged but never returned — audit must not fail user requests.
func RecordWithActor ¶
func RecordWithActor(db *gorm.DB, c echo.Context, actorID, actorEmail, action, resourceType, resourceID string, details *string)
RecordWithActor logs an audit event with an explicit actor. Use this for pre-auth handlers (login, register) where context values are not yet populated.
Types ¶
type RetentionRunner ¶
type RetentionRunner struct {
// contains filtered or unexported fields
}
RetentionRunner periodically deletes old audit log entries.
func NewRetentionRunner ¶
func NewRetentionRunner(db *gorm.DB, maxDays int) *RetentionRunner
NewRetentionRunner creates and starts a retention runner that deletes audit logs older than maxDays. Ticks every hour.
func (*RetentionRunner) Stop ¶
func (r *RetentionRunner) Stop()
Stop stops the retention runner and waits for it to finish.
Click to show internal directories.
Click to hide internal directories.