Documentation ¶
Index ¶
- func SetLogger(logger *logrus.Logger)
- type Event
- type Grove
- func (g *Grove) Attach(event string, handler Handler, priority ...int)
- func (g *Grove) AttachWithReplay(eventName string, handler Handler)
- func (g *Grove) CountHandlers(event string) int
- func (g *Grove) Emit(event string, data interface{}) bool
- func (g *Grove) GetSessionID() string
- func (g *Grove) HasHandler(event string) bool
- func (g *Grove) Once(event string, handler Handler, priority ...int)
- func (g *Grove) Prune(event string)
- func (g *Grove) PruneAll()
- func (g *Grove) Use(mw Middleware)
- type Handler
- type Middleware
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Grove ¶
type Grove struct {
// contains filtered or unexported fields
}
func (*Grove) Attach ¶
Attach subscribes a handler to a specific event with an optional priority (higher value = higher priority).
func (*Grove) AttachWithReplay ¶
func (*Grove) CountHandlers ¶
CountHandlers returns the number of handlers for the given event.
func (*Grove) GetSessionID ¶ added in v1.0.3
func (*Grove) HasHandler ¶
HasHandler checks if there are any handlers for the given event.
func (*Grove) PruneAll ¶ added in v1.0.3
func (g *Grove) PruneAll()
PruneAll removes all handlers from all events.
func (*Grove) Use ¶
func (g *Grove) Use(mw Middleware)
Middleware can modify the event data or prevent it from propagating.
type Middleware ¶
type Middleware func(data *interface{}) bool
Click to show internal directories.
Click to hide internal directories.