Skip to content

Commit

Permalink
client: WithBodyOnly publish option
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Tolstov <[email protected]>
  • Loading branch information
vtolstov committed Jun 11, 2021
1 parent 60a5e73 commit 9195202
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 9195202

Please sign in to comment.