Documentation ¶
Index ¶
- func NewDirectEventDispatcher() observer.EventDispatcher
- type DirectEventDispatcher
- type MockEventDispatcher
- func (m MockEventDispatcher) AddEventListener(listener observer.EventListener)
- func (m MockEventDispatcher) AddEventListeners(listenersSlice []observer.EventListener)
- func (m MockEventDispatcher) Dispatch(event observer.Event)
- func (m MockEventDispatcher) GetAllEventListeners() []observer.EventListener
- func (m MockEventDispatcher) RemoveAllEventListeners()
- func (m MockEventDispatcher) RemoveEventListener(listener observer.EventListener)
- func (m MockEventDispatcher) RemoveEventListeners(listenersSlice []observer.EventListener)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDirectEventDispatcher ¶
func NewDirectEventDispatcher() observer.EventDispatcher
NewDirectEventDispatcher ac constructor of DirectEventDispatcher
Types ¶
type DirectEventDispatcher ¶
type DirectEventDispatcher struct {
observer.BaseListener
}
DirectEventDispatcher is align with DirectEventDispatcher interface in Java. it's the top abstraction Align with 2.7.5 Dispatcher event to listener direct
func (*DirectEventDispatcher) Dispatch ¶
func (ded *DirectEventDispatcher) Dispatch(event observer.Event)
Dispatch event directly it lookup the listener by event's type. if listener not found, it just return and do nothing
type MockEventDispatcher ¶
type MockEventDispatcher struct { }
MockEventDispatcher will do nothing. It is only used by tests Now the implementation doing nothing, But you can modify this if needed
func (MockEventDispatcher) AddEventListener ¶
func (m MockEventDispatcher) AddEventListener(listener observer.EventListener)
AddEventListener do nothing
func (MockEventDispatcher) AddEventListeners ¶
func (m MockEventDispatcher) AddEventListeners(listenersSlice []observer.EventListener)
AddEventListeners do nothing
func (MockEventDispatcher) Dispatch ¶
func (m MockEventDispatcher) Dispatch(event observer.Event)
Dispatch do nothing
func (MockEventDispatcher) GetAllEventListeners ¶
func (m MockEventDispatcher) GetAllEventListeners() []observer.EventListener
GetAllEventListeners return empty list
func (MockEventDispatcher) RemoveAllEventListeners ¶
func (m MockEventDispatcher) RemoveAllEventListeners()
RemoveAllEventListeners do nothing
func (MockEventDispatcher) RemoveEventListener ¶
func (m MockEventDispatcher) RemoveEventListener(listener observer.EventListener)
RemoveEventListener do nothing
func (MockEventDispatcher) RemoveEventListeners ¶
func (m MockEventDispatcher) RemoveEventListeners(listenersSlice []observer.EventListener)
RemoveEventListeners do nothing