runlog

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package runlog persists a compact record of every mooncake run to ~/.mooncake/runs.jsonl and provides a reader for the most recent entry.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoHistory = errors.New("no run history")

ErrNoHistory is returned by Last when the log file is absent or empty.

Functions

func Append

func Append(e Entry) error

Append writes e as a single JSON line to ~/.mooncake/runs.jsonl. The directory is created if it does not exist. Write failures are returned but callers should treat them as best-effort.

Types

type Entry

type Entry struct {
	TS         time.Time `json:"ts"`
	Config     string    `json:"config"`
	Changed    int       `json:"changed"`
	Ok         int       `json:"ok"`
	Skipped    int       `json:"skipped"`
	Failed     int       `json:"failed"`
	DurationMs int64     `json:"duration_ms"`
}

Entry is a single run record written to the log.

func Last

func Last() (Entry, error)

Last returns the most recent entry in the log. Returns ErrNoHistory when the file does not exist or contains no valid lines.

Jump to

Keyboard shortcuts

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