add helper for publish options
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
2fc47782cf
commit
0e1f744fcc
@ -45,6 +45,18 @@ type PublishOptions struct {
|
|||||||
Context context.Context
|
Context context.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewPublishOptions(opts ...PublishOption) PublishOptions {
|
||||||
|
opt := PublishOptions{
|
||||||
|
Context: context.Background(),
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, o := range opts {
|
||||||
|
o(&opt)
|
||||||
|
}
|
||||||
|
|
||||||
|
return opt
|
||||||
|
}
|
||||||
|
|
||||||
type SubscribeOptions struct {
|
type SubscribeOptions struct {
|
||||||
// AutoAck ack messages if handler returns nil err
|
// AutoAck ack messages if handler returns nil err
|
||||||
AutoAck bool
|
AutoAck bool
|
||||||
|
Loading…
Reference in New Issue
Block a user