Documentation
¶
Overview ¶
Package observing defines the transport-neutral event intake facade.
Integrations turn webhook deliveries, chat messages, mail, and polling results into Observation values. They do not need to know how an optional event implementation deduplicates, correlates, or schedules triage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
Actor is the party an observation says caused it. Authenticated is kept next to the name so an allow-list can never accidentally trust a name that was merely copied from an unverified payload.
func AuthenticatedActor ¶
AuthenticatedActor constructs a verified actor, or nil for a blank name.
func ClaimedActor ¶
ClaimedActor constructs an explicitly unverified actor.
func (*Actor) AuthenticatedName ¶
AuthenticatedName returns a name suitable for security decisions.
type EventIntake ¶
type EventIntake interface {
Observe(Observation) error
}
EventIntake receives normalized or raw observations. Implementations should validate at their boundary and return errors rather than silently dropping malformed deliveries.
type EventIntakes ¶
type EventIntakes []EventIntake
EventIntakes fans one observation out to multiple independent consumers. Each intake gets the same value, and an error from one does not prevent the others from observing it. The returned error is an aggregate with enough context to identify every failed consumer.
func (EventIntakes) Observe ¶
func (all EventIntakes) Observe(observation Observation) error
Observe fans out to all configured intakes.
type Observation ¶
type Observation struct {
Source string
DeliveryID string
Kind string
CorrelationKey string
Title string
Summary string
PayloadJSON string
ObservedAt time.Time
Route Route
Actor *Actor
}
Observation is one external event in a transport-neutral form.
func (Observation) Normalize ¶
func (o Observation) Normalize(now time.Time) (Observation, error)
Normalize fills transport-neutral defaults and trims policy keys. It does not invent a delivery or correlation id.
func (Observation) Validate ¶
func (o Observation) Validate() error
Validate checks the identity fields required for durable deduplication and deterministic correlation.