Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
func NewEventBus() *EventBus
func (*EventBus) AddHandler ¶
func (eb *EventBus) AddHandler(name string, key string, f t.EventHandlerFcn)
AddHandler adds a new event handler to the event bus.
Parameters: - name: the name of the event. - key: the key associated with the event handler function. - f: the event handler function.
Returns: None.
func (*EventBus) Invoke ¶
Invoke sends an event to all registered handlers for the given event name.
Parameters: - name: the name of the event. - e: the event to be sent.
Returns: None.
func (*EventBus) RemoveHandler ¶
RemoveHandler removes an event handler from the event bus.
Parameters: - name: the name of the event. - key: the key associated with the event handler function.
Returns: None.
Click to show internal directories.
Click to hide internal directories.