Documentation
¶
Index ¶
- func AppendToTopic(key, str string) string
- func StartConsumer[T any](consumer Consumer[T], r *RabbitConnector) error
- type Consumer
- type ConsumerOptions
- type ConsumerRetry
- type NotificationOptions
- type Notifier
- type Publisher
- type PublisherOptions
- type Queue
- type RabbitConnector
- func (rc RabbitConnector) Channel() (*amqp.Channel, error)
- func (rc *RabbitConnector) Connect(url string) error
- func (r *RabbitConnector) CreatePublisher(options PublisherOptions) (*Publisher, error)
- func (rc RabbitConnector) Disconnect() error
- func (r *RabbitConnector) StartNotifier(notifier Notifier) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToTopic ¶
func StartConsumer ¶ added in v0.6.1
func StartConsumer[T any](consumer Consumer[T], r *RabbitConnector) error
Types ¶
type Consumer ¶
type Consumer[T any] interface { Options() ConsumerOptions HandleMessage(T) error }
type ConsumerOptions ¶
type ConsumerOptions struct {
Exchange string
Topic string
QueueName string
// contains filtered or unexported fields
}
func NewConsumerOptions ¶ added in v0.5.2
func NewConsumerOptions(exchange, topic, queue string) ConsumerOptions
func (ConsumerOptions) HasRetry ¶ added in v0.5.0
func (co ConsumerOptions) HasRetry() bool
func (ConsumerOptions) WithRetry ¶ added in v0.5.0
func (co ConsumerOptions) WithRetry(retries int, interval time.Duration) ConsumerOptions
type ConsumerRetry ¶ added in v0.6.1
type ConsumerRetry[T any] struct { // contains filtered or unexported fields }
type NotificationOptions ¶
type Notifier ¶
type Notifier interface {
Options() NotificationOptions
Stop() bool
Notify() (string, error)
}
type PublisherOptions ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
func (*Queue[T]) DequeueNoWait ¶ added in v0.5.1
func (q *Queue[T]) DequeueNoWait() *T
type RabbitConnector ¶
type RabbitConnector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func NewConnector() *RabbitConnector
func (*RabbitConnector) Connect ¶
func (rc *RabbitConnector) Connect(url string) error
func (*RabbitConnector) CreatePublisher ¶
func (r *RabbitConnector) CreatePublisher(options PublisherOptions) (*Publisher, error)
func (RabbitConnector) Disconnect ¶
func (rc RabbitConnector) Disconnect() error
func (*RabbitConnector) StartNotifier ¶
func (r *RabbitConnector) StartNotifier(notifier Notifier) error
Click to show internal directories.
Click to hide internal directories.