messagebus

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2016 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package messagebus handles emitting events to buses like NATS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMillisecondsTimestamp

func GetMillisecondsTimestamp() int64

GetMillisecondsTimestamp calculates actual timestamp in milliseconds from epoch

Types

type Config

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

Config holds values needed to set-up connection with MessageBus

func (*Config) TryInitialize

func (c *Config) TryInitialize(cfEnv *cfenv.App) bool

TryInitialize initialize connection with message bus. It may fail when bad url was given for example. It will return true on success, false otherwise. */

type DevNullBus

type DevNullBus struct{}

func (*DevNullBus) Publish

func (m *DevNullBus) Publish(v Message)

type Message

type Message interface {
}

Message interface representing event being sent to message bus

type MessageBus

type MessageBus interface {
	Publish(v Message)
}

MessageBus in an interface to publish events to the bus

func NewNatsMessageBus

func NewNatsMessageBus(configuration Config) (MessageBus, error)

NewNatsMessageBus is constructor for nats connection wrapper

type MessageBusMock

type MessageBusMock struct {
	mock.Mock
}

func (*MessageBusMock) Publish

func (m *MessageBusMock) Publish(v Message)

type MessageFactory

type MessageFactory interface {
	NewServiceStatus(name string, stype string, org string, msg string) Message
}

MessageFactory easily instantiates events object

type NatsMessageBus

type NatsMessageBus struct {
	NatsConnection *nats.EncodedConn
	Subject        string
}

NatsMessageBus is an implementation of MessageBus interface

func (*NatsMessageBus) Publish

func (n *NatsMessageBus) Publish(m Message)

Publish sends given message to the bus

Jump to

Keyboard shortcuts

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