Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityHook ¶
ActivityHook receives normalized activity events.
type CaptureHook ¶
CaptureHook records events for assertions in tests.
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
Emitter fans out events to hooks while applying defaults.
func NewEmitter ¶
NewEmitter constructs an emitter from hooks and configuration.
type Event ¶
type Event struct {
Verb string
ActorID string
UserID string
TenantID string
ObjectType string
ObjectID string
Channel string
DefinitionCode string
Recipients []string
Metadata map[string]any
OccurredAt time.Time
}
Event describes an activity occurrence that can be fanned out to hooks. IDs are stringly-typed to avoid coupling call sites to specific UUID types.
func NormalizeEvent ¶
NormalizeEvent trims whitespace, clones metadata, and ensures a timestamp is present.
type Hooks ¶
type Hooks []ActivityHook
Hooks fans out events to zero or more hooks.
Click to show internal directories.
Click to hide internal directories.