audit

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeOff  = "off"
	ModeDisk = "disk"
	ModeS3   = "s3"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Time         time.Time `json:"time"`
	UserID       string    `json:"userID"`
	Method       string    `json:"method"`
	Path         string    `json:"path"`
	UserAgent    string    `json:"userAgent"`
	SourceIP     string    `json:"sourceIP"`
	ResponseCode int       `json:"responseCode"`
	Host         string    `json:"host"`
}

type Logger

type Logger interface {
	LogEntry(LogEntry) error
	Close() error
}

func New

func New(ctx context.Context, options Options) (Logger, error)

type Options

type Options struct {
	AuditLogsMode             string `usage:"Enable audit logging" default:"off"`
	AuditLogsMaxFileSize      int    `usage:"Audit log max file size in bytes, logs will be flushed when this size is exceeded" default:"1073741824"`
	AuditLogsMaxFlushInterval int    `usage:"Audit log flush interval in seconds regardless of buffer size" default:"120"`
	AuditLogsCompressFile     bool   `usage:"Compress audit log files" default:"true"`

	store.DiskStoreOptions
	store.S3StoreOptions
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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