memory

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger is an in-memory audit logger backed by a mutex-protected slice.

func NewLogger

func NewLogger() *Logger

NewLogger creates a new in-memory audit logger.

func (*Logger) Log

func (l *Logger) Log(_ context.Context, entry audit.Entry) error

Log appends an entry to the in-memory log. If the entry has no ID, one is generated. If the entry has a zero Timestamp, the current time is used.

func (*Logger) Query

func (l *Logger) Query(_ context.Context, filter audit.Filter) ([]audit.Entry, error)

Query returns entries matching the filter, newest first.

Jump to

Keyboard shortcuts

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