rmqc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonContentType = "application/json"
)

Variables

This section is empty.

Functions

func SetupConsumerChild

func SetupConsumerChild[JobType any, ChildType Consumer[JobType]](
	parent *AbstractConsumer[JobType],
	child ChildType,
) ChildType

Types

type AbstractConsumer

type AbstractConsumer[JobType any] struct {
	// contains filtered or unexported fields
}

func NewAbstractConsumer

func NewAbstractConsumer[JobType any](
	dsn string,
	options ...NewOption[JobType],
) AbstractConsumer[JobType]

func (*AbstractConsumer[JobType]) Init

func (c *AbstractConsumer[JobType]) Init() error

func (*AbstractConsumer[JobType]) SetHandleFunc

func (c *AbstractConsumer[JobType]) SetHandleFunc(handleFunc func(JobType) error)

func (*AbstractConsumer[JobType]) Stop added in v0.0.3

func (c *AbstractConsumer[JobType]) Stop()

type Consumer

type Consumer[JobType any] interface {
	Init() error
	Stop()
	Handle(JobType) error
}

type DelayPublisher added in v0.0.4

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

func NewDelayPublisher added in v0.0.4

func NewDelayPublisher(dsn string, opts ...DelayPublisherOption) *DelayPublisher

func (*DelayPublisher) PublishDelayedJSON added in v0.0.4

func (p *DelayPublisher) PublishDelayedJSON(
	ctx context.Context,
	originalExchange string,
	originalRoutingKey string,
	payload any,
	delayMs int,
	headers amqp.Table,
) error

type DelayPublisherOption added in v0.0.4

type DelayPublisherOption func(*DelayPublisher)

func WithDelayExchangeArgs added in v0.0.4

func WithDelayExchangeArgs(args amqp.Table) DelayPublisherOption

func WithDelayExchangeDurable added in v0.0.4

func WithDelayExchangeDurable(v bool) DelayPublisherOption

func WithDelayExchangeName added in v0.0.4

func WithDelayExchangeName(name string) DelayPublisherOption

func WithDelayQueueArgs added in v0.0.4

func WithDelayQueueArgs(args amqp.Table) DelayPublisherOption

func WithDelayQueueDurable added in v0.0.4

func WithDelayQueueDurable(v bool) DelayPublisherOption

func WithQueueExpireGrace added in v0.0.4

func WithQueueExpireGrace(d time.Duration) DelayPublisherOption

type ExchangeKind

type ExchangeKind string
const (
	ExchangeDirect  ExchangeKind = "direct"
	ExchangeFanout  ExchangeKind = "fanout"
	ExchangeTopic   ExchangeKind = "topic"
	ExchangeHeaders ExchangeKind = "headers"
)

type NewOption

type NewOption[JobType any] func(*AbstractConsumer[JobType])

func WithConsumeArgs

func WithConsumeArgs[JobType any](consumeArgs amqp.Table) NewOption[JobType]

func WithConsumeAutoAck

func WithConsumeAutoAck[JobType any](consumeAutoAck bool) NewOption[JobType]

func WithConsumeExclusive

func WithConsumeExclusive[JobType any](consumeExclusive bool) NewOption[JobType]

func WithConsumeNoLocal

func WithConsumeNoLocal[JobType any](consumeNoLocal bool) NewOption[JobType]

func WithConsumeNoWait

func WithConsumeNoWait[JobType any](consumeNoWait bool) NewOption[JobType]

func WithConsumerTag

func WithConsumerTag[JobType any](consumerTag string) NewOption[JobType]

func WithExchangeArgs

func WithExchangeArgs[JobType any](exchangeArgs amqp.Table) NewOption[JobType]

func WithExchangeAutoDelete

func WithExchangeAutoDelete[JobType any](exchangeAutoDelete bool) NewOption[JobType]

func WithExchangeDurable

func WithExchangeDurable[JobType any](exchangeDurable bool) NewOption[JobType]

func WithExchangeInternal

func WithExchangeInternal[JobType any](exchangeInternal bool) NewOption[JobType]

func WithExchangeKind

func WithExchangeKind[JobType any](exchangeKind ExchangeKind) NewOption[JobType]

func WithExchangeName

func WithExchangeName[JobType any](exchangeName string) NewOption[JobType]

func WithExchangeNoWait

func WithExchangeNoWait[JobType any](exchangeNoWait bool) NewOption[JobType]

func WithPrefetchCount

func WithPrefetchCount[JobType any](prefetchCount int) NewOption[JobType]

func WithPrefetchSize

func WithPrefetchSize[JobType any](prefetchSize int) NewOption[JobType]

func WithQosGlobal

func WithQosGlobal[JobType any](qosGlobal bool) NewOption[JobType]

func WithQueueArgs

func WithQueueArgs[JobType any](queueArgs amqp.Table) NewOption[JobType]

func WithQueueAutoDelete

func WithQueueAutoDelete[JobType any](queueAutoDelete bool) NewOption[JobType]

func WithQueueBindArgs

func WithQueueBindArgs[JobType any](queueBindArgs amqp.Table) NewOption[JobType]

func WithQueueBindKey

func WithQueueBindKey[JobType any](queueBindKey string) NewOption[JobType]

func WithQueueBindNoWait

func WithQueueBindNoWait[JobType any](queueBindNoWait bool) NewOption[JobType]

func WithQueueDurable

func WithQueueDurable[JobType any](queueDurable bool) NewOption[JobType]

func WithQueueExclusive

func WithQueueExclusive[JobType any](queueExclusive bool) NewOption[JobType]

func WithQueueNoWait

func WithQueueNoWait[JobType any](queueNoWait bool) NewOption[JobType]

type Pusher

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

func NewPusher

func NewPusher(dsn string, options ...PusherOption) Pusher

func (*Pusher) Push

func (c *Pusher) Push(job any) error

type PusherOption

type PusherOption func(*Pusher)

func WithPusherExchangeArgs

func WithPusherExchangeArgs(exchangeArgs amqp.Table) PusherOption

func WithPusherExchangeAutoDelete

func WithPusherExchangeAutoDelete(exchangeAutoDelete bool) PusherOption

func WithPusherExchangeDurable

func WithPusherExchangeDurable(exchangeDurable bool) PusherOption

func WithPusherExchangeInternal

func WithPusherExchangeInternal(exchangeInternal bool) PusherOption

func WithPusherExchangeKind

func WithPusherExchangeKind(exchangeKind ExchangeKind) PusherOption

func WithPusherExchangeName

func WithPusherExchangeName(exchangeName string) PusherOption

func WithPusherExchangeNoWait

func WithPusherExchangeNoWait(exchangeNoWait bool) PusherOption

func WithPusherQueueArgs

func WithPusherQueueArgs(queueArgs amqp.Table) PusherOption

func WithPusherQueueAutoDelete

func WithPusherQueueAutoDelete(queueAutoDelete bool) PusherOption

func WithPusherQueueBindArgs

func WithPusherQueueBindArgs(queueBindArgs amqp.Table) PusherOption

func WithPusherQueueBindKey

func WithPusherQueueBindKey(queueBindKey string) PusherOption

func WithPusherQueueBindNoWait

func WithPusherQueueBindNoWait(queueBindNoWait bool) PusherOption

func WithPusherQueueDurable

func WithPusherQueueDurable(queueDurable bool) PusherOption

func WithPusherQueueExclusive

func WithPusherQueueExclusive(queueExclusive bool) PusherOption

func WithPusherQueueNoWait

func WithPusherQueueNoWait(queueNoWait bool) PusherOption

Jump to

Keyboard shortcuts

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