rabbitmq

package
v0.0.0-...-c6cd810 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmqpConsumer

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

AmqpConsumer encapsulates data related to consuming messages from rabbitmq.

func NewAmqpConsumer

func NewAmqpConsumer(hostURL string, routingKey string, exchangeName string, queueName string) *AmqpConsumer

Creates a new AmqpConsumer.

func (*AmqpConsumer) CloseConnectionAndChannel

func (c *AmqpConsumer) CloseConnectionAndChannel()

CloseConnection closes the connection.

func (*AmqpConsumer) Connect

func (c *AmqpConsumer) Connect()

Connect initializes a connection.

func (*AmqpConsumer) ConsumeMessages

func (c *AmqpConsumer) ConsumeMessages() <-chan amqp.Delivery

ConsumeMessages consumes messages from rabbitmq, returns the deliveries.

type AmqpProducer

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

AmqpProducer implements the MessageProducer interface.

func NewAmqpProducer

func NewAmqpProducer(
	rabbitMqURL string,
	exchangeName string,
	routingKey string) *AmqpProducer

NewAmqpProducer creates a new message producer that publishes messages to rabbitmq.

func (*AmqpProducer) CloseChannelAndConnection

func (producer *AmqpProducer) CloseChannelAndConnection()

CloseChannelAndConnection closes the channel and connection received in parameter.

func (*AmqpProducer) Connect

func (producer *AmqpProducer) Connect()

Connect opens a channel and a connection.

func (*AmqpProducer) PublishConsumption

func (producer *AmqpProducer) PublishConsumption(cons models.ConsumtionValue)

PublishConsumption sends a consumption data item to the uploader service.

func (*AmqpProducer) PublishEvent

func (producer *AmqpProducer) PublishEvent(event models.SmcEvent)

PublishEvent sends an SMC event to the uploader service.

type MessageConsumer

type MessageConsumer interface {
	ConsumeMessages() <-chan amqp.Delivery
	CloseConnectionAndChannel()
	Connect()
}

MessageConsumer encapsulates messages needed to consume messages.

type MessageProducer

type MessageProducer interface {
	PublishEvent(event models.SmcEvent)
	PublishConsumption(cons models.ConsumtionValue)
	Connect()
	CloseChannelAndConnection()
}

MessageProducer encapsulates methods used to publish data for ES uploader service.

Jump to

Keyboard shortcuts

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