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 TokenPair ¶ added in v0.6.6
type TokenPair struct {
RefreshTokenJTI string `json:"refresh_token_jti"`
AccessTokenJTI string `json:"access_token_jti"`
}
TokenPair represents a pair of refresh and access token JTIs
type TokensMessage ¶
type TokensMessage struct {
IssuedTokenPairs []TokenPair `json:"issued_token_pairs"`
RevokedRefreshTokensJTIs []string `json:"revoked_refresh_tokens_jtis"`
RevokedAccessTokensJTIs []string `json:"revoked_access_tokens_jtis"`
}
TokensMessage represents a message containing issued and revoked tokens
Click to show internal directories.
Click to hide internal directories.