audit

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package audit mirrors committed audit rows into the append-only daily JSONL log (RFC 8.1, 8.3). The SQLite audit table is written in the same transaction as each state change; this package exports those rows to audit/YYYY-MM-DD.jsonl after commit, fsyncing every batch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log writes audit rows to daily files.

func New

func New(dir string, redact func(string) string) (*Log, error)

New returns a log rooted at dir (created 0700).

func (*Log) Dir

func (l *Log) Dir() string

Dir returns the log directory.

func (*Log) Files

func (l *Log) Files() []string

Files lists current (uncompressed) day files, oldest first.

func (*Log) Rotate

func (l *Log) Rotate(now time.Time, retention time.Duration) int

Rotate gzips daily files older than today and deletes files older than retention. It returns how many files were compressed.

func (*Log) Write

func (l *Log) Write(rows []store.AuditRow)

Write appends rows (called from store.OnAudit).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL