testing

package
v3.2.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAMQPMessageCount

func AssertAMQPMessageCount[T any](
	tb testing.TB,
	queueName string,
	expectedCount int,
	cfg connection.Config,
	duration ...time.Duration,
) []T

func ConsumeAMQPMessages

func ConsumeAMQPMessages[T any](
	tb testing.TB,
	queueName string,
	cfg connection.Config,
	duration ...time.Duration,
) []T

func GetAMQPConnection

func GetAMQPConnection(tb testing.TB, cfg connection.Config) (*amqp091.Connection, *amqp091.Channel)

func PublishAMQPMessage

func PublishAMQPMessage(
	tb testing.TB,
	exchange string,
	msg any,
	conn connection.Config,
	config ...PublishConfig,
)

Types

type ConsumerConfig

type ConsumerConfig struct {
	Name   string
	Config consumer.QueueDeclare
}

type PublishConfig

type PublishConfig struct {
	Marshal     func(any) ([]byte, error)
	RoutingKey  string
	ContentType string
	Duration    time.Duration
}

type PublisherConfig

type PublisherConfig struct {
	Name   string
	Config publisher.ExchangeDeclare
}

type QueueExchangeMapping

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

func NewMappings

func NewMappings(tb testing.TB, config ...connection.Config) *QueueExchangeMapping

func (*QueueExchangeMapping) AddMapping

func (q *QueueExchangeMapping) AddMapping(exchange string, queue ...string) *QueueExchangeMapping

func (*QueueExchangeMapping) AddMappingConfig

func (q *QueueExchangeMapping) AddMappingConfig(exchangeCfg PublisherConfig, queue ConsumerConfig) *QueueExchangeMapping

func (*QueueExchangeMapping) AddMappings

func (q *QueueExchangeMapping) AddMappings(exchangeCfg PublisherConfig, queue []ConsumerConfig) *QueueExchangeMapping

func (QueueExchangeMapping) Exchange

func (q QueueExchangeMapping) Exchange(prefix string) string

func (QueueExchangeMapping) Queue

func (q QueueExchangeMapping) Queue(prefix string) string

Jump to

Keyboard shortcuts

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