Documentation ¶ Index ¶ type Bus func New() *Bus func (bus *Bus) Publish(topic string, ev Event) func (bus *Bus) Start() error func (bus *Bus) Stop() func (bus *Bus) Subscribe(topic string, ch EventChan) func (bus *Bus) UnSubscribe(topic string, ch EventChan) type Event type EventChan type Publisher type Subscriber Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Bus ¶ type Bus struct { // contains filtered or unexported fields } func New ¶ func New() *Bus func (*Bus) Publish ¶ func (bus *Bus) Publish(topic string, ev Event) func (*Bus) Start ¶ added in v0.7.5 func (bus *Bus) Start() error func (*Bus) Stop ¶ added in v0.7.5 func (bus *Bus) Stop() func (*Bus) Subscribe ¶ func (bus *Bus) Subscribe(topic string, ch EventChan) func (*Bus) UnSubscribe ¶ func (bus *Bus) UnSubscribe(topic string, ch EventChan) type Event ¶ type Event struct { Cmd string Data interface{} } type EventChan ¶ type EventChan chan Event type Publisher ¶ type Publisher interface { Publish(topic string, ev Event) } type Subscriber ¶ type Subscriber interface { Subscribe(topic string, ch EventChan) UnSubscribe(topic string, ch EventChan) } Source Files ¶ View all Source files bus.go event.go publisher.go subscriber.go Click to show internal directories. Click to hide internal directories.