audit

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: EUPL-1.2 Imports: 8 Imported by: 0

Documentation

Overview

Package audit provides infrastructure adapters for structured audit trail persistence. The FileAuditTrailWriter appends JSONL entries to a local file using O_APPEND atomic writes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileAuditTrailWriter

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

FileAuditTrailWriter appends JSONL audit entries to a local file. O_APPEND + entries under 4KB guarantee atomic writes per POSIX PIPE_BUF semantics.

func NewFileAuditTrailWriter

func NewFileAuditTrailWriter(path string) (*FileAuditTrailWriter, error)

NewFileAuditTrailWriter opens or creates the audit log file at path. Creates parent directories as needed. File permissions are 0o600.

func (*FileAuditTrailWriter) Close

func (w *FileAuditTrailWriter) Close() error

Close flushes and closes the underlying file. Safe to call multiple times.

func (*FileAuditTrailWriter) Write

Write marshals event to JSONL and appends it to the audit file. If the serialized entry exceeds posixPipeBuf bytes, input values are truncated iteratively (longest first) until the entry fits, and InputsTruncated is set.

Jump to

Keyboard shortcuts

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