amqp

package
v0.0.0-...-9d1a92b Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 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 Exchange

type Exchange struct {
	ExchangeName string
	ExchangeType string
	Durable      bool
	AutoDelete   bool
	Internal     bool
	NoWait       bool
	Arguments    []struct {
		ArgumentKey   string
		ArgumentValue string
	}
}

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(connectionString string) *MessagingClient

func (*MessagingClient) Close

func (m *MessagingClient) Close()

func (*MessagingClient) Publish

func (m *MessagingClient) Publish(body []byte, exchange *Exchange, queue *Queue) error

func (*MessagingClient) PublishOnQueue

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

func (*MessagingClient) Subscribe

func (m *MessagingClient) Subscribe(exchange *Exchange, queue *Queue, consumerName string, handlerFunc func(amqp.Delivery)) error

func (*MessagingClient) SubscribeToQueue

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

type Queue

type Queue struct {
	QueueName  string
	Durable    bool
	AutoDelete bool
	Exclusive  bool
	NoWait     bool
	Arguments  []struct {
		ArgumentKey   string
		ArgumentValue string
	}
}

Jump to

Keyboard shortcuts

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