rabbitmqclient

package module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 8 Imported by: 0

README

بِسْمِ اللّٰهِ الرَّحْمٰنِ الرَّحِيْمِ


السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ


ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ


اللَّهُمَّ صَلِّ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا صَلَّيْتَ عَلَى إِبْرَاهِيمَ وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ ، اللَّهُمَّ بَارِكْ عَلَى مُحَمَّدٍ ، وَعَلَى آلِ مُحَمَّدٍ ، كَمَا بَارَكْتَ عَلَى إِبْرَاهِيمَ ، وَعَلَى آلِ إِبْرَاهِيمَ ، إِنَّكَ حَمِيدٌ مَجِيدٌ

RabbitMQ Client

Coverage Status CircleCI Go Report Card

The rabbitmq client is built using the fairyhunter13/amqpwrapper package. This package can manage the topology of queue's network inside the RabbitMQ. This package simplifies the management and usage of publishing and consuming for RabbitMQ.

Example

This is an example how to use this package.

Publish and Subscribe

This is an example of go code to publish and subscribe using this package.

package main

import (
	"fmt"
	"log"
	"time"

	"github.com/fairyhunter13/amqpwrapper"
	"github.com/fairyhunter13/rabbitmqclient"
	"github.com/streadway/amqp"
)

func main() {
	uriHost := fmt.Sprintf("amqp://guest:guest@%s:5672", "localhost")
	conn, err := amqpwrapper.NewManager(uriHost, amqp.Config{})
	if err != nil {
		log.Panicln(err)
	}

	container, err := rabbitmqclient.NewContainer(conn)
	if err != nil {
		log.Panicln(err)
	}

	err = container.
		SetExchangeName("integration-test").
		Publish(
			"",
			"example",
			*new(rabbitmqclient.OtherPublish).
				SetPersistent().
				SetBody([]byte("test payload")),
		)
	if err != nil {
		log.Panicln(err)
	}

	var result string
	testHandler := func(ch *amqp.Channel, msg amqp.Delivery) {
		msg.Ack(false)
		result = string(msg.Body)
	}
	err = container.
		Consumer().
		SetTopic("example").
		Consume(0, testHandler)
	if err != nil {
		log.Panicln(err)
	}

	time.Sleep(2 * time.Second)
	if result != "test payload" {
		log.Panicf("Expected: %v Actual: %v doesn't match.", "test payload", result)
	}
}

Topology

For this example, see this test code inside TestRabbitMQNetwork function.

Author

fairyhunter13

License

The source code inside this package is available under the MIT License.

Documentation

Overview

Package rabbitmqclient is a package for managing publishers and consumers inside RabbitMQ.

This package is built on top of github.com/fairyhunter13/rabbitmqclient. This package supports auto-reconnection for RabbitMQ connection. This package can also manage the topology of queue network's architecture inside RabbitMQ. The purpose of this package is to simplify the process of publishing and consuming for the RabbitMQ client.

Index

Examples

Constants

View Source
const (
	FalseUint uint64 = iota
	TrueUint
)

List of all uint constants for boolean

View Source
const (
	// prefixes
	DefaultPrefixExchange = "amqp."
	DefaultPrefixQueue    = "queue."
	DefaultPrefixConsumer = "consumer."

	DefaultQueue      = "default"
	DefaultTopic      = "default"
	DefaultChannelKey = "default"
)

List of default config used for this library.

View Source
const (
	// DefaultKeyInitiator sets the key channel for the initiator of topology in the producer connection.
	DefaultKeyInitiator = "initiator"
	// DefaultKeyProducer specifies the key channel for producer.
	DefaultKeyProducer = "producer.%d"
)
View Source
const (
	// DefaultTypeProducer specifies the default type of channel for the amqpwrapper.
	DefaultTypeProducer = amqpwrapper.Producer
	// DefaultTypeConsumer specifies the default type of channel for the amqpwrapper.
	DefaultTypeConsumer = amqpwrapper.Consumer
)

List of channel types for amqpwrapper

View Source
const (
	TypeDirect  = `direct`
	TypeFanout  = `fanout`
	TypeTopic   = `topic`
	TypeHeaders = `headers`
)

List of all exchange type in rabbitmq

View Source
const (
	DeliveryModeTransient  = 1
	DeliveryModePersistent = 2
)

List of all delivery modes for amqp rabbitmqclient

View Source
const (
	TopologyExchangeDeclare        = `ExchangeDeclare`
	TopologyExchangeDeclarePassive = `ExchangeDeclarePassive`
	TopologyExchangeBind           = `ExchangeBind`
	TopologyExchangeUnbind         = `ExchangeUnbind`
	TopologyExchangeDelete         = `ExchangeDelete`
	TopologyQueueDeclare           = `QueueDeclare`
	TopologyQueueDeclarePassive    = `QueueDeclarePassive`
	TopologyQueueBind              = `QueueBind`
	TopologyQueueUnbind            = `QueueUnbind`
	TopologyQueueDelete            = `QueueDelete`
)

List of all topology constants

Variables

View Source
var (
	ErrConnectionAlreadyClosed = errors.New("Connection is already closed")
	ErrArgumentsMusntBeEmpty   = errors.New("Arguments of function cannot be empty")
	ErrMethodNotFound          = errors.New("Method/Function is not found in the given struct")
	ErrInvalidFunctionCalled   = errors.New("Invalid function when called for declaration")
	ErrInvalidReturnValues     = errors.New(`Invalid return values for the function called`)
)

List of all errors for rabbitmqclient.

View Source
var (
	// EmptyFn specifies the empty function for initializing rabbitmq channel.
	EmptyFn = func(ch *amqp.Channel) (err error) {
		return
	}
	// TopologyInitializationFn is a function to initialize all declarations inside the passed topology.
	TopologyInitializationFn = func(topo *Topology) (result amqpwrapper.InitializeChannel) {
		result = func(ch *amqp.Channel) (err error) {
			if topo == nil {
				return
			}
			err = topo.DeclareAll(ch)
			return
		}
		return
	}
	// QosSetterFn declares the quality of service inside the channel for consumers.
	QosSetterFn = func(workers int) (result amqpwrapper.InitializeChannel) {
		result = func(ch *amqp.Channel) (err error) {
			if workers <= 0 {
				workers = 1
			}
			err = ch.Qos(workers, 0, false)
			return
		}
		return
	}
)
View Source
var (
	DefaultExchange = GenerateExchangeName(true, TypeDirect)
)

List of default variable configuration for this library

Functions

func GenerateConsumerChannelKey

func GenerateConsumerChannelKey(isPrefix bool, name string) string

GenerateConsumerChannelKey creates a consumer key for the channel to keeping track inside the IConnectionManager with default prefix if isPrefix is true.

func GenerateExchangeName

func GenerateExchangeName(isPrefix bool, name string) string

GenerateExchangeName creates an exchange name with default prefix if isPrefix is true.

func GenerateQueueName

func GenerateQueueName(isPrefix bool, name string) string

GenerateQueueName creates a queue name with default prefix if isPrefix is true.

Types

type Consume

type Consume struct {
	Queue     string
	Consumer  string
	AutoAck   bool
	Exclusive bool
	NoLocal   bool
	NoWait    bool
	Args      amqp.Table
}

Consume define the consume arguments of amqp.

func (*Consume) SetArgs

func (c *Consume) SetArgs(args amqp.Table) *Consume

SetArgs sets the args of the consume function in amqp.

func (*Consume) SetAutoAck

func (c *Consume) SetAutoAck(autoAck bool) *Consume

SetAutoAck sets the auto ack to true for automatic acknowledgement.

func (*Consume) SetConsumer

func (c *Consume) SetConsumer(name string) *Consume

SetConsumer sets the name of the consumer.

func (*Consume) SetExclusive

func (c *Consume) SetExclusive(exclusive bool) *Consume

SetExclusive sets the exclusive attribute to the consumer.

func (*Consume) SetNoLocal

func (c *Consume) SetNoLocal(noLocal bool) *Consume

SetNoLocal sets the no local attribute of consumer.

func (*Consume) SetNoWait

func (c *Consume) SetNoWait(noWait bool) *Consume

SetNoWait sets the no wait attribute when consuming.

func (*Consume) SetQueue

func (c *Consume) SetQueue(name string) *Consume

SetQueue sets the queue name of the consume arguments.

type Consumer

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

Consumer defines the behavior class for the consumer

func (*Consumer) Consume

func (c *Consumer) Consume(workers int, handler Handler) (err error)

Consume consumes the message using the number of workers and handler passed.

func (*Consumer) GetQueueBind

func (c *Consumer) GetQueueBind() *QueueBind

GetQueueBind gets the queue binder for this consumer.

func (*Consumer) GetQueueDeclare

func (c *Consumer) GetQueueDeclare() *QueueDeclare

GetQueueDeclare get queue declaration for this consumer.

func (*Consumer) Save

func (c *Consumer) Save() *Consumer

Save saves the consumer state.

func (*Consumer) SetChannelKey

func (c *Consumer) SetChannelKey(withPrefix bool, name string) *Consumer

SetChannelKey sets the channel key to keep track inside the IConnectionManager. Call this function after you call the SetTopic method if you want to use the default key for the channel key. The default key is the topic name.

func (*Consumer) SetConsume

func (c *Consumer) SetConsume(consume *Consume) *Consumer

SetConsume sets the consume args for consumer. The args list can be seen inside the amqp documentation.

func (*Consumer) SetExchangeName

func (c *Consumer) SetExchangeName(name string) *Consumer

SetExchangeName sets the name of exchange to be binded to the queue of the consumer.

func (*Consumer) SetQueueBind

func (c *Consumer) SetQueueBind(bind *QueueBind) *Consumer

SetQueueBind sets the queue bind topology for this Consumer.

func (*Consumer) SetQueueDeclare

func (c *Consumer) SetQueueDeclare(declare *QueueDeclare) *Consumer

SetQueueDeclare sets the queue declaration topology for this Consumer.

func (*Consumer) SetQueueName

func (c *Consumer) SetQueueName(withPrefix bool, name string) *Consumer

SetQueueName sets the queue name of the consumer. Call SetQueueName after you call the SetTopic method in order to prevent the override of the queue name.

func (*Consumer) SetTopic

func (c *Consumer) SetTopic(topic string) *Consumer

SetTopic sets the topic of the queue to the exchange. Call SetTopic before you call the SetQueueName method in order not to override the current queue name.

type Container

type Container struct {
	*Topology
	// contains filtered or unexported fields
}

Container is the struct to make custom Publisher and Consumer.

Example
container, err := testSetup.NewContainer()
if err != nil {
	log.Panicln(err)
}

go func() {
	err := container.
		SetExchangeName("integration-test").
		Publish(
			"",
			"test-normal",
			*new(OtherPublish).
				SetPersistent().
				SetBody([]byte("test payload")),
		)
	if err != nil {
		log.Panicln(err)
	}
}()

var result string
testHandler := func(ch *amqp.Channel, msg amqp.Delivery) {
	msg.Ack(false)
	result = string(msg.Body)
}
err = container.
	Consumer().
	SetTopic("test-normal").
	Consume(0, testHandler)
if err != nil {
	log.Panicln(err)
}

time.Sleep(normalTimeSleep)
if result != "test payload" {
	log.Panicf("Expected: %v Actual: %v doesn't match.", "test payload", result)
}
Output:

func NewContainer

func NewContainer(conn amqpwrapper.IConnectionManager) (res *Container, err error)

NewContainer return the container of the connection manager for amqp.Wrapper

func (*Container) Close

func (c *Container) Close() error

Close closes all the resources inside the container.

func (*Container) Consumer

func (c *Container) Consumer() *Consumer

Consumer creates a new consumer.

func (*Container) GetConnection

func (c *Container) GetConnection() amqpwrapper.IConnectionManager

GetConnection return the underlying connection manager.

func (*Container) GetGlobalExchange

func (c *Container) GetGlobalExchange() *ExchangeDeclare

GetGlobalExchange get the exchange declare inside the global exchange.

func (*Container) GetInitiatorChannel

func (c *Container) GetInitiatorChannel() (*amqp.Channel, error)

GetInitiatorChannel gets the initiator channel from the connection manager.

func (*Container) GetTopology

func (c *Container) GetTopology() *Topology

GetTopology gets the topology of this container.

func (*Container) Init

func (c *Container) Init() (err error)

Init initialize the network topology of rabbitmq. The initialization required the cosntructed topology that has been set.

func (*Container) Publish

func (c *Container) Publish(exchange, topic string, arg OtherPublish) (err error)

Publish publishes the message to the default exchange with the default topic.

func (*Container) Save

func (c *Container) Save() *Container

Save saves the current global exchange of the saver implementator.

func (*Container) SetExchange

func (c *Container) SetExchange(exc *ExchangeDeclare) *Container

SetExchange sets the exchange of the global exchange.

func (*Container) SetExchangeName

func (c *Container) SetExchangeName(name string) *Container

SetExchangeName sets the exchange name of the global exchange.

func (*Container) SetTopology

func (c *Container) SetTopology(topo *Topology) *Container

SetTopology sets the current topology of this container.

type ExchangeBind

type ExchangeBind struct {
	Destination string
	Key         string
	Source      string
	NoWait      bool
	Args        amqp.Table
}

ExchangeBind specifies the argumenst to bind an exchange to other exchange.

func (*ExchangeBind) SetArgs

func (e *ExchangeBind) SetArgs(args amqp.Table) *ExchangeBind

SetArgs is a setter.

func (*ExchangeBind) SetDestination

func (e *ExchangeBind) SetDestination(destination string) *ExchangeBind

SetDestination is a setter.

func (*ExchangeBind) SetKey

func (e *ExchangeBind) SetKey(key string) *ExchangeBind

SetKey is a setter.

func (*ExchangeBind) SetNoWait

func (e *ExchangeBind) SetNoWait(noWait bool) *ExchangeBind

SetNoWait is a setter.

func (*ExchangeBind) SetSource

func (e *ExchangeBind) SetSource(source string) *ExchangeBind

SetSource is a setter.

type ExchangeDeclare

type ExchangeDeclare struct {
	Name       string
	Kind       string
	Durable    bool
	AutoDelete bool
	Internal   bool
	NoWait     bool
	Args       amqp.Table
}

ExchangeDeclare specifies the arguments to used in declaring exchange.

func (*ExchangeDeclare) Default

func (e *ExchangeDeclare) Default() *ExchangeDeclare

Default sets the default values of the struct variables.

func (*ExchangeDeclare) SetArgs

func (e *ExchangeDeclare) SetArgs(args amqp.Table) *ExchangeDeclare

SetArgs is a setter.

func (*ExchangeDeclare) SetAutoDelete

func (e *ExchangeDeclare) SetAutoDelete(autoDelete bool) *ExchangeDeclare

SetAutoDelete is a setter.

func (*ExchangeDeclare) SetDurable

func (e *ExchangeDeclare) SetDurable(durable bool) *ExchangeDeclare

SetDurable is a setter.

func (*ExchangeDeclare) SetInternal

func (e *ExchangeDeclare) SetInternal(internal bool) *ExchangeDeclare

SetInternal is a setter.

func (*ExchangeDeclare) SetKind

func (e *ExchangeDeclare) SetKind(kind string) *ExchangeDeclare

SetKind is a setter.

func (*ExchangeDeclare) SetName

func (e *ExchangeDeclare) SetName(name string) *ExchangeDeclare

SetName is a setter.

func (*ExchangeDeclare) SetNoWait

func (e *ExchangeDeclare) SetNoWait(noWait bool) *ExchangeDeclare

SetNoWait is a setter.

type ExchangeDeclarePassive

type ExchangeDeclarePassive struct {
	ExchangeDeclare
}

ExchangeDeclarePassive declares an exchange as passive to assumes that the exchange is already exist.

type ExchangeDelete

type ExchangeDelete struct {
	Name     string
	IfUnused bool
	NoWait   bool
}

ExchangeDelete deletes the exchange when it is already declared.

func (*ExchangeDelete) SetIfUnused

func (e *ExchangeDelete) SetIfUnused(ifUnused bool) *ExchangeDelete

SetIfUnused is a setter.

func (*ExchangeDelete) SetName

func (e *ExchangeDelete) SetName(name string) *ExchangeDelete

SetName is a setter.

func (*ExchangeDelete) SetNoWait

func (e *ExchangeDelete) SetNoWait(noWait bool) *ExchangeDelete

SetNoWait is a setter.

type ExchangeUnbind

type ExchangeUnbind struct {
	ExchangeBind
}

ExchangeUnbind unbinds the exchange using the same argument as the exchange bind.

type Handler

type Handler func(ch *amqp.Channel, msg amqp.Delivery)

Handler defines the handler type for this rabbitmqclient

type OtherPublish

type OtherPublish struct {
	Mandatory bool
	Immediate bool
	Msg       amqp.Publishing
}

OtherPublish specifies the others arg for the publish function.

func (*OtherPublish) SetBody

func (op *OtherPublish) SetBody(payload []byte) *OtherPublish

SetBody sets the body payload of publish message.

func (*OtherPublish) SetContentEncoding

func (op *OtherPublish) SetContentEncoding(contentEncoding string) *OtherPublish

SetContentEncoding sets the content encoding of the payload.

func (*OtherPublish) SetContentType

func (op *OtherPublish) SetContentType(contentType string) *OtherPublish

SetContentType sets the content type of message.

func (*OtherPublish) SetExpiration

func (op *OtherPublish) SetExpiration(expiration string) *OtherPublish

SetExpiration sets the message expiration specification.

func (*OtherPublish) SetHeaders

func (op *OtherPublish) SetHeaders(header amqp.Table) *OtherPublish

SetHeaders sets the headers for the amqp rabbitmq message.

func (*OtherPublish) SetImmediate

func (op *OtherPublish) SetImmediate(immediate bool) *OtherPublish

SetImmediate is a setter.

func (*OtherPublish) SetMandatory

func (op *OtherPublish) SetMandatory(mandatory bool) *OtherPublish

SetMandatory is a setter.

func (*OtherPublish) SetMsg

func (op *OtherPublish) SetMsg(msg amqp.Publishing) *OtherPublish

SetMsg is a setter.

func (*OtherPublish) SetPersistent

func (op *OtherPublish) SetPersistent() *OtherPublish

SetPersistent sets the delivery mode to persistent.

func (*OtherPublish) SetPriority

func (op *OtherPublish) SetPriority(priority uint8) *OtherPublish

SetPriority sets the priority of the message.

func (*OtherPublish) SetReplyTo

func (op *OtherPublish) SetReplyTo(replyTo string) *OtherPublish

SetReplyTo sets the reply address for the RPC.

type Publish

type Publish struct {
	Exchange string
	Key      string
	OtherPublish
}

Publish specifies the arguments to publish function

func (*Publish) SetExchange

func (p *Publish) SetExchange(exchange string) *Publish

SetExchange is a setter.

func (*Publish) SetKey

func (p *Publish) SetKey(key string) *Publish

SetKey is a setter.

func (*Publish) SetOtherPublish

func (p *Publish) SetOtherPublish(publish OtherPublish) *Publish

SetOtherPublish is a setter.

type QueueBind

type QueueBind struct {
	Name     string
	Key      string
	Exchange string
	NoWait   bool
	Args     amqp.Table
}

QueueBind specifies the arguments to declare binding of queue to exchange.

func (*QueueBind) Default

func (q *QueueBind) Default() *QueueBind

Default sets the default values of the struct variables.

func (*QueueBind) SetArgs

func (q *QueueBind) SetArgs(args amqp.Table) *QueueBind

SetArgs is a setter.

func (*QueueBind) SetExchange

func (q *QueueBind) SetExchange(name string) *QueueBind

SetExchange is a setter.

func (*QueueBind) SetKey

func (q *QueueBind) SetKey(key string) *QueueBind

SetKey is a setter.

func (*QueueBind) SetName

func (q *QueueBind) SetName(name string) *QueueBind

SetName is a setter.

func (*QueueBind) SetNoWait

func (q *QueueBind) SetNoWait(noWait bool) *QueueBind

SetNoWait is a setter.

type QueueDeclare

type QueueDeclare struct {
	Name       string
	Durable    bool
	AutoDelete bool
	Exclusive  bool
	NoWait     bool
	Args       amqp.Table
}

QueueDeclare specifies the arguments to declare queue.

func (*QueueDeclare) Default

func (q *QueueDeclare) Default() *QueueDeclare

Default sets the default values of the struct variables.

func (*QueueDeclare) SetArgs

func (q *QueueDeclare) SetArgs(args amqp.Table) *QueueDeclare

SetArgs is a setter.

func (*QueueDeclare) SetAutoDelete

func (q *QueueDeclare) SetAutoDelete(delete bool) *QueueDeclare

SetAutoDelete is a setter.

func (*QueueDeclare) SetDurable

func (q *QueueDeclare) SetDurable(durable bool) *QueueDeclare

SetDurable is a setter.

func (*QueueDeclare) SetExclusive

func (q *QueueDeclare) SetExclusive(exclusive bool) *QueueDeclare

SetExclusive is a setter.

func (*QueueDeclare) SetName

func (q *QueueDeclare) SetName(name string) *QueueDeclare

SetName is a setter.

func (*QueueDeclare) SetNoWait

func (q *QueueDeclare) SetNoWait(noWait bool) *QueueDeclare

SetNoWait is a setter.

type QueueDeclarePassive

type QueueDeclarePassive struct {
	QueueDeclare
}

QueueDeclarePassive declares the queue if it isn't already declared

type QueueDelete

type QueueDelete struct {
	Name     string
	IfUnused bool
	IfEmpty  bool
	NoWait   bool
}

QueueDelete deletes deletes the bindings, purges the queue, and remove it from the server.

func (*QueueDelete) SetIfEmpty

func (q *QueueDelete) SetIfEmpty(ifEmpty bool) *QueueDelete

SetIfEmpty is a setter.

func (*QueueDelete) SetIfUnused

func (q *QueueDelete) SetIfUnused(ifUnused bool) *QueueDelete

SetIfUnused is a setter.

func (*QueueDelete) SetName

func (q *QueueDelete) SetName(name string) *QueueDelete

SetName is a setter.

func (*QueueDelete) SetNoWait

func (q *QueueDelete) SetNoWait(noWait bool) *QueueDelete

SetNoWait is a setter.

type QueueUnbind

type QueueUnbind struct {
	QueueBind
}

QueueUnbind removes the bindings of the queue to an exchange.

type Topology

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

Topology contains all declarations needed to define the topology topology in the rabbitmq.

func NewTopology

func NewTopology() *Topology

NewTopology creates a new topology

func (*Topology) AddExchangeBind

func (t *Topology) AddExchangeBind(arg ExchangeBind) *Topology

AddExchangeBind adds the exchange bind to the topology.

func (*Topology) AddExchangeDeclare

func (t *Topology) AddExchangeDeclare(arg ExchangeDeclare) *Topology

AddExchangeDeclare add the exchange declare args to the topology.

func (*Topology) AddExchangeDeclarePassive

func (t *Topology) AddExchangeDeclarePassive(arg ExchangeDeclarePassive) *Topology

AddExchangeDeclarePassive adds the exchange declare if it is not available.

func (*Topology) AddExchangeDelete

func (t *Topology) AddExchangeDelete(arg ExchangeDelete) *Topology

AddExchangeDelete adds the exchange delete to the topology.

func (*Topology) AddExchangeUnbind

func (t *Topology) AddExchangeUnbind(arg ExchangeUnbind) *Topology

AddExchangeUnbind adds the exchange unbind to the topology.

func (*Topology) AddQueueBind

func (t *Topology) AddQueueBind(arg QueueBind) *Topology

AddQueueBind adds the queue bind args to the topology

func (*Topology) AddQueueDeclare

func (t *Topology) AddQueueDeclare(arg QueueDeclare) *Topology

AddQueueDeclare adds the queue declaration into the topology

func (*Topology) AddQueueDeclarePassive

func (t *Topology) AddQueueDeclarePassive(arg QueueDeclarePassive) *Topology

AddQueueDeclarePassive adds the queue passive declaration into the topology

func (*Topology) AddQueueDelete

func (t *Topology) AddQueueDelete(arg QueueDelete) *Topology

AddQueueDelete adds the queue delete args to the topology

func (*Topology) AddQueueUnbind

func (t *Topology) AddQueueUnbind(arg QueueUnbind) *Topology

AddQueueUnbind adds the queue unbind args to the topology

func (*Topology) Declare

func (t *Topology) Declare(ch *amqp.Channel, declaration string) (err error)

Declare declares the topology declaration based on the input.

func (*Topology) DeclareAll

func (t *Topology) DeclareAll(ch *amqp.Channel) (err error)

DeclareAll declares all topologies available inside the topology.

func (*Topology) GetExchangeBind

func (t *Topology) GetExchangeBind() []ExchangeBind

GetExchangeBind return the exchange bind inside the topology.

func (*Topology) GetExchangeDeclare

func (t *Topology) GetExchangeDeclare() []ExchangeDeclare

GetExchangeDeclare return the exchange declare args inside the topology.

func (*Topology) GetExchangeDeclarePassive

func (t *Topology) GetExchangeDeclarePassive() []ExchangeDeclarePassive

GetExchangeDeclarePassive return the exchange declare args inside the topology.

func (*Topology) GetExchangeDelete

func (t *Topology) GetExchangeDelete() []ExchangeDelete

GetExchangeDelete return the exchange delete inside the topology.

func (*Topology) GetExchangeUnbind

func (t *Topology) GetExchangeUnbind() []ExchangeUnbind

GetExchangeUnbind return the exchange bind inside the topology.

func (*Topology) GetQueueBind

func (t *Topology) GetQueueBind() []QueueBind

GetQueueBind gets the queue bind args inside the topology

func (*Topology) GetQueueDeclare

func (t *Topology) GetQueueDeclare() []QueueDeclare

GetQueueDeclare gets the queue declaration inside the topology.

func (*Topology) GetQueueDeclarePassive

func (t *Topology) GetQueueDeclarePassive() []QueueDeclarePassive

GetQueueDeclarePassive gets the queue passive declaration inside the topology.

func (*Topology) GetQueueDelete

func (t *Topology) GetQueueDelete() []QueueDelete

GetQueueDelete gets the queue delete args inside the topology

func (*Topology) GetQueueUnbind

func (t *Topology) GetQueueUnbind() []QueueUnbind

GetQueueUnbind gets the queue unbind args inside the topology

func (*Topology) IsUpdated

func (t *Topology) IsUpdated() (result bool)

IsUpdated checks if the topology has been updated or not. IsUpdated also automatically sync the time of last time to the current time if it is updated.

Jump to

Keyboard shortcuts

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