events

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package events defines published business events and their occurrence metadata. Publishing modules own each contract's meaning and version; consuming modules own their handlers. This package contains no publication or delivery behavior.

Index

Constants

View Source
const UserRegisteredType = "identity.user_registered.v1"

UserRegisteredType is the topic for Identity account creation.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID         uuid.UUID `json:"event_id"`
	Type       string    `json:"event_type"`
	OccurredAt time.Time `json:"occurred_at"`
}

Event contains metadata shared by all events.

func NewEvent

func NewEvent(eventType string) Event

NewEvent creates occurrence metadata with a fresh ID and UTC timestamp.

type UserRegistered

type UserRegistered struct {
	Event

	UserID uuid.UUID `json:"user_id"`
}

UserRegistered records an account created by Identity after its transaction commits. Consuming modules own their reactions.

func NewUserRegistered

func NewUserRegistered(userID uuid.UUID) UserRegistered

NewUserRegistered describes a new account occurrence without publishing it.

Jump to

Keyboard shortcuts

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