Documentation ¶
Overview ¶
Package event implements Pub-Sub using channel.
Index ¶
- Variables
- type EventEmitter
- func (ee *EventEmitter) Close() error
- func (ee *EventEmitter) Emit(event string, message interface{})
- func (ee *EventEmitter) On(event string, out chan interface{})
- func (ee *EventEmitter) Publish(event string, message interface{})
- func (ee *EventEmitter) Subscribe(event string) chan interface{}
- func (ee *EventEmitter) Unsubscribe(event string, deletingOut chan interface{}) error
- func (ee *EventEmitter) UnsubscribeAll(event string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEventNotFound = errors.New("event not found")
)
Functions ¶
This section is empty.
Types ¶
type EventEmitter ¶
type EventEmitter struct {
// contains filtered or unexported fields
}
func New ¶
func New() *EventEmitter
func (*EventEmitter) Close ¶
func (ee *EventEmitter) Close() error
func (*EventEmitter) Emit ¶
func (ee *EventEmitter) Emit(event string, message interface{})
func (*EventEmitter) On ¶
func (ee *EventEmitter) On(event string, out chan interface{})
func (*EventEmitter) Publish ¶
func (ee *EventEmitter) Publish(event string, message interface{})
func (*EventEmitter) Subscribe ¶
func (ee *EventEmitter) Subscribe(event string) chan interface{}
func (*EventEmitter) Unsubscribe ¶
func (ee *EventEmitter) Unsubscribe(event string, deletingOut chan interface{}) error
func (*EventEmitter) UnsubscribeAll ¶
func (ee *EventEmitter) UnsubscribeAll(event string) error
Click to show internal directories.
Click to hide internal directories.