Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(opts ...Option) *Dispatcher
func (*Dispatcher) AddListener ¶
func (d *Dispatcher) AddListener(listener ...Listener)
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(event Event, data interface{})
type Option ¶
type Option func(*Dispatcher)
func WithRecovery ¶
func WithRecovery(handler RecoveryHandler) Option
type RecoveryHandler ¶ added in v2.3.1
var DefaultRecovery RecoveryHandler = func(err interface{}, listener Listener, event Event, data interface{}) { log.Errorf("[Event] handler panic listener: %v, event: %s, data: %v, err: %v", listener, event, data, err) }
Click to show internal directories.
Click to hide internal directories.