Documentation ¶
Index ¶
- Constants
- func CheckReceiveBatch[T proto.Message](t *testing.T, deliveries <-chan T, originalBatch T)
- func CheckReceiveBytes(t *testing.T, deliveries <-chan amqp.Delivery, originalBatch []byte)
- func CheckReceiveDelivery[T proto.Message](t *testing.T, deliveries <-chan amqp.Delivery, originalBatch T)
- func Confirm(confirmation queue.Confirmation)
- func CreateMqContainer(ctx context.Context, t *testing.T, containerName string, port string) testcontainers.Container
- func GetConfigForContainer(ctx context.Context, t *testing.T, rabbit testcontainers.Container, ...) connection.Config
- func Reject(confirmation queue.Confirmation)
- func StartMq(t *testing.T, exchange string) connection.Config
- func StartMqWithContainerName(t *testing.T, containerName, exchange string) connection.Config
- type GenericListener
- type GenericManualListener
- type RawAmqpHolder
- func (h RawAmqpHolder) BindQueue(connCfg connection.Config, queue amqp.Queue, bindings ...string)
- func (h RawAmqpHolder) Close()
- func (h RawAmqpHolder) Consume(queue amqp.Queue) <-chan amqp.Delivery
- func (h RawAmqpHolder) CreateQueue(name string) amqp.Queue
- func (h RawAmqpHolder) GetQueue(t *testing.T, name string) amqp.Queue
- func (h RawAmqpHolder) Publish(connCfg connection.Config, routingKey string, data []byte)
- type TestRawListener
Constants ¶
View Source
const ( MqPort = "5672" TestBook = "test_book" TestScope = "test_scope" )
Variables ¶
This section is empty.
Functions ¶
func CheckReceiveBatch ¶
func CheckReceiveBytes ¶
func CheckReceiveDelivery ¶
func Confirm ¶
func Confirm(confirmation queue.Confirmation)
func CreateMqContainer ¶ added in v0.2.0
func GetConfigForContainer ¶ added in v0.2.0
func Reject ¶
func Reject(confirmation queue.Confirmation)
func StartMqWithContainerName ¶
func StartMqWithContainerName(t *testing.T, containerName, exchange string) connection.Config
Types ¶
type GenericListener ¶
type GenericListener[T any] struct { Channel chan *T }
func (*GenericListener[T]) Handle ¶
func (l *GenericListener[T]) Handle(_ queue.Delivery, batch *T) error
func (*GenericListener[T]) OnClose ¶
func (l *GenericListener[T]) OnClose() error
type GenericManualListener ¶
type GenericManualListener[T any] struct { Channel chan *T OnConfirmation func(confirmation queue.Confirmation) }
func (*GenericManualListener[T]) Handle ¶
func (l *GenericManualListener[T]) Handle(_ queue.Delivery, batch *T, confirm queue.Confirmation) error
func (*GenericManualListener[T]) OnClose ¶
func (l *GenericManualListener[T]) OnClose() error
type RawAmqpHolder ¶
type RawAmqpHolder struct {
// contains filtered or unexported fields
}
func RawAmqp ¶
func RawAmqp(t *testing.T, config connection.Config, createExchange bool) (*RawAmqpHolder, error)
func (RawAmqpHolder) BindQueue ¶
func (h RawAmqpHolder) BindQueue(connCfg connection.Config, queue amqp.Queue, bindings ...string)
func (RawAmqpHolder) Close ¶
func (h RawAmqpHolder) Close()
func (RawAmqpHolder) Consume ¶
func (h RawAmqpHolder) Consume(queue amqp.Queue) <-chan amqp.Delivery
func (RawAmqpHolder) CreateQueue ¶
func (h RawAmqpHolder) CreateQueue(name string) amqp.Queue
func (RawAmqpHolder) Publish ¶
func (h RawAmqpHolder) Publish(connCfg connection.Config, routingKey string, data []byte)
type TestRawListener ¶ added in v0.2.0
type TestRawListener struct {
Channel chan []byte
}
func (TestRawListener) Handle ¶ added in v0.2.0
func (t TestRawListener) Handle(delivery queue.Delivery, data []byte) error
func (TestRawListener) OnClose ¶ added in v0.2.0
func (t TestRawListener) OnClose() error
Click to show internal directories.
Click to hide internal directories.