activity

package
v1.0.38 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventAuthLogin                 = "auth.login"
	EventAuthLogout                = "auth.logout"
	EventServerStart               = "server.start"
	EventServerStop                = "server.stop"
	EventServerRestart             = "server.restart"
	EventServerCreate              = "server.create"
	EventServerUpdate              = "server.update"
	EventServerDelete              = "server.delete"
	EventServerPrivilegedOverrides = "server.privileged_overrides"
)

Event names written by the audit trail (MINE-141, SEC-3).

Variables

This section is empty.

Functions

func List

func List(db *gorm.DB, serverID, actor string, since time.Time, limit int) ([]storage.ActivityLog, error)

List returns newest-first records filtered by server, actor and time.

func Log

func Log(db *gorm.DB, e Entry) error

Log appends one audit record. Failures are returned; callers log and continue — auditing must never break the operation being audited.

func Prune

func Prune(db *gorm.DB, olderThan time.Time, minKeep int) (int64, error)

Prune deletes records older than olderThan, always keeping at least minKeep newest rows. Returns rows deleted.

Types

type Entry

type Entry struct {
	ActorID    string
	ActorName  string
	IP         string
	Event      string
	SubjectTyp string
	SubjectID  string
	Properties string
}

Entry is a single audit record.

Jump to

Keyboard shortcuts

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