events

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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

View Source
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.

View Source
const DefaultDriver = internal.DefaultDriver

DefaultDriver is the driver name Open resolves when the config names none.

Variables

View Source
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 — the driver does not support replay.
	ErrReplayUnavailable = internal.ErrReplayUnavailable
	// ErrUnknownDriver — the named bus driver is not registered.
	ErrUnknownDriver = internal.ErrUnknownDriver
)

Re-exported sentinel errors callers compare via errors.Is.

View Source
var EventTypes = internal.EventTypes

EventTypes lists every registered EventType.

From extracts the bus from ctx, reporting presence.

View Source
var IsValidEventType = internal.IsValidEventType

IsValidEventType reports whether t is a registered EventType.

View Source
var MustFrom = internal.MustFrom

MustFrom extracts the bus from ctx, panicking when absent.

Open resolves the configured bus driver and opens it.

View Source
var OpenDriver = internal.OpenDriver

OpenDriver opens a bus driver by explicit name.

View Source
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).

View Source
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().

View Source
var RegisteredDrivers = internal.RegisteredDrivers

RegisteredDrivers lists the seated bus driver names (blank-import sdk/drivers/prod to seat the production set).

View Source
var ValidateEvent = internal.ValidateEvent

ValidateEvent validates an Event record (type registered, identity complete, sequencing untouched).

View Source
var WithBus = internal.WithBus

WithBus returns a child context carrying the bus.

Functions

This section is empty.

Types

type Cursor

type Cursor = internal.Cursor

Cursor addresses a replay position on replay-capable drivers.

type Deps

type Deps = internal.Deps

Deps carries shared dependencies for deps-aware drivers (e.g. the durable driver sharing the runtime's StateStore).

type Event

type Event = internal.Event

Event is the canonical event record.

type EventBus

type EventBus = internal.EventBus

EventBus is the typed pub/sub bus interface.

type EventID

type EventID = internal.EventID

EventID uniquely identifies one published Event.

type EventPayload

type EventPayload = internal.EventPayload

EventPayload is the sealed payload interface; concrete payloads embed Sealed (or SafeSealed) to satisfy it.

type EventType

type EventType = internal.EventType

EventType names a registered event type ("task.spawned", ...).

type Filter

type Filter = internal.Filter

Filter scopes a subscription by (tenant, user, session) — the identity-mandatory subscription boundary (CLAUDE.md §6).

type Replayer

type Replayer = internal.Replayer

Replayer is the optional replay-from-cursor driver surface.

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 Sealed

type Sealed = internal.Sealed

Sealed is embedded by redactor-visible payload structs.

type Subscription

type Subscription = internal.Subscription

Subscription is one live, cancellable event subscription.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL