rabbittest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindQueue

func BindQueue(t *testing.T, channel *amqp.Channel, name, key, exchange string)

BindQueue binds queue to exchange using routing key. Unbinds queue on test cleanup.

func Channel

func Channel(t *testing.T, conn *amqp.Connection) *amqp.Channel

Channel opens a new channel on the connection. CLoses the channel on test cleanup.

func Connection

func Connection(t *testing.T) *amqp.Connection

Connection opens a new connection to RabbitMQ. Closes the connection on test cleanup.

func DeclareExchange

func DeclareExchange(t *testing.T, channel *amqp.Channel, name string, ops ...func(p *ExchangeParams))

DeclareExchange is a test helper to declare an exchange. By default, creates durable topic exchange. Exchange declaring parameters can be overwritten using ops. Deletes the exchange on test cleanup.

func DeclareQueue

func DeclareQueue(t *testing.T, channel *amqp.Channel, name string, ops ...func(p *QueueParams))

DeclareQueue is a test helper to declare a queue. Queue declaring parameters can be overwritten using ops. Deletes the queue on test cleanup.

Types

type ExchangeParams

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

ExchangeParams for exchange declaration.

type QueueParams

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

QueueParams for queue declaration.

Jump to

Keyboard shortcuts

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