rabbitUtils

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoundQueueToExchange

func BoundQueueToExchange(rabbit *RabbitRep, routingKey string) error

func CreateExchange

func CreateExchange(rabbit *RabbitRep) error

func Receive

func Receive(rabbit *RabbitRep, queueName string, function RabbitFunction)

func Send

func Send(rabbit *RabbitRep, data string, ct string) error

Types

type RabbitExchange

type RabbitExchange struct {
	Name         string
	ExchangeType string        `default:"direct"`
	Durable      bool          `default:"false"`
	AutoDelete   bool          `default:"false"`
	Internal     bool          `default:"false"`
	NoWait       bool          `default:"false"`
	Args         amqp091.Table `default:"nil"`
}

type RabbitFunction added in v0.1.4

type RabbitFunction func([]byte)

type RabbitQueue

type RabbitQueue struct {
	Name           string
	Durable        bool          `default:"false"`
	DeleteWhenUsed bool          `default:"false"`
	Exclusive      bool          `default:"false"`
	NoWait         bool          `default:"false"`
	Args           amqp091.Table `default:"nil"`
}

type RabbitRep

type RabbitRep struct {
	Connection    *amqp091.Connection
	Exchange      *RabbitExchange
	Channel       *amqp091.Channel
	QueueInstance []amqp091.Queue
}

func InitializeRabbit

func InitializeRabbit(uri string, exchange RabbitExchange, queues []RabbitQueue) (*RabbitRep, error)

Jump to

Keyboard shortcuts

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