bus

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Zlib Imports: 1 Imported by: 0

Documentation

Index

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL