rabbitmq

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilConnection  = errors.New("nil rabbitmq connection")
	ErrEmptyQueueName = errors.New("empty queue name")
	ErrNilChannel     = errors.New("nil rabbitmq channel")
	ErrNilPublisher   = errors.New("nil rabbitmq publisher")
	ErrNilConsumer    = errors.New("nil rabbitmq consumer")
)

Functions

func CreateConsumeJTIDeliveryChWithCtx

func CreateConsumeJTIDeliveryChWithCtx(
	ctx context.Context,
	ch *amqp091.Channel,
	queueName string,
) (<-chan amqp091.Delivery, error)

CreateConsumeJTIDeliveryChWithCtx sets up a consumer to receive messages from the specified queue using the provided context

Parameters:

  • ctx: the context for managing cancellation and timeouts
  • ch: the RabbitMQ channel
  • queueName: the name of the queue

Returns:

  • <-chan amqp091.Delivery: a channel to receive messages
  • error: an error if the consumer could not be set up

func DeclareJTIQueue

func DeclareJTIQueue(ch *amqp091.Channel, queueName string) (
	*amqp091.Queue,
	error,
)

DeclareJTIQueue creates a durable queue for handling JWT ID (JTI) messages

Parameters:

  • ch: the RabbitMQ channel
  • queueName: the name of the queue

Returns:

  • *amqp091.Queue: the declared queue
  • error: an error if the queue could not be declared

Types

type TokensMessage

type TokensMessage struct {
	IssuedJTIs  []string `json:"issued_jtis"`
	RevokedJTIs []string `json:"revoked_jtis"`
}

TokensMessage represents a message containing new and revoked JWT IDs

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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