Documentation
¶
Overview ¶
Package events is the public SDK facade over Harbor's internal/events package — the typed event bus every subsystem publishes to and subscribes from (RFC §3.6, §6.13). Alias-based re-exports only: no behavior lives here. Driver registration seams, Protocol wire conversion, the aggregator, and per-subsystem payload structs are deliberately private.
Index ¶
Constants ¶
const ( // EventTypeRuntimeError — a runtime operation failed. EventTypeRuntimeError = internal.EventTypeRuntimeError // EventTypeRuntimeWarning — unexpected but recovered. EventTypeRuntimeWarning = internal.EventTypeRuntimeWarning // EventTypeBusDropped — backpressure dropped events. EventTypeBusDropped = internal.EventTypeBusDropped // EventTypeBusSubscriptionIdleClosed — an idle subscription was closed. EventTypeBusSubscriptionIdleClosed = internal.EventTypeBusSubscriptionIdleClosed // EventTypeAuditRedactionFailed — the audit redactor failed loudly. EventTypeAuditRedactionFailed = internal.EventTypeAuditRedactionFailed // EventTypeAdminScopeUsed — an elevated-scope subscription was used. EventTypeAdminScopeUsed = internal.EventTypeAdminScopeUsed // EventTypeGovernanceBudgetExceeded — a cost ceiling rejected a call. EventTypeGovernanceBudgetExceeded = internal.EventTypeGovernanceBudgetExceeded // EventTypeGovernanceRateLimited — a rate limit rejected a call. EventTypeGovernanceRateLimited = internal.EventTypeGovernanceRateLimited // EventTypeRuntimeRunCancelled — a run was cancelled. EventTypeRuntimeRunCancelled = internal.EventTypeRuntimeRunCancelled // EventTypeTopologyChanged — the live topology snapshot changed. EventTypeTopologyChanged = internal.EventTypeTopologyChanged )
Canonical cross-subsystem event-type constants.
const DefaultDriver = internal.DefaultDriver
DefaultDriver is the driver name Open resolves when the config names none.
Variables ¶
var ( // ErrUnknownEventType — Publish with an unregistered EventType. ErrUnknownEventType = internal.ErrUnknownEventType // ErrIdentityScopeRequired — a non-admin filter missing the triple. ErrIdentityScopeRequired = internal.ErrIdentityScopeRequired // ErrAdminScopeRequired — cross-session subscription without admin scope. ErrAdminScopeRequired = internal.ErrAdminScopeRequired // ErrSubscriberLimitReached — the per-session subscriber cap hit. ErrSubscriberLimitReached = internal.ErrSubscriberLimitReached // ErrBusClosed — the bus has been closed. ErrBusClosed = internal.ErrBusClosed // ErrInvalidEvent — the event failed validation. ErrInvalidEvent = internal.ErrInvalidEvent // ErrIdentityRequired — the event's identity misses a component. ErrIdentityRequired = internal.ErrIdentityRequired // ErrCursorTooOld — the replay cursor predates the ring tail. ErrCursorTooOld = internal.ErrCursorTooOld ErrReplayUnavailable = internal.ErrReplayUnavailable // ErrUnknownDriver — the named bus driver is not registered. ErrUnknownDriver = internal.ErrUnknownDriver )
Re-exported sentinel errors callers compare via errors.Is.
var EventTypes = internal.EventTypes
EventTypes lists every registered EventType.
var From = internal.From
From extracts the bus from ctx, reporting presence.
var IsValidEventType = internal.IsValidEventType
IsValidEventType reports whether t is a registered EventType.
var MustFrom = internal.MustFrom
MustFrom extracts the bus from ctx, panicking when absent.
var Open = internal.Open
Open resolves the configured bus driver and opens it.
var OpenDriver = internal.OpenDriver
OpenDriver opens a bus driver by explicit name.
var OpenWith = internal.OpenWith
OpenWith opens the configured bus driver with shared dependencies (the deps-aware factory path; e.g. StateStore sharing for the durable driver).
var RegisterEventType = internal.RegisterEventType
RegisterEventType registers a custom EventType so ValidateEvent (and Publish) accept it. Embedders publishing their own event vocabulary call this from an init().
var RegisteredDrivers = internal.RegisteredDrivers
RegisteredDrivers lists the seated bus driver names (blank-import sdk/drivers/prod to seat the production set).
var ValidateEvent = internal.ValidateEvent
ValidateEvent validates an Event record (type registered, identity complete, sequencing untouched).
var WithBus = internal.WithBus
WithBus returns a child context carrying the bus.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
Deps carries shared dependencies for deps-aware drivers (e.g. the durable driver sharing the runtime's StateStore).
type EventPayload ¶
type EventPayload = internal.EventPayload
EventPayload is the sealed payload interface; concrete payloads embed Sealed (or SafeSealed) to satisfy it.
type Filter ¶
Filter scopes a subscription by (tenant, user, session) — the identity-mandatory subscription boundary (CLAUDE.md §6).
type SafePayload ¶
type SafePayload = internal.SafePayload
SafePayload marks a payload as redaction-exempt by construction.
type SafeSealed ¶
type SafeSealed = internal.SafeSealed
SafeSealed is embedded by redaction-exempt payload structs.
type Subscription ¶
type Subscription = internal.Subscription
Subscription is one live, cancellable event subscription.