rabbitmq

package
v0.0.0-...-cfcd8fe Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectRabbitMQ

func ConnectRabbitMQ(username, password, host, vhost string) (*amqp.Connection, error)

ConnectRabbitMQ will spawn a Connection

Types

type Event

type Event struct {
	Name string
}

type RabbitClient

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

RabbitClient is used to keep track of the RabbitMQ connection

func NewRabbitMQClient

func NewRabbitMQClient(conn *amqp.Connection) (RabbitClient, error)

NewRabbitMQClient will connect and return a Rabbitclient with an open connection Accepts a amqp Connection to be reused, to avoid spawning one TCP connection per concurrent client

func (RabbitClient) Close

func (rc RabbitClient) Close() error

Close will close the channel

func (RabbitClient) Publish

func (rc RabbitClient) Publish(ctx context.Context, event Event) error

func (RabbitClient) QueueDeclare

func (rc RabbitClient) QueueDeclare() (amqp.Queue, error)

func (RabbitClient) Subscribe

func (rc RabbitClient) Subscribe(q string) (<-chan amqp.Delivery, error)

Jump to

Keyboard shortcuts

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