Documentation ¶
Overview ¶
Package rabbitmq holds the implementation of the Publisher and PubSub interfaces for the RabbitMQ messaging system, the internal messaging broker of the Magistrala IoT platform. Due to the practical requirements implementation Publisher is created alongside PubSub. The reason for this is that Subscriber implementation of RabbitMQ brings the burden of additional struct fields which are not used by Publisher. Subscriber is not implemented separately because PubSub can be used where Subscriber is needed.
Index ¶
- Constants
- Variables
- func Channel(channel *amqp.Channel) messaging.Option
- func Exchange(exchange string) messaging.Option
- func NewPubSub(url string, logger *slog.Logger, opts ...messaging.Option) (messaging.PubSub, error)
- func NewPublisher(url string, opts ...messaging.Option) (messaging.Publisher, error)
- func Prefix(prefix string) messaging.Option
Constants ¶
View Source
const (
// SubjectAllChannels represents subject to subscribe for all the channels.
SubjectAllChannels = "channels.#"
)
Variables ¶
View Source
var ( // ErrNotSubscribed indicates that the topic is not subscribed to. ErrNotSubscribed = errors.New("not subscribed") // ErrEmptyTopic indicates the absence of topic. ErrEmptyTopic = errors.New("empty topic") // ErrEmptyID indicates the absence of ID. ErrEmptyID = errors.New("empty ID") )
View Source
var ErrInvalidType = errors.New("invalid type")
ErrInvalidType is returned when the provided value is not of the expected type.
Functions ¶
func NewPublisher ¶
NewPublisher returns RabbitMQ message Publisher.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.