Documentation ¶
Index ¶
- type IHostRow
- type MessageBus
- func (mb *MessageBus) DialOthers(urls []string) error
- func (mb *MessageBus) ManageClients()
- func (mb *MessageBus) OnReceive(handlers map[string]func(msg string))
- func (mb *MessageBus) Publish(topic, message string) error
- func (mb *MessageBus) PublishJSON(topic string, jsonBytes []byte) error
- func (mb *MessageBus) PublishMetricsByHostRow(hostRow IHostRow, metricsMap map[string]int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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.
Click to show internal directories.
Click to hide internal directories.