bus

package
v0.0.0-...-8c5667c Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: MIT Imports: 9 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bus

type Bus interface {
	Publish(topic string, payload []byte)
	Subscribe(topic string, callback func(topic string, payload []byte)) (*Subscription, error)
	OnDisconnect(cb func())
	OnConnect(cb func())
	Connected() bool
	Destroy()
}

func MustConnect

func MustConnect(host, id string) Bus

type Subscription

type Subscription struct {
	Cancel func()
	// contains filtered or unexported fields
}

type TinyBus

type TinyBus struct {
	// contains filtered or unexported fields
}

func ConnectTinyBus

func ConnectTinyBus(host, id string) (*TinyBus, error)

func (*TinyBus) Connected

func (b *TinyBus) Connected() bool

func (*TinyBus) Destroy

func (b *TinyBus) Destroy()

func (*TinyBus) OnConnect

func (b *TinyBus) OnConnect(cb func())

func (*TinyBus) OnDisconnect

func (b *TinyBus) OnDisconnect(cb func())

func (*TinyBus) Publish

func (b *TinyBus) Publish(topic string, payload []byte)

func (*TinyBus) Subscribe

func (b *TinyBus) Subscribe(topic string, callback func(topic string, payload []byte)) (*Subscription, error)

Jump to

Keyboard shortcuts

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