mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-15 07:11:15 +00:00
feat: add simple audit ui
This commit is contained in:
@@ -1,18 +1,30 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
type AuditSeverityLevel string
|
||||
|
||||
const AuditSeverityLevelLow AuditSeverityLevel = "low"
|
||||
const AuditSeverityLevelHigh AuditSeverityLevel = "high"
|
||||
|
||||
type AuditEntry struct {
|
||||
UniqueId uint64 `gorm:"primaryKey;autoIncrement:true;column:id"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;index:idx_au_created"`
|
||||
|
||||
ContextUser string `gorm:"column:context_user;index:idx_au_context_user"`
|
||||
|
||||
Severity AuditSeverityLevel `gorm:"column:severity;index:idx_au_severity"`
|
||||
|
||||
Origin string `gorm:"column:origin"` // origin: for example user auth, stats, ...
|
||||
|
||||
Message string `gorm:"column:message"`
|
||||
}
|
||||
|
||||
type AuditEventWrapper[T any] struct {
|
||||
Ctx context.Context
|
||||
Source string
|
||||
Event T
|
||||
}
|
||||
|
Reference in New Issue
Block a user