Documentation
¶
Overview ¶
Package sink dispatches a configured GitHub workflow on selected events (config.Sink): workflow_dispatch with the inputs verb, subject and time, nothing else. Every watch on the machine offers the events it follows; sink.json in the state directory claims each one once, so two watches never dispatch the same event twice.
Index ¶
Constants ¶
const Window = 10 * time.Minute
Window is how old an event may be and still be dispatched: one a watch did not reach within it (the machine was down, no watch ran) is let go, and a failed dispatch is retried within it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger keeps sink.json in beekeeper's state directory, changed only under sink.lock.
func (*Ledger) Claim ¶
func (l *Ledger) Claim(ctx context.Context, now time.Time, evs []state.Event) ([]state.Event, error)
Claim returns the events of evs this caller dispatches: not claimed yet, within Window of now and not before the ledger's start, and claims them. The first call starts the ledger and claims nothing.