Documentation ¶
Index ¶
- Variables
- type EventDispatcher
- func (ed *EventDispatcher) ClearHandlers()
- func (ed *EventDispatcher) DispatchEvent(event EventInterface) error
- func (ed *EventDispatcher) HasHandler(eventName string, handler EventHandlerInterface) bool
- func (ed *EventDispatcher) RegisterHandler(eventName string, handler EventHandlerInterface) error
- func (ed *EventDispatcher) RemoveHandler(event EventInterface, handler EventHandlerInterface) error
- type EventDispatcherInterface
- type EventHandlerInterface
- type EventInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorHandlerAlreadyRegistered = errors.New("handler already registered")
Functions ¶
This section is empty.
Types ¶
type EventDispatcher ¶
type EventDispatcher struct {
// contains filtered or unexported fields
}
func NewEventDispatcher ¶
func NewEventDispatcher() *EventDispatcher
func (*EventDispatcher) ClearHandlers ¶
func (ed *EventDispatcher) ClearHandlers()
func (*EventDispatcher) DispatchEvent ¶
func (ed *EventDispatcher) DispatchEvent(event EventInterface) error
func (*EventDispatcher) HasHandler ¶
func (ed *EventDispatcher) HasHandler(eventName string, handler EventHandlerInterface) bool
func (*EventDispatcher) RegisterHandler ¶
func (ed *EventDispatcher) RegisterHandler(eventName string, handler EventHandlerInterface) error
func (*EventDispatcher) RemoveHandler ¶
func (ed *EventDispatcher) RemoveHandler(event EventInterface, handler EventHandlerInterface) error
type EventDispatcherInterface ¶
type EventDispatcherInterface interface { RegisterHandler(eventName string, handler EventHandlerInterface) error DispatchEvent(event EventInterface) error RemoveHandler(event EventInterface, handler EventHandlerInterface) error HasHandler(eventName string, handler EventHandlerInterface) bool ClearHandlers() }
type EventHandlerInterface ¶
type EventHandlerInterface interface {
HandleEvent(event EventInterface, wg *sync.WaitGroup) error
}
type EventInterface ¶
Click to show internal directories.
Click to hide internal directories.