36 lines
588 B
Go
36 lines
588 B
Go
|
|
package rabbit
|
||
|
|
|
||
|
|
import "time"
|
||
|
|
|
||
|
|
type Option func(*options)
|
||
|
|
|
||
|
|
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
|
||
|
|
}
|
||
|
|
}
|