Documentation
¶
Index ¶
- func NormalizeJSON(b []byte) string
- func UnifiedDiff(beforeJSON, afterJSON []byte) (unified string, added, removed int)
- type Recorder
- func (r *Recorder) Write(ctx context.Context, actor string, old, new *registry.FieldMeta) error
- func (r *Recorder) WriteAction(ctx context.Context, actor, action, targetVer, diffSummary string) error
- func (r *Recorder) WriteJSON(ctx context.Context, actor, action string, payload any) error
- func (r *Recorder) WriteTableJSON(ctx context.Context, actor, action, table string, payload any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeJSON ¶
NormalizeJSON formats and sorts keys so that JSON diffs are stable.
func UnifiedDiff ¶
UnifiedDiff returns a unified diff of two JSON documents and counts of added and removed key lines. Only lines containing '":' (JSON key lines) are counted as changes in the added and removed totals.
Types ¶
type Recorder ¶
Recorder writes audit logs to the database.
func (*Recorder) WriteAction ¶
func (r *Recorder) WriteAction(ctx context.Context, actor, action, targetVer, diffSummary string) error
WriteAction inserts a generic audit log entry for high level actions like snapshot creation or rollback. The diffSummary may be any short description such as "+2 -0".
Click to show internal directories.
Click to hide internal directories.