Documentation
¶
Overview ¶
Package event implements an embeddable type that uses the observation pattern to facilitate an event bus.
Index ¶
Constants ¶
View Source
const ( // Shutdown is the shutdown event. Shutdown = Type(iota) // Reboot is the reboot event. Reboot // Upgrade is the upgrade event. Upgrade // Reset is the reset event. Reset )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Embeddable ¶
type Embeddable struct { Chan Channel // contains filtered or unexported fields }
Embeddable is a type that implements sane defaults as an observer.
func (*Embeddable) Channel ¶
func (e *Embeddable) Channel() Channel
Channel implements the Observer interface.
func (*Embeddable) Types ¶
func (e *Embeddable) Types() []Type
Types implements the Observer interface.
type Event ¶
type Event struct { Type Type Data interface{} }
Event represents an event in the observer pattern.
type ObserveNotifier ¶
ObserveNotifier is a composite interface consisting of the Observer, and Notifier interfaces.
Click to show internal directories.
Click to hide internal directories.