Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrListenerNotFound = errors.New("listener not found")
)
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface {
// On registers an event listener to events of a given type.
On(EventType, ListenerFunc)
// Dispatch fires an event of a given type.
Dispatch(context.Context, Event)
}
type Event ¶
type Event interface {
Type() EventType
Data() interface{}
}
Event defines the type and the data of an event.
type ListenerFunc ¶
ListenerFunc is a function that can receive events.
Click to show internal directories.
Click to hide internal directories.