Documentation
¶
Index ¶
- func AppendToTopic(key, str string) string
- func StartConsumer[T any](consumer Consumer[T], r *RabbitConnector) error
- func StartNotifier[T any](r *RabbitConnector, notifier Notifier[T]) error
- type Consumer
- type ConsumerOptions
- type ConsumerRetry
- type NotificationOptions
- type Notifier
- type Publisher
- type PublisherOptions
- type Queue
- type RabbitConnector
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
func StartNotifier ¶ added in v0.7.1
func StartNotifier[T any](r *RabbitConnector, notifier Notifier[T]) 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[T any] interface { Options() NotificationOptions Stop() bool Notify() (T, error) }
type Publisher ¶
type Publisher[T any] struct { // contains filtered or unexported fields }
func CreatePublisher ¶ added in v0.7.1
func CreatePublisher[T any](r *RabbitConnector, options PublisherOptions) (*Publisher[T], 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) Disconnect ¶
func (rc RabbitConnector) Disconnect() error
Click to show internal directories.
Click to hide internal directories.