eventmanager

package
v0.0.0-...-247c3a5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPayload = errors.New("invalid payload")

Functions

This section is empty.

Types

type Event

type Event interface {
	GetName() EventName
	GetPayload() Payload
}

type EventHandler

type EventHandler func(ctx context.Context, payload json.RawMessage) error

type EventManager

type EventManager interface {
	Publish(ctx context.Context, event Event) error
	PublishMany(ctx context.Context, events ...Event) error
	Subscribe(eventName EventName, handler EventHandler)
	StartHandling(ctx context.Context) error
	Stop(ctx context.Context) error
}

type EventName

type EventName string

type Payload

type Payload interface {
}

Payload Must be json marshalable and unmarshalable

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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