events

package
v0.0.0-...-ba62778 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	Name() string
}

Event interface for describing Domain Event

type EventHandler

type EventHandler interface {
	Notify(event Event) error
}

EventHandler interface for describing any object that should be notified upon some Event has happened.

type EventPublisher

type EventPublisher struct {
	// contains filtered or unexported fields
}

EventPublisher central structure for notifying all EventHandler.

func NewEventPublisher

func NewEventPublisher() *EventPublisher

NewEventPublisher creates a new event publisher.

func (*EventPublisher) Notify

func (e *EventPublisher) Notify(event Event) error

Notify notifies subscribed EventHandler for particular Event.

func (*EventPublisher) Subscribe

func (e *EventPublisher) Subscribe(handler EventHandler, events ...Event)

Subscribe subscribes EventHandler to particular Events,

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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