Documentation
¶
Overview ¶
Package event is the event handler
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDontForward = errors.New("dont forward")
ErrDontForward will stop the event from being forwarded to other handlers, including anything handlers.
Functions ¶
This section is empty.
Types ¶
type HandlerDoneErr ¶
type HandlerDoneErr struct {
Return error
}
HandlerDoneErr will stop the event loop and return the error if provided.
func (HandlerDoneErr) Error ¶
func (e HandlerDoneErr) Error() string
func (HandlerDoneErr) Unwrap ¶
func (e HandlerDoneErr) Unwrap() error
type Loop ¶
type Loop struct {
HandlerFunctions map[reflect.Type][]reflect.Value
Handlers []any
HandlerIndex int
}
func (*Loop) FindHandlers ¶
func (l *Loop) FindHandlers()
FindHandlers initializes and populates the HandlerFunctions map by reflecting over methods of registered handlers.
func (*Loop) Fire ¶
Fire dispatches the provided event to all appropriate handlers and invokes fallback handlers if the event is unhandled.
Click to show internal directories.
Click to hide internal directories.