Skip to content

Commit

Permalink
Add go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Jan 6, 2021
1 parent cf82b46 commit 4c4770b
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 9 deletions.
File renamed without changes.
18 changes: 18 additions & 0 deletions bench/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module github.com/lestrrat-go/fluent-client/bench

go 1.16

require (
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/fluent/fluent-logger-golang v1.5.0
github.com/k0kubun/fluent-logger-go v0.0.0-20201119054120-59ff43471d04
github.com/kr/pretty v0.2.1 // indirect
github.com/lestrrat-go/backoff v1.0.1 // indirect
github.com/lestrrat-go/fluent-client v0.0.0-20180220234652-cf82b4654aab
github.com/lestrrat-go/msgpack v0.0.0-20191118094803-f1541f70f50e // indirect
github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d // indirect
github.com/tinylib/msgp v1.1.5 // indirect
github.com/ugorji/go v1.2.2 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/vmihailenco/msgpack.v2 v2.9.1 // indirect
)
76 changes: 76 additions & 0 deletions bench/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fluent/fluent-logger-golang v1.5.0 h1:wBpSzYjRlzgwwAOw/3ig3Jaxrb5xTJlvBu7TRcgJeCg=
github.com/fluent/fluent-logger-golang v1.5.0/go.mod h1:2/HCT/jTy78yGyeNGQLGQsjF3zzzAuy6Xlk6FCMV5eU=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/k0kubun/fluent-logger-go v0.0.0-20201119054120-59ff43471d04 h1:H5udylwJBYhvSo9+WrWjn8Q12ubzafvq9yXnr9olTtw=
github.com/k0kubun/fluent-logger-go v0.0.0-20201119054120-59ff43471d04/go.mod h1:jYOjlx8QOMyZQA9KWHpsRniCPhv2yjoZjnXxoNKSpJo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lestrrat-go/backoff v1.0.1 h1:Gphaach0QvvtaHmR9U8hwXNHXWckPyD8V6S+V+D184c=
github.com/lestrrat-go/backoff v1.0.1/go.mod h1:5QVJKC49Q5yQvCrpup0ZqzDGHEO/O4H82cnDuYdumkw=
github.com/lestrrat-go/bufferpool v0.0.0-20180220091733-e7784e1b3e37 h1:px5km9KhQGUKiPWIVZ++FErEMTd06XEuMi2OswGMrqI=
github.com/lestrrat-go/bufferpool v0.0.0-20180220091733-e7784e1b3e37/go.mod h1:vs3QXw2t0jsgjLEG7JZt0uE1jcSkxnQr+5bhQ80UJHE=
github.com/lestrrat-go/fluent-client v0.0.0-20180220234652-cf82b4654aab h1:QcsBxHynbw0aEGIsSsE21pnjyBb9eTterTTl0zbFzcw=
github.com/lestrrat-go/fluent-client v0.0.0-20180220234652-cf82b4654aab/go.mod h1:K7itT+9T40BtqUaZeUH4NDfX5+NASFFT5sxYsLRtQ7g=
github.com/lestrrat-go/msgpack v0.0.0-20191118094803-f1541f70f50e h1:TDOQVdSOiwM7/xZmKNxIgY2J09P9VJEF5Yt3iJitEnc=
github.com/lestrrat-go/msgpack v0.0.0-20191118094803-f1541f70f50e/go.mod h1:wIouZopTn5v7qPvb7uPVAlUXLp41BwD8pQ9D4+8wULI=
github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d h1:aEZT3f1GGg5RIlHMAy4/4fe4ciOi3SCwYoaURphcB4k=
github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d/go.mod h1:B06CSso/AWxiPejj+fheUINGeBKeeEZNt8w+EoU7+L8=
github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tinylib/msgp v1.1.5 h1:2gXmtWueD2HefZHQe1QOy9HVzmFrLOVvsXwXBQ0ayy0=
github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg=
github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q=
github.com/ugorji/go v1.2.2 h1:60ZHIOcsJlo3bJm9CbTVu7OSqT2mxaEmyQbK2NwCkn0=
github.com/ugorji/go v1.2.2/go.mod h1:bitgyERdV7L7Db/Z5gfd5v2NQMNhhiFiZwpgMw2SP7k=
github.com/ugorji/go/codec v1.2.2 h1:08Gah8d+dXj4cZNUHhtuD/S4PXD5WpVbj5B8/ClELAQ=
github.com/ugorji/go/codec v1.2.2/go.mod h1:OM8g7OAy52uYl3Yk+RE/3AS1nXFn1Wh4PPLtupCxbuU=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/vmihailenco/msgpack.v2 v2.9.1 h1:kb0VV7NuIojvRfzwslQeP3yArBqJHW9tOl4t38VS1jM=
gopkg.in/vmihailenco/msgpack.v2 v2.9.1/go.mod h1:/3Dn1Npt9+MYyLpYYXjInO/5jvMLamn+AEGwNEOatn8=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
11 changes: 11 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/lestrrat-go/fluent-client

go 1.16

require (
github.com/lestrrat-go/backoff/v2 v2.0.3
github.com/lestrrat-go/msgpack v1.0.0
github.com/lestrrat-go/pdebug v0.0.0-20200204225717-4d6bd78da58d
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.6.1
)
4 changes: 2 additions & 2 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (m *Message) MarshalJSON() ([]byte, error) {
}

// EncodeMsgpack serializes a Message to msgpack format
func (m *Message) EncodeMsgpack(e *msgpack.Encoder) error {
func (m *Message) EncodeMsgpack(e msgpack.Encoder) error {
if err := e.EncodeArrayHeader(4); err != nil {
return errors.Wrap(err, `failed to encode array header`)
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func (m *Message) EncodeMsgpack(e *msgpack.Encoder) error {

// DecodeMsgpack deserializes from a msgpack buffer and populates
// a Message struct appropriately
func (m *Message) DecodeMsgpack(d *msgpack.Decoder) error {
func (m *Message) DecodeMsgpack(d msgpack.Decoder) error {
var l int
if err := d.DecodeArrayLength(&l); err != nil {
return errors.Wrap(err, `failed to decode msgpack array length`)
Expand Down
8 changes: 3 additions & 5 deletions minion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"time"

backoff "github.com/lestrrat-go/backoff"
backoff "github.com/lestrrat-go/backoff/v2"
pdebug "github.com/lestrrat-go/pdebug"
"github.com/pkg/errors"
)
Expand Down Expand Up @@ -73,7 +73,7 @@ type minion struct {
func newMinion(options ...Option) (*minion, error) {
m := &minion{
address: "127.0.0.1:24224",
backoffPolicy: backoff.NewExponential(),
backoffPolicy: backoff.Exponential(),
bufferLimit: 8 * 1024 * 1024,
cond: sync.NewCond(&sync.Mutex{}),
dialTimeout: 3 * time.Second,
Expand Down Expand Up @@ -529,9 +529,7 @@ func (m *minion) connect(ctx context.Context) net.Conn {
retryCtx, cancel := context.WithTimeout(ctx, m.dialTimeout)
defer cancel()

b, backoffCancel := m.backoffPolicy.Start(retryCtx)
defer backoffCancel()

b := m.backoffPolicy.Start(retryCtx)
for {
conn, err := dial(ctx, m.network, m.address, m.dialTimeout)
if err == nil {
Expand Down
4 changes: 2 additions & 2 deletions time.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func init() {

// DecodeMsgpack decodes from a msgpack stream and materializes
// a EventTime object
func (t *EventTime) DecodeMsgpack(d *msgpack.Decoder) error {
func (t *EventTime) DecodeMsgpack(d msgpack.Decoder) error {
r := d.Reader()

sec, err := r.ReadUint32()
Expand All @@ -33,7 +33,7 @@ func (t *EventTime) DecodeMsgpack(d *msgpack.Decoder) error {
}

// EncodeMsgpack encodes the EventTime into msgpack format
func (t EventTime) EncodeMsgpack(e *msgpack.Encoder) error {
func (t EventTime) EncodeMsgpack(e msgpack.Encoder) error {
w := e.Writer()
if err := w.WriteUint32(uint32(t.Unix())); err != nil {
return errors.Wrap(err, `failed to write EventTime seconds payload`)
Expand Down

0 comments on commit 4c4770b

Please sign in to comment.