rmqservice

package
v0.0.0-...-d1e270b Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package rmqservice provides all functionality and modules related with rabbitMQ

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Conn    *amqp.Connection
	Channel *amqp.Channel
	Pub     *publisher.Publisher
	Sub     *subscriber.Subscriber
	// contains filtered or unexported fields
}

Service is the connection created

func NewService

func NewService(rmqCfg config.RabbitMQ, market, buildMode string, log *logger.Logger) *Service

NewService returns the new connection object

func (*Service) BuildMessage

func (svc *Service) BuildMessage(rmqRoute string, priority uint8, data interface{}) (*rmqbuilder.Message, error)

BuildMessage builds rabbitMQ message

func (*Service) BuildMessageHeaders

func (svc *Service) BuildMessageHeaders(rawHeaders map[string]interface{}) (*amqp.Table, error)

BuildMessageHeaders builds rabbitMQ message headers

func (*Service) BuildQueue

func (svc *Service) BuildQueue() (amqp.Queue, error)

BuildQueue declares message queue

func (*Service) BuildStringBody

func (svc *Service) BuildStringBody(body string) (*[]byte, error)

BuildStringBody builds string body

func (*Service) Connect

func (svc *Service) Connect() error

Connect builds the rabbitMQ connection

Jump to

Keyboard shortcuts

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