Documentation ¶
Index ¶
- Constants
- func AddListener(evt EventName, listener ...Listener)
- func Clear()
- func Emit(evt EventName, data ...interface{})
- func GetMaxListeners() int
- func Len() int
- func ListenerCount(evt EventName) int
- func On(evt EventName, listener ...Listener)
- func Once(evt EventName, listener ...Listener)
- func RemoveAllListeners(evt EventName) bool
- func SetMaxListeners(n int)
- type BaseEmitter
- func (e *BaseEmitter) AddListener(evt EventName, listener ...Listener)
- func (e *BaseEmitter) Clear()
- func (e *BaseEmitter) Emit(evt EventName, data ...interface{})
- func (e *BaseEmitter) EventNames() []EventName
- func (e *BaseEmitter) GetMaxListeners() int
- func (e *BaseEmitter) Len() int
- func (e *BaseEmitter) ListenerCount(evt EventName) int
- func (e *BaseEmitter) Listeners(evt EventName) []Listener
- func (e *BaseEmitter) On(evt EventName, listener ...Listener)
- func (e *BaseEmitter) Once(evt EventName, listener ...Listener)
- func (e *BaseEmitter) RemoveAllListeners(evt EventName) bool
- func (e *BaseEmitter) RemoveListener(evt EventName, listener Listener) bool
- func (e *BaseEmitter) SetMaxListeners(n int)
- type EventEmmiter
- type EventName
- type Events
- type Listener
Constants ¶
View Source
const ( DefaultMaxListeners = 0 EnableWarning = false )
Variables ¶
This section is empty.
Functions ¶
func AddListener ¶
func GetMaxListeners ¶
func GetMaxListeners() int
func ListenerCount ¶
func RemoveAllListeners ¶
func SetMaxListeners ¶
func SetMaxListeners(n int)
Types ¶
type BaseEmitter ¶
type BaseEmitter struct {
// contains filtered or unexported fields
}
func (*BaseEmitter) AddListener ¶
func (e *BaseEmitter) AddListener(evt EventName, listener ...Listener)
func (*BaseEmitter) Clear ¶
func (e *BaseEmitter) Clear()
func (*BaseEmitter) Emit ¶
func (e *BaseEmitter) Emit(evt EventName, data ...interface{})
func (*BaseEmitter) EventNames ¶
func (e *BaseEmitter) EventNames() []EventName
func (*BaseEmitter) GetMaxListeners ¶
func (e *BaseEmitter) GetMaxListeners() int
func (*BaseEmitter) Len ¶
func (e *BaseEmitter) Len() int
func (*BaseEmitter) ListenerCount ¶
func (e *BaseEmitter) ListenerCount(evt EventName) int
func (*BaseEmitter) Listeners ¶
func (e *BaseEmitter) Listeners(evt EventName) []Listener
func (*BaseEmitter) On ¶
func (e *BaseEmitter) On(evt EventName, listener ...Listener)
func (*BaseEmitter) Once ¶
func (e *BaseEmitter) Once(evt EventName, listener ...Listener)
func (*BaseEmitter) RemoveAllListeners ¶
func (e *BaseEmitter) RemoveAllListeners(evt EventName) bool
func (*BaseEmitter) RemoveListener ¶
func (e *BaseEmitter) RemoveListener(evt EventName, listener Listener) bool
func (*BaseEmitter) SetMaxListeners ¶
func (e *BaseEmitter) SetMaxListeners(n int)
type EventEmmiter ¶
type EventEmmiter interface { AddListener(EventName, ...Listener) Emit(EventName, ...interface{}) EventNames() []EventName GetMaxListeners() int ListenerCount(EventName) int Listeners(EventName) []Listener On(EventName, ...Listener) Once(EventName, ...Listener) RemoveAllListeners(EventName) bool RemoveListener(EventName, Listener) bool Clear() SetMaxListeners(int) Len() int }
func New ¶
func New() EventEmmiter
Click to show internal directories.
Click to hide internal directories.