Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler func(interface{})
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) Subscribe ¶
func (p *PubSub) Subscribe(eventName string, h EventHandler) chan interface{}
Subscribe to an event with a function handler return the channel in case you need to unsubscribe leater
func (*PubSub) Unsubscribe ¶
Unsubscribe an event, by giving the chan object created when subscribing
Click to show internal directories.
Click to hide internal directories.