diff --git a/client/options.go b/client/options.go index 27c0295e..555eb843 100644 --- a/client/options.go +++ b/client/options.go @@ -118,6 +118,8 @@ func NewPublishOptions(opts ...PublishOption) PublishOptions { // PublishOptions holds publish options type PublishOptions struct { + // BodyOnly will publish only message body + BodyOnly bool // Context used for external options Context context.Context // Exchange topic exchange name @@ -377,6 +379,13 @@ func WithExchange(e string) PublishOption { } } +// WithBodyOnly publish only message body +func WithBodyOnly(b bool) PublishOption { + return func(o *PublishOptions) { + o.BodyOnly = b + } +} + // PublishContext sets the context in publish options func PublishContext(ctx context.Context) PublishOption { return func(o *PublishOptions) {