Documentation ¶
Index ¶
- Variables
- type EventDispatcher
- func (ed *EventDispatcher) Clear()
- func (ev *EventDispatcher) Dispatch(event EventInterface) error
- func (ed *EventDispatcher) Has(eventName string, handler EventHandlerInterface) bool
- func (ed *EventDispatcher) Register(eventName string, handler EventHandlerInterface) error
- func (ed *EventDispatcher) Remove(eventName string, handler EventHandlerInterface) error
- type EventDispatcherInterface
- type EventHandlerInterface
- type EventInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHandlerAlreadyRegistered = 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) Clear ¶
func (ed *EventDispatcher) Clear()
func (*EventDispatcher) Dispatch ¶
func (ev *EventDispatcher) Dispatch(event EventInterface) error
func (*EventDispatcher) Has ¶
func (ed *EventDispatcher) Has(eventName string, handler EventHandlerInterface) bool
func (*EventDispatcher) Register ¶
func (ed *EventDispatcher) Register(eventName string, handler EventHandlerInterface) error
func (*EventDispatcher) Remove ¶
func (ed *EventDispatcher) Remove(eventName string, handler EventHandlerInterface) error
type EventDispatcherInterface ¶
type EventDispatcherInterface interface { Register(eventName string, handler EventHandlerInterface) error Dispatch(event EventInterface) error Remove(eventName string, handler EventHandlerInterface) error Has(eventName string, handler EventHandlerInterface) bool Clear() }
type EventHandlerInterface ¶
type EventHandlerInterface interface {
Handle(event EventInterface, wg *sync.WaitGroup)
}
type EventInterface ¶
Click to show internal directories.
Click to hide internal directories.