github.com/rotari-dev/rotari/internal/weblog

Overview

package weblog // import "github.com/rotari-dev/rotari/internal/weblog"

Package weblog records bounded, allow-listed Web authentication and server
startup evidence in the master directory.

Constants

const (
	FileName        = "web-events.jsonl"
	RotatedFileName = "web-events.jsonl.1"
)

Functions

func Path(masterDir string) string
    Path returns the current event log path under masterDir.

Types

type Recorder struct {
	// Has unexported fields.
}
    Recorder queues records so filesystem latency and errors never change a Web
    response. Close flushes records already accepted into the queue.

func New(masterDir, command string, warning io.Writer) *Recorder
    New starts a recorder for command under masterDir.

func (recorder *Recorder) Close()
    Close flushes queued records and stops the writer.

func (recorder *Recorder) RecordAuthEvent(event webui.AuthEvent)
    RecordAuthEvent implements webui.AuthRecorder.

func (recorder *Recorder) RecordServerStart(start Start)
    RecordServerStart records a listener that is ready to serve.

type Start struct {
	Version                string
	ExecutableSHA256       string
	ExecutableModified     time.Time
	Host                   string
	Port                   int
	Auth                   string
	AllowExec              bool
	AllowTerminal          bool
	AllowControl           bool
	Notifications          bool
	ArtifactRootCount      int
	RegisteredBaseDirCount int
}
    Start describes the allow-listed facts recorded once a listener is up.