Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler func(interface{})
EventHandler represents a function that handles events.
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
EventManager manages events and their handlers.
func NewEventManager ¶
func NewEventManager() *EventManager
NewEventManager creates a new instance of EventManager.
func (*EventManager) AddHandler ¶
func (em *EventManager) AddHandler(event string, handler EventHandler) int64
AddHandler adds an event handler for the specified event and returns the handler Id.
func (*EventManager) RemoveHandler ¶
func (em *EventManager) RemoveHandler(event string, handlerId int64)
RemoveHandler removes an event handler for the specified event and handler Id.
func (*EventManager) TriggerEvent ¶
func (em *EventManager) TriggerEvent(event string, data interface{})
TriggerEvent triggers the specified event with the given data.
Click to show internal directories.
Click to hide internal directories.
