Documentation
¶
Overview ¶
Package auditrest is the REST integration for auditlog: a read-side handler group (history / diff / changes) mountable on any skit router in one call. See handlers.go.
Recording is intentionally not done here — audit at the domain layer via the auditbus eventbus adapter or a direct auditlog.Core.Create, which covers every transport (HTTP, gRPC, workers, consumers) uniformly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppAuditLog ¶
type AppAuditLog struct {
ID int `json:"id"`
Version int `json:"version"`
ModelType string `json:"model_type"`
ModelID string `json:"model_id"`
Method string `json:"method"`
Path string `json:"path"`
Payload json.RawMessage `json:"payload"`
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
}
AppAuditLog is the REST representation of a single audit log version.
type AppDiff ¶
type AppDiff struct {
ModelType string `json:"model_type"`
ModelID string `json:"model_id"`
Diff string `json:"diff"`
}
AppDiff is the textual diff between two versions of a model.
type AppField ¶
type AppField struct {
Key string `json:"key"`
OldValue any `json:"old_value"`
NewValue any `json:"new_value"`
}
AppField is a single changed attribute between two versions.
type AppRecord ¶
type AppRecord struct {
Version int `json:"version"`
ModelType string `json:"model_type"`
ModelID string `json:"model_id"`
Method string `json:"method"`
Path string `json:"path"`
UpdatedBy *string `json:"updated_by,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
ChangedFields []AppField `json:"changed_fields"`
}
AppRecord is one version with the fields that changed since the previous one.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers is the read-side REST API for the audit log: history, diff between two versions, and changed-fields across all versions. Mount it on any skit router in one call with Routes; pair it with Middleware for the write side.
func NewHandlers ¶
NewHandlers builds the audit-log query handlers over core.