Documentation
¶
Overview ¶
Package spinesink adapts the dispatch waist to the event spine: it implements dispatch.EventSink by translating each dispatched action's lifecycle events into spine events on a run's stream. It is the glue between two ports, so it lives outside both - keeping the spine core free of any dependency on dispatch or state (which would otherwise form an import cycle).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EgressSink ¶
type EgressSink struct {
// contains filtered or unexported fields
}
EgressSink records netguard's egress decisions onto a run's spine stream as net.egress events, so a run's outbound network verdicts are part of the same recorded history as its governed actions. Construct one per run with that run's stream id and install it on the run's context with netguard.WithObserver, so every dial netguard makes under that context reports here. A run that makes no netguard-gated egress (a local, loopback model, say) records nothing, so the egress row stays silent.
func NewEgress ¶
func NewEgress(log spine.Log, stream string) *EgressSink
NewEgress returns an EgressSink that writes egress decisions to log on the given stream, attributed to the agent.
func (*EgressSink) Observe ¶
func (s *EgressSink) Observe(d netguard.Decision)
Observe is a netguard.Observer: it appends one net.egress event per decision, naming the destination host, the verdict (allowed or blocked), and the reason. It runs on a dial goroutine, so it uses a background context (a cancelled dial still records its verdict) and drops a failed append rather than surfacing it: the record is observability, and the dial's own allow/deny already enforced the policy.
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink records the dispatch waist's lifecycle events (start/end/rejected) onto a spine stream. Construct one per run with that run's stream id, then pass it via dispatch.WithEventSink - every action that run dispatches is then captured on the spine.