queue

package
v0.0.0-...-d9bf8a9 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Connection *amqp.Connection
	Channel    *amqp.Channel

	HandleChannelClose func(message string)
	HandleFatalError   func(err *amqp.Error)
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(amqpURI string) (*Connection, error)

func (*Connection) BindQueueToExchange

func (c *Connection) BindQueueToExchange(queueName string, exchangeName string) error

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Consume

func (c *Connection) Consume(queueName string) (<-chan amqp.Delivery, error)

func (*Connection) ExchangeDeclare

func (c *Connection) ExchangeDeclare(exchangeName string, exchangeType string) error

func (*Connection) Publish

func (c *Connection) Publish(exchangeName string, routingKey string, contentType string, body string) error

func (*Connection) QueueDeclare

func (c *Connection) QueueDeclare(queueName string) (amqp.Queue, error)

type Manager

type Manager struct {
	ExchangeName string
	QueueName    string
	Consumer     *Connection
	Producer     *Connection
}

func NewManager

func NewManager(amqpAddr string, exchangeName string, queueName string) (*Manager, error)

func (*Manager) Close

func (h *Manager) Close() error

func (*Manager) Consume

func (h *Manager) Consume() (<-chan amqp.Delivery, error)

func (*Manager) Publish

func (h *Manager) Publish(
	routingKey string,
	contentType string,
	body string) error

Jump to

Keyboard shortcuts

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