audit

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileAuditStore

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

FileAuditStore provides file-based audit storage in JSON Lines format.

func NewFileAuditStore

func NewFileAuditStore(filename string) (*FileAuditStore, error)

NewFileAuditStore creates a new FileAuditStore.

func (*FileAuditStore) Close

func (f *FileAuditStore) Close() error

Close closes the file.

func (*FileAuditStore) Query

Query retrieves audit events matching the filter. Note: This loads all events from the file and filters in memory. For large datasets, consider using MemoryAuditStore.

func (*FileAuditStore) Save

func (f *FileAuditStore) Save(ctx context.Context, event *security.AuditEvent) error

Save saves an audit event to the file.

func (*FileAuditStore) Stats

Stats returns aggregated statistics. Note: This scans the entire file.

type MemoryAuditStore

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

MemoryAuditStore provides in-memory audit storage with a circular buffer.

func NewMemoryAuditStore

func NewMemoryAuditStore(capacity int) *MemoryAuditStore

NewMemoryAuditStore creates a new MemoryAuditStore with the given capacity.

func (*MemoryAuditStore) Close

func (m *MemoryAuditStore) Close() error

Close closes the store (no-op for memory store).

func (*MemoryAuditStore) Query

Query retrieves audit events matching the filter.

func (*MemoryAuditStore) Save

Save saves an audit event to the store.

func (*MemoryAuditStore) Stats

Stats returns aggregated statistics.

Jump to

Keyboard shortcuts

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