publisher

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultPublisher

type DefaultPublisher struct {
	// contains filtered or unexported fields
}

DefaultPublisher is the default implementation of the Publisher interface

func NewDefaultPublisher

func NewDefaultPublisher(
	conn *amqp091.Connection,
	queueName string,
	logger *slog.Logger,
) (*DefaultPublisher, error)

NewDefaultPublisher creates a new DefaultPublisher

Parameters:

  • conn: the RabbitMQ connection
  • queueName: the name of the queue
  • logger: the logger

Returns:

  • *DefaultPublisher: the DefaultPublisher instance
  • error: an error if the connection is nil

func (*DefaultPublisher) Close

func (d *DefaultPublisher) Close() error

Close closes the RabbitMQ channel and connection

Returns:

  • error: an error if the channel could not be closed

func (*DefaultPublisher) Open

func (d *DefaultPublisher) Open() error

Open opens a RabbitMQ channel

Returns:

  • error: an error if the channel could not be opened

func (*DefaultPublisher) PublishTokensMessage added in v0.6.3

func (d *DefaultPublisher) PublishTokensMessage(msg *gojwtrabbitmq.TokensMessage) error

PublishTokensMessage publishes a tokens message to the RabbitMQ queue

Parameters:

  • msg: the tokens message to publish

Returns:

  • error: an error if the message could not be published

type Publisher

type Publisher interface {
	Open() error
	Close() error
	PublishTokensMessage(msg *gojwtrabbitmq.TokensMessage) error
}

Publisher is the interface for the JWT RabbitMQ publisher

Jump to

Keyboard shortcuts

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