Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus interface { BusSubscriber BusPublisher }
Bus allows to subscribe/unsubscribe to external events and publish own events
type BusPublisher ¶
type BusPublisher interface {
Publish(event Event)
}
BusPublisher allows to publish own events
type BusSubscriber ¶
type BusSubscriber interface { Subscribe(eventID EventID, cb EventHandler) Subscription Unsubscribe(id Subscription) }
BusSubscriber allows to subscribe/unsubscribe own event handlers
type Event ¶
type Event interface {
EventID() EventID
}
Event must be implemented by anything that can be published
type EventHandler ¶
type EventHandler func(event Event)
EventHandler is function that can be subscribed to the event
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription represents active event subscription
Click to show internal directories.
Click to hide internal directories.