Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebase #30 #32

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buffered.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
// - fluent.WithJSONMarshaler
// - fluent.WithMaxConnAttempts
// - fluent.WithMsgpackMarshaler
// - fluent.WithMarshaller
// - fluent.WithNetwork
// - fluent.WithTagPrefix
// - fluent.WithWriteThreshold
Expand Down
6 changes: 4 additions & 2 deletions fluent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ func TestConnectOnStart(t *testing.T) {
// find a port that is not available (this may be timing dependent)
var dialer net.Dialer
port := 22412
for range 1000 {
//nolint:intrange
for i := 0; i < 1000; i++ {
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
conn, err := dialer.DialContext(ctx, `net`, fmt.Sprintf(`127.0.0.1:%d`, port))
cancel()
Expand Down Expand Up @@ -672,7 +673,8 @@ func TestPing(t *testing.T) {
// find a port that is not available (this may be timing dependent)
var dialer net.Dialer
port := 22412
for range 1000 {
//nolint:intrange
for i := 0; i < 1000; i++ {
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
conn, err := dialer.DialContext(ctx, `net`, fmt.Sprintf(`127.0.0.1:%d`, port))
cancel()
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