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") ErrNilMessage = errors.New("nil rabbitmq message") ErrNilDeliveryChannel = errors.New("nil rabbitmq delivery channel") )
Functions ¶
func CreateConsumeTokensMessageDeliveryChWithCtx ¶ added in v0.6.3
func CreateConsumeTokensMessageDeliveryChWithCtx( ctx context.Context, ch *amqp091.Channel, queueName string, ) (<-chan amqp091.Delivery, error)
CreateConsumeTokensMessageDeliveryChWithCtx 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 DeclareTokensMessageQueue ¶ added in v0.6.3
DeclareTokensMessageQueue creates a durable queue for handling tokens 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 {
IssuedRefreshTokensJTIs []string `json:"issued_refresh_tokens_jtis"`
RevokedRefreshTokensJTIs []string `json:"revoked_refresh_tokens_jtis"`
IssuedAccessTokensJTIs []string `json:"issued_access_tokens_jtis"`
RevokedAccessTokensJTIs []string `json:"revoked_access_tokens_jtis"`
}
TokensMessage represents a message containing new and revoked JWT IDs
Click to show internal directories.
Click to hide internal directories.