customamqp

package
v0.0.0-...-e3ece06 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMessagingClient

type IMessagingClient interface {
	ConnectToBroker(connectionString string)
	Publish(msg []byte, exchangeName string, exchangeType string) error
	PublishOnQueue(msg []byte, queueName string) error
	Subscribe(exchangeName string, exchangeType string, consumerName string, handlerFunc func(amqp.Delivery)) error
	SubscribeToQueue(queueName string, consumerName string, handlerFunc func(amqp.Delivery)) error
	Close()
}

Defines our interface for connecting and consuming messages.

type MessagingClient

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

Real implementation, encapsulates a pointer to an amqp.Connection

func NewMessagingClient

func NewMessagingClient() *MessagingClient

func (*MessagingClient) Close

func (m *MessagingClient) Close()

func (*MessagingClient) Publish

func (m *MessagingClient) Publish(body []byte, exchangeName string, exchangeType string) error

func (*MessagingClient) PublishOnQueue

func (m *MessagingClient) PublishOnQueue(body []byte, queueName string) error

func (*MessagingClient) Subscribe

func (m *MessagingClient) Subscribe(exchangeName string, exchangeType string, consumerName string, handlerFunc func(amqp.Delivery)) error

func (*MessagingClient) SubscribeToQueue

func (m *MessagingClient) SubscribeToQueue(queueName string, consumerName string, handlerFunc func(amqp.Delivery)) error

Jump to

Keyboard shortcuts

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