Documentation
¶
Index ¶
Constants ¶
View Source
const AuditTableDDL = `` /* 839-byte string literal not displayed */
AuditTableDDL is the CREATE TABLE statement for the audit events table. Call PGStore.Migrate to execute it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
ID string `json:"id"`
ActorID string `json:"actor_id"`
ActorEmail string `json:"actor_email"`
TenantID string `json:"tenant_id"`
Action string `json:"action"`
Resource string `json:"resource"`
ResourceID string `json:"resource_id"`
OldValues map[string]any `json:"old_values,omitempty"`
NewValues map[string]any `json:"new_values,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
IPAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
RequestID string `json:"request_id"`
CreatedAt time.Time `json:"created_at"`
}
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
type PGStore ¶
type PGStore struct {
// contains filtered or unexported fields
}
PGStore is a PostgreSQL-backed audit Store. Use NewPGStore to construct it, then call Migrate once at startup.
func NewPGStore ¶
NewPGStore creates a PGStore backed by the supplied connection pool.
func (*PGStore) List ¶
List returns audit events matching the query in descending creation order. Limit defaults to 100 and is capped at 200.
Click to show internal directories.
Click to hide internal directories.