types

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostInfo

type HostInfo struct {
	// Host is the hostname or IP address of the messaging broker, if applicable.
	Host string
	// Port defines the port on which to access the message queue.
	Port int
	// Protocol indicates the protocol to use when accessing the message queue.
	Protocol string
}

HostInfo is the URL information of the host as the following scheme: <Protocol>://<Host>:<Port>

func (*HostInfo) GetHostURL

func (info *HostInfo) GetHostURL() string

GetHostURL returns the complete URL for the host-info configuration

func (*HostInfo) IsHostInfoEmpty

func (info *HostInfo) IsHostInfoEmpty() bool

IsHostInfoEmpty returns whether the host-info has been initialized or not

type MessageBusConfig

type MessageBusConfig struct {
	// PublishHost contains the connection information for a publishing on 0mq
	PublishHost HostInfo
	// SubscribeHost contains the connection information for a subscribing on 0mq
	SubscribeHost HostInfo
	// Type indicates the message queue platform being used. eg. "zero" for 0mq
	Type string
	// Optional contains all other properties of message bus that is specific to
	// certain concrete implementation like MQTT's QoS, for example
	Optional map[string]string
}

MessageBusConfig defines the messaging information need to connect to the message bus in a publish-subscribe pattern

type MessageEnvelope

type MessageEnvelope struct {
	// Checksum used to communicate to core-data that an Event message has been received via the message bus
	Checksum string
	// CorrelationID is an object id to identify the envelop
	CorrelationID string
	// Payload is byte representation of the data being transferred.
	Payload []byte
	// ContentType is the marshaled type of payload, i.e. application/json, application/xml, application/cbor, etc
	ContentType string
}

MessageEnvelope is the data structure for messages. It wraps the generic message payload with attributes.

func NewMessageEnvelope

func NewMessageEnvelope(payload []byte, ctx context.Context) MessageEnvelope

NewMessageEnvelope creates a new MessageEnvelope for the specified payload with attributes from the specified context

type TopicChannel

type TopicChannel struct {
	// Topic for subscriber to filter on if any
	Topic string
	// Messages is the returned message channel for the subscriber
	Messages chan MessageEnvelope
}

TopicChannel is the data structure for subscriber

Jump to

Keyboard shortcuts

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