Documentation
¶
Overview ¶
Package event defines sanitized v1 DTOs and bounded sink transport. It is not a usage store or a second event authority. Envelope, LimiterAdmission, ExtensionMutation, Sink, Publisher, Validate and Error are candidate protected surfaces. Registration, Options, Stats, Delivery, NewDelivery and Delivery.Publish/Flush/Close/Stats plus SchemaVersion and MaxEnvelopeBytes are also designated candidate transport surfaces. Released protection requires the enterprise extension contract's published-tag and consumer gates.
Index ¶
Constants ¶
const MaxEnvelopeBytes = 16 * 1024
const SchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Delivery ¶
type Delivery struct {
// contains filtered or unexported fields
}
Delivery is a single worker owned by the existing gateway pipeline. Publish never waits for I/O. Sink callbacks execute serially; errors are never retried.
func (*Delivery) Close ¶
Close rejects new events immediately. The first call owns the shared shutdown budget; concurrent calls wait with their own (possibly shorter) deadline.
type Envelope ¶
type Envelope struct {
SchemaVersion int `json:"schema_version"`
ID string `json:"event_id"`
Family string `json:"family"`
Timestamp time.Time `json:"timestamp"`
Attribution attribution.Value `json:"attribution"`
Outcome string `json:"outcome"`
Reason string `json:"reason,omitempty"`
Limiter *LimiterAdmission `json:"limiter_admission,omitempty"`
Mutation *ExtensionMutation `json:"extension_mutation,omitempty"`
}
type ExtensionMutation ¶
type LimiterAdmission ¶
type Options ¶
type Options struct {
QueueSize int
WriteBudget time.Duration
Policy attribution.Policy
}
Options bounds one sink's transport. Zero values select the contract defaults. Policy must be the assembly-owned attribution allowlist.
type Registration ¶
type Registration struct {
ModuleID string
New func(context.Context) (Sink, error)
QueueSize int
WriteBudget time.Duration
}
Registration is an explicit assembly-owned sink factory. New must honor its context and return a fresh sink per server lifecycle (including Caddy reload). ModuleID must name a linked descriptor. Callbacks never enter the manifest.