bus

package
v0.5.36 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 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) 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