Documentation
¶
Overview ¶
Package journal reads a systemd unit's journal through a journalctl subprocess — no cgo, so the release matrix stays a plain cross-compile. Entries carry the journal's own timestamps (the first source with real event times) and a cursor, the durable resume position: restart with the saved cursor and nothing is re-read.
Index ¶
Constants ¶
const MaxLine = 1024 * 1024
MaxLine bounds one journal record's JSON encoding.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command builds the journalctl invocation for one unit: follow mode, JSON output, resuming after cursor when one is known and starting at the present otherwise — a fresh input must not replay months of history as if it were happening now.
func Decode ¶
Decode reads JSON-line journal records and emits the well-formed ones. A malformed record is skipped — one broken line must not stop the stream — and reported in the returned count.