pubsub

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeclareAndBind

func DeclareAndBind(
	conn *amqp.Connection,
	exchange,
	queueName,
	key string,
	queueDurability QueueDurability,
) (*amqp.Channel, amqp.Queue, error)

func PublishGob

func PublishGob[T any](ch *amqp.Channel, exchange, key string, val T) error

publishers do not create queues since they work directly with exhances withot knowing even about queues

func SubscribeGob

func SubscribeGob[T any](
	conn *amqp.Connection,
	exchange,
	queueName,
	key string,
	queueDurability QueueDurability,
	handler func(T) AckType,
) error

Types

type AckType

type AckType int
const (
	Ack AckType = iota
	NackDiscard
	NackRequeue
)

type QueueDurability

type QueueDurability int
const (
	QueueDurable QueueDurability = iota
	QueueTranscient
)

type QueueType

type QueueType int
const (
	QueueClassic QueueType = iota
	QueueQuorum
	QueueStream
)

Jump to

Keyboard shortcuts

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