Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus interface {
// AddListener allows a listener to listen to events
// dispatched on this Bus.
AddListener(l Listener)
// RemoveListener allows a listener to stop listening
// to events dispatched on this Bus.
RemoveListener(l Listener)
// DispatchEvent dispatches an event to all listeners
// listening to this Bus.
DispatchEvent(e Event) error
}
Bus is the interface that must be implemented by an event bus.
type MemoryBus ¶
type MemoryBus struct {
// contains filtered or unexported fields
}
func NewMemoryBus ¶
func NewMemoryBus() *MemoryBus
func (*MemoryBus) AddListener ¶
func (*MemoryBus) DispatchEvent ¶
func (*MemoryBus) RemoveListener ¶
type MockBus ¶
func (*MockBus) AddListener ¶
func (*MockBus) DispatchEvent ¶
func (*MockBus) RemoveListener ¶
type MockListener ¶
func (*MockListener) GetUUID ¶
func (m *MockListener) GetUUID() uuid.UUID
func (*MockListener) OnEvent ¶
func (m *MockListener) OnEvent(e Event) error
type TempListener ¶
type TempListener struct {
// contains filtered or unexported fields
}
func NewTempListener ¶
func NewTempListener(onEvent func(e Event) error) TempListener
func (TempListener) GetUUID ¶
func (t TempListener) GetUUID() uuid.UUID
func (TempListener) OnEvent ¶
func (t TempListener) OnEvent(e Event) error
Click to show internal directories.
Click to hide internal directories.