messagebroker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL string
}

Config configuration to start MessageBroker

type Message

type Message struct {
	Payload []byte
}

Message message being sent or received

type MessageBroker

type MessageBroker interface {
	// Publish publishes message to the topic
	Publish(topic string, message ...Message) error
	// Subscribe subscribes to a chanel mesagges of topic
	Subscribe(topic string) (chan Message, error)
	// Close end MessageBroker
	Close()
}

MessageBroker is the interface to publish, consume messages

func New

func New(c Config) (MessageBroker, error)

New returns a new MessageBroker

Jump to

Keyboard shortcuts

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