Documentation
¶
Overview ¶
Package narrate renders the one console line the hub writes for every event it handles, whether the event arrived by webhook or was produced by the poller.
The operator who runs `wb daemon serve` in a terminal wants to see the hub work without opening the dashboard, so the format is fixed-column and readable at a glance rather than structured for machines:
14:02:11 push github.com/sneat-dev/wb default branch main -> 3f1c2a9; queued for laptop 14:06:30 poll github.com/sneat-dev/wb no change 15:00:00 redeliver push github.com redelivered (attempt 1 of 3)
Columns are local time, the event name as GitHub names it ("poll" for the poller, "redeliver" for the missed-webhook recovery sweep), the organisation or repository the event is about, and the action taken in plain words.
A Line carries only metadata the repository-event contract already treats as publishable. Callers must never put a token, a webhook secret, or a payload body into one: the daemon's console is echoed into the log file a detached daemon writes, and that file is routinely pasted into issues.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Line ¶
type Line struct {
// At is the moment the hub decided what to do with the event. It is
// rendered in the location it carries, so a caller that wants local time
// passes local time.
At time.Time
// Event is the event name as GitHub names it: "push", "repository",
// "installation", "poll" for the polling ingester, or "redeliver" for the
// missed-webhook recovery sweep.
Event string
// Subject is the organisation or repository the event is about.
Subject string
// Action is what the hub did, in plain words.
Action string
}
Line is one narrated event.
type Writer ¶
Writer sends narrated lines to the daemon's console. The zero value discards them, so a caller that has nowhere to write needs no branch.
Quiet is what `wb daemon serve --quiet` sets. It silences the console only: a detached daemon started by `wb daemon start` never passes --quiet, so the log file it writes keeps every line.