Skip to content

Commit

Permalink
with custom marshaller
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Sep 17, 2024
1 parent 549ccfe commit 1b61e73
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
21 changes: 11 additions & 10 deletions buffered.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ import (
// NewBuffered creates a new Buffered client.
// Options may be one of the following:
//
// * fluent.WithAddress
// * fluent.WithBufferLimit
// * fluent.WithDialTimeout
// * fluent.WithJSONMarshaler
// * fluent.WithMaxConnAttempts
// * fluent.WithMsgpackMarshaler
// * fluent.WithNetwork
// * fluent.WithTagPrefix
// * fluent.WithWriteThreshold
// * fluent.WithWriteQueueSize
// - fluent.WithAddress
// - fluent.WithBufferLimit
// - fluent.WithDialTimeout
// - fluent.WithJSONMarshaler
// - fluent.WithMaxConnAttempts
// - fluent.WithMsgpackMarshaler
// - fluent.WithMarshaller
// - fluent.WithNetwork
// - fluent.WithTagPrefix
// - fluent.WithWriteThreshold
// - fluent.WithWriteQueueSize
//
// Please see their respective documentation for details.
func NewBuffered(options ...Option) (client *Buffered, err error) {
Expand Down
6 changes: 6 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ func WithJSONMarshaler() Option {
return option.New(identMarshaler{}, marshalFunc(jsonMarshal))
}

// WithMarshaller specifies a custom marshaling to be used when
// sending messages to fluentd. Used for `fluent.New`
func WithMarshaller(m marshaler) Option {
return option.New(identMarshaler{}, m)
}

// WithMsgpackMarshaler specifies msgpack marshaling to be used when
// sending messages to fluentd. Used in `fluent.New`
func WithMsgpackMarshaler() Option {
Expand Down

0 comments on commit 1b61e73

Please sign in to comment.