mt-rabbit/options.go

42 lines
696 B
Go
Raw Normal View History

2026-02-20 15:31:13 +03:00
package rabbit
import "time"
type Option func(*options)
2026-04-02 15:36:37 +03:00
func WithConnectTimeout(t time.Duration) Option {
return func(op *options) {
op.connectTimeout = t
}
}
2026-02-20 15:31:13 +03:00
func WithReconnectDelay(t time.Duration) Option {
return func(op *options) {
op.reconnectDelay = t
}
}
func WithReInitDelay(t time.Duration) Option {
return func(op *options) {
op.reInitDelay = t
}
}
func WithResendDelay(t time.Duration) Option {
return func(op *options) {
op.resendDelay = t
}
}
func WithConsumerRateLimit(t time.Duration) Option {
return func(op *options) {
op.consumerRateLimit = t
}
}
func WithConsumerBurstSize(t int) Option {
return func(op *options) {
op.consumerBurstSize = t
}
}