audit

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package audit keeps an append-only JSONL log (one file per day in the state folder) of every remote command, copy, install and undo. The undo journal itself is kept by package engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Time    time.Time      `json:"time"`
	Action  string         `json:"action"` // e.g. ssh.exec, sftp.read, pull.commit, undo
	Host    string         `json:"host,omitempty"`
	Session string         `json:"session,omitempty"`
	Detail  map[string]any `json:"detail,omitempty"`
}

Entry is one audited action.

type Log

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

Log appends entries to <dir>/YYYY-MM-DD.jsonl. A nil *Log discards entries.

func Open

func Open(dir string) (*Log, error)

Open returns a log writing under dir (created with user-only permissions).

func (*Log) Dir

func (l *Log) Dir() string

Dir returns the log directory.

func (*Log) Write

func (l *Log) Write(e Entry)

Write appends one entry; logging failures never interrupt the user's operation.

Jump to

Keyboard shortcuts

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