Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Audit ¶
func Audit(entry AuditEntry)
Audit logs an audit entry as JSON to the standard log output. If JSON marshaling fails, it logs an error using the structured logger but continues execution.
func FatalF ¶
FatalF logs a formatted message at Fatal level and then calls os.Exit(1). It follows the printf formatting rules.
Types ¶
type AuditAction ¶
type AuditAction string
const AuditCreate AuditAction = "create"
const AuditDelete AuditAction = "delete"
const AuditEnter AuditAction = "enter"
const AuditFallback AuditAction = "fallback"
const AuditInitCheck AuditAction = "init-check"
const AuditList AuditAction = "list"
const AuditLogin AuditAction = "login"
const AuditRead AuditAction = "read"
const AuditUndelete AuditAction = "undelete"
type AuditEntry ¶
type AuditEntry struct { // Id is a unique identifier for the audit trail TrailId string // Timestamp indicates when the audited action occurred Timestamp time.Time // UserId identifies the user who performed the action UserId string // Action describes what operation was performed Action AuditAction // Path is the URL path of the request Path string // Resource identifies the object or entity that was acted upon Resource string // SessionID links the action to a specific user session SessionID string // State represents the state of the resource after the action State AuditState // Err contains an error message if the action failed Err string // Duration is the time taken to process the action Duration time.Duration }
AuditEntry represents a single audit log entry containing information about user actions within the system.
type AuditState ¶
type AuditState string
const AuditCreated AuditState = "created"
const AuditErrored AuditState = "error"
const AuditSuccess AuditState = "success"
Click to show internal directories.
Click to hide internal directories.