messagebus

package
v4.2.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IHostRow

type IHostRow interface {
	DataAsFlatKeyValue() map[string]map[string]interface{}
	GetClusterID() int64
	GetHostname() string
}

type MessageBus

type MessageBus struct {
	URL             string
	Socket          mangos.Socket
	Clients         map[chan string]bool
	NewClientChan   chan chan string
	CloseClientChan chan chan string
}

func New

func New(url string) (*MessageBus, error)

func (*MessageBus) DialOthers

func (mb *MessageBus) DialOthers(urls []string) error

func (*MessageBus) ManageClients

func (mb *MessageBus) ManageClients()

func (*MessageBus) OnReceive

func (mb *MessageBus) OnReceive(handlers map[string]func(msg string))

OnReceive handles various different type of payload based on topic.

func (*MessageBus) Publish

func (mb *MessageBus) Publish(topic, message string) error

Publish a plain text message to a topic.

func (*MessageBus) PublishJSON

func (mb *MessageBus) PublishJSON(topic string, jsonBytes []byte) error

Publish a JSON message to a topic.

func (*MessageBus) PublishMetricsByHostRow

func (mb *MessageBus) PublishMetricsByHostRow(hostRow IHostRow, metricsMap map[string]int64)

PublishMetricsByHostRow publish many metrics, based on a single host data payload.

Jump to

Keyboard shortcuts

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