Skip to content

Commit

Permalink
Updated to kafka-client-go library
Browse files Browse the repository at this point in the history
  • Loading branch information
ilian2233 committed Jun 30, 2022
1 parent 9f6f200 commit 75a72c6
Show file tree
Hide file tree
Showing 14 changed files with 240 additions and 206 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Options:
--topic="" Kafka topic to read from. ($TOPIC)
--delayForNotification=30 Delay in seconds for notifications to being handled ($DELAY_FOR_NOTIFICATION)
--contentOriginAllowlist="" The contentOriginAllowlist for incoming notifications - i.e. ^http://.*-transformer-(pr|iw)-uk-.*\.svc\.ft\.com(:\d{2,5})?/content/[\w-]+.*$ ($CONTENT_ORIGIN_ALLOWLIST)
--logDebug=false Flag to switch debug logging ($LOG_DEBUG)
--logLevel="DEBUG/INFO/WARN/ERROR" Parameter for setting logging level.
--maxGoRoutines=100 Maximum goroutines to allocate for kafka message handling ($MAX_GO_ROUTINES)
--contentRetrievalThrottle=0 Delay in milliseconds between content retrieval calls
```
Expand Down
2 changes: 1 addition & 1 deletion content/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (u *mockUpdater) Upload(content []byte, tid, uuid, date string) error {
return u.err
}

func (u *mockUpdater) Delete(uuid, tid string) error {
func (u *mockUpdater) Delete(_, _ string) error {
panic("should not be called")
}

Expand Down
2 changes: 1 addition & 1 deletion content/inquirer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (tx *mockTX) FindUUIDs(collectionID string, candidates []string) (db.Iterat
return args.Get(0).(db.Iterator), args.Int(1), args.Error(2)
}

func (tx *mockTX) Ping(ctx context.Context) error {
func (tx *mockTX) Ping(_ context.Context) error {
panic("implement me")
}

Expand Down
5 changes: 4 additions & 1 deletion db/mongo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ func TestDBCloses(t *testing.T) {
tx.Close()
mongo.Close()
assert.Panics(t, func() {
mongo.(*MongoDB).session.Ping()
err := mongo.(*MongoDB).session.Ping()
if err != nil {
return
}
})
}

Expand Down
57 changes: 35 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
module github.com/Financial-Times/content-exporter

go 1.13
go 1.18

require (
github.com/Financial-Times/go-fthealth v0.0.0-20170525095041-e7ccca038327
github.com/Financial-Times/go-logger/v2 v2.0.1
github.com/Financial-Times/http-handlers-go v0.0.0-20170809121007-229ac16f1d9e
github.com/Financial-Times/kafka v0.0.0-20181214115819-fddecb2b8f89 // indirect
github.com/Financial-Times/kafka-client-go v0.0.0-20181214120216-c3a1941e42a4
github.com/Financial-Times/kafka-client-go/v3 v3.0.4
github.com/Financial-Times/service-status-go v0.0.0-20160323111542-3f5199736a3d
github.com/Financial-Times/transactionid-utils-go v0.2.0
github.com/Shopify/sarama v1.24.1
github.com/google/go-cmp v0.3.0
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.4.1-0.20170704074345-ac112f7d75a0
github.com/hashicorp/go-version v0.0.0-20170202080759-03c5bf6be031 // indirect
github.com/google/go-cmp v0.5.7
github.com/gorilla/mux v1.8.0
github.com/jawher/mow.cli v0.0.0-20170802120632-82aefbee1e23
github.com/klauspost/cpuid v1.2.2 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/onsi/ginkgo v1.11.0 // indirect
github.com/onsi/gomega v1.8.1 // indirect
github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c
github.com/pkg/errors v0.8.1-0.20170505043639-c605e284fe17
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a
github.com/samuel/go-zookeeper v0.0.0-20161028232340-1d7be4effb13 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/sethgrid/pester v0.0.0-20160429172022-8053687f9965
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2
github.com/stretchr/testify v1.3.0
github.com/wvanbergen/kazoo-go v0.0.0-20171010154145-2da972bbd3ba // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528
gopkg.in/yaml.v2 v2.2.7 // indirect
)

require (
github.com/Shopify/sarama v1.33.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-version v0.0.0-20170202080759-03c5bf6be031 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/klauspost/compress v1.15.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.1.0 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

0 comments on commit 75a72c6

Please sign in to comment.