diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 5ba22f7a..9743ca3d 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -2,9 +2,11 @@ name: install on: push: - branches: [master] + branches: [ '**' ] pull_request: branches: [master] +env: + GO_VERSION: '1.20' jobs: install_go_get: @@ -13,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "^${{ env.GO_VERSION }}" - name: Install shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1857741a..0e9c8ee5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,8 @@ on: branches: [master] pull_request: branches: [master] +env: + GO_VERSION: '1.20' jobs: unit: @@ -15,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "^${{ env.GO_VERSION }}" - name: Test shell: bash @@ -30,7 +32,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "^${{ env.GO_VERSION }}" - name: Services shell: bash diff --git a/.github/workflows/runexamples.yml b/.github/workflows/runexamples.yml index 5931ba8f..f8e37cc2 100644 --- a/.github/workflows/runexamples.yml +++ b/.github/workflows/runexamples.yml @@ -5,7 +5,8 @@ on: branches: [master] pull_request: branches: [master] - +env: + GO_VERSION: '1.20' jobs: run-examples: runs-on: ubuntu-22.04 @@ -15,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "^${{ env.GO_VERSION }}" - name: Build examples shell: bash diff --git a/README.md b/README.md index eedc5ab0..112f8ef1 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ You can install Goka by running the following command: ## Configuration -Goka relies on [Sarama](https://github.com/Shopify/sarama) to perform the actual communication with Kafka, which offers many configuration settings. The config is documented [here](https://godoc.org/github.com/Shopify/sarama#Config). +Goka relies on [Sarama](https://github.com/IBM/sarama) to perform the actual communication with Kafka, which offers many configuration settings. The config is documented [here](https://godoc.org/github.com/IBM/sarama#Config). In most cases, you need to modify the config, e.g. to set the Kafka Version. diff --git a/broker.go b/broker.go index f8df67ce..5dbc22e9 100644 --- a/broker.go +++ b/broker.go @@ -1,6 +1,6 @@ package goka -import "github.com/Shopify/sarama" +import "github.com/IBM/sarama" // Broker is an interface for the sarama broker type Broker interface { diff --git a/builders.go b/builders.go index 459d5893..65339d36 100644 --- a/builders.go +++ b/builders.go @@ -3,7 +3,7 @@ package goka import ( "hash" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) // ProducerBuilder create a Kafka producer. diff --git a/config.go b/config.go index cf6788ed..697e5fdd 100644 --- a/config.go +++ b/config.go @@ -3,7 +3,7 @@ package goka import ( "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) var ( diff --git a/config_test.go b/config_test.go index b09eebf1..b804af53 100644 --- a/config_test.go +++ b/config_test.go @@ -3,7 +3,7 @@ package goka import ( "testing" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/stretchr/testify/require" ) diff --git a/context.go b/context.go index 2c0c79da..ce2ef9f9 100644 --- a/context.go +++ b/context.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/hashicorp/go-multierror" ) diff --git a/context_test.go b/context_test.go index 98551fba..764d6f3f 100644 --- a/context_test.go +++ b/context_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/copartition_strategy.go b/copartition_strategy.go index 3d97abcb..1fb8b558 100644 --- a/copartition_strategy.go +++ b/copartition_strategy.go @@ -5,7 +5,7 @@ import ( "math" "sort" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) var ( diff --git a/copartition_strategy_test.go b/copartition_strategy_test.go index 5fc0540f..ac1228f5 100644 --- a/copartition_strategy_test.go +++ b/copartition_strategy_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/stretchr/testify/require" ) diff --git a/doc.go b/doc.go index 8dbf3483..5435a699 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ //go:generate mockgen -self_package github.com/lovoo/goka -package goka -destination mockstorage.go github.com/lovoo/goka/storage Storage //go:generate mockgen -self_package github.com/lovoo/goka -package goka -destination mocks.go github.com/lovoo/goka TopicManager,Producer,Broker -//go:generate mockgen -self_package github.com/lovoo/goka -package goka -destination mockssarama.go github.com/Shopify/sarama Client,ClusterAdmin +//go:generate mockgen -self_package github.com/lovoo/goka -package goka -destination mockssarama.go github.com/IBM/sarama Client,ClusterAdmin /* Package goka is a stateful stream processing library for Apache Kafka (version 0.9+) that eases @@ -10,7 +10,7 @@ group. A microservice modifies and serves the content of a table employing two complementary object types: processors and views. -Processors +# Processors A processor is a set of callback functions that modify the group table when messages arrive and may also emit messages into other topics. @@ -26,12 +26,11 @@ When multiple processor instances start in the same consumer group, the instance co-partitioned input topics and load the respective group table partitions from the group topic. A local disk storage minimizes recovery time by caching partitions of group table. -Views +# Views A view is a materialized (ie, persistent) cache of a group table. A view subscribes for the updates of all partitions of a group table and keeps local disk storage in sync with the group topic. With a view, one can easily serve up-to-date content of the group table via, for example, gRPC. - */ package goka diff --git a/examples/1-simplest/main.go b/examples/1-simplest/main.go index 9a326e50..bf628ec5 100644 --- a/examples/1-simplest/main.go +++ b/examples/1-simplest/main.go @@ -7,7 +7,7 @@ import ( "os/signal" "syscall" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/lovoo/goka" "github.com/lovoo/goka/codec" ) diff --git a/examples/5-multiple/main.go b/examples/5-multiple/main.go index 2d8d2439..26fc32d4 100644 --- a/examples/5-multiple/main.go +++ b/examples/5-multiple/main.go @@ -13,7 +13,7 @@ import ( "syscall" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/gorilla/mux" "github.com/hashicorp/go-multierror" "github.com/lovoo/goka" diff --git a/examples/8-monitoring/main.go b/examples/8-monitoring/main.go index 06ca6366..1a634538 100644 --- a/examples/8-monitoring/main.go +++ b/examples/8-monitoring/main.go @@ -14,7 +14,7 @@ import ( "syscall" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/gorilla/mux" "github.com/lovoo/goka" "github.com/lovoo/goka/codec" diff --git a/go.mod b/go.mod index 9bfc0272..a2a8411f 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ module github.com/lovoo/goka -go 1.18 +go 1.20 require ( - github.com/Shopify/sarama v1.37.2 + github.com/IBM/sarama v1.40.1 github.com/go-stack/stack v1.8.1 github.com/golang/mock v1.6.0 github.com/gorilla/mux v1.8.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/stretchr/testify v1.8.0 + github.com/stretchr/testify v1.8.4 github.com/syndtr/goleveldb v1.0.0 - golang.org/x/sync v0.1.0 + golang.org/x/sync v0.3.0 gopkg.in/redis.v5 v5.2.9 gopkg.in/yaml.v2 v2.4.0 ) @@ -18,7 +18,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/eapache/go-resiliency v1.3.0 // indirect - github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -28,13 +28,13 @@ require ( github.com/jcmturner/gofork v1.7.6 // indirect github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect - github.com/klauspost/compress v1.15.13 // indirect + github.com/klauspost/compress v1.16.6 // indirect github.com/kr/text v0.2.0 // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect - golang.org/x/crypto v0.4.0 // indirect - golang.org/x/net v0.9.0 // indirect + golang.org/x/crypto v0.11.0 // indirect + golang.org/x/net v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index be014350..3e3f0752 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Shopify/sarama v1.37.2 h1:LoBbU0yJPte0cE5TZCGdlzZRmMgMtZU/XgnUKZg9Cv4= -github.com/Shopify/sarama v1.37.2/go.mod h1:Nxye/E+YPru//Bpaorfhc3JsSGYwCaDDj+R4bK52U5o= +github.com/IBM/sarama v1.40.1 h1:lL01NNg/iBeigUbT+wpPysuTYW6roHo6kc1QrffRf0k= +github.com/IBM/sarama v1.40.1/go.mod h1:+5OFwA5Du9I6QrznhaMHsuwWdWZNMjaBSIxEWEgKOYE= github.com/Shopify/toxiproxy/v2 v2.5.0 h1:i4LPT+qrSlKNtQf5QliVjdP08GyAH8+BUIc9gT0eahc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -7,8 +7,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/eapache/go-resiliency v1.3.0 h1:RRL0nge+cWGlxXbUzJ7yMcq6w2XBEr19dCN6HECGaT0= github.com/eapache/go-resiliency v1.3.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 h1:8yY/I9ndfrgrXUbOGObLHKBR4Fl3nZXwM2c7OYTT8hM= +github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -47,8 +47,8 @@ github.com/jcmturner/gokrb5/v8 v8.4.3 h1:iTonLeSJOn7MVUtyMT+arAn5AKAPrkilzhGw8wE github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= -github.com/klauspost/compress v1.15.13 h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0= -github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= +github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -69,16 +69,17 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 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-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= -golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -87,15 +88,13 @@ golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220725212005-46097bf591d3/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -105,16 +104,14 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= 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.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= diff --git a/headers.go b/headers.go index 498e3245..424a2f36 100644 --- a/headers.go +++ b/headers.go @@ -1,7 +1,7 @@ package goka import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) // Headers represents custom message headers with a convenient interface. diff --git a/logger.go b/logger.go index ebc34371..a7778b69 100644 --- a/logger.go +++ b/logger.go @@ -6,7 +6,7 @@ import ( "os" "strings" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) var defaultLogger = &std{ diff --git a/mockautoconsumers.go b/mockautoconsumers.go index 3f71da75..03f985bc 100644 --- a/mockautoconsumers.go +++ b/mockautoconsumers.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "testing" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/hashicorp/go-multierror" "github.com/lovoo/goka/multierr" ) diff --git a/mocks.go b/mocks.go index 9e1fe1c4..2156a138 100644 --- a/mocks.go +++ b/mocks.go @@ -5,35 +5,36 @@ package goka import ( - sarama "github.com/Shopify/sarama" - gomock "github.com/golang/mock/gomock" reflect "reflect" + + sarama "github.com/IBM/sarama" + gomock "github.com/golang/mock/gomock" ) -// MockTopicManager is a mock of TopicManager interface +// MockTopicManager is a mock of TopicManager interface. type MockTopicManager struct { ctrl *gomock.Controller recorder *MockTopicManagerMockRecorder } -// MockTopicManagerMockRecorder is the mock recorder for MockTopicManager +// MockTopicManagerMockRecorder is the mock recorder for MockTopicManager. type MockTopicManagerMockRecorder struct { mock *MockTopicManager } -// NewMockTopicManager creates a new mock instance +// NewMockTopicManager creates a new mock instance. func NewMockTopicManager(ctrl *gomock.Controller) *MockTopicManager { mock := &MockTopicManager{ctrl: ctrl} mock.recorder = &MockTopicManagerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockTopicManager) EXPECT() *MockTopicManagerMockRecorder { return m.recorder } -// Close mocks base method +// Close mocks base method. func (m *MockTopicManager) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -41,13 +42,13 @@ func (m *MockTopicManager) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockTopicManagerMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockTopicManager)(nil).Close)) } -// EnsureStreamExists mocks base method +// EnsureStreamExists mocks base method. func (m *MockTopicManager) EnsureStreamExists(arg0 string, arg1 int) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EnsureStreamExists", arg0, arg1) @@ -55,13 +56,13 @@ func (m *MockTopicManager) EnsureStreamExists(arg0 string, arg1 int) error { return ret0 } -// EnsureStreamExists indicates an expected call of EnsureStreamExists +// EnsureStreamExists indicates an expected call of EnsureStreamExists. func (mr *MockTopicManagerMockRecorder) EnsureStreamExists(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureStreamExists", reflect.TypeOf((*MockTopicManager)(nil).EnsureStreamExists), arg0, arg1) } -// EnsureTableExists mocks base method +// EnsureTableExists mocks base method. func (m *MockTopicManager) EnsureTableExists(arg0 string, arg1 int) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EnsureTableExists", arg0, arg1) @@ -69,13 +70,13 @@ func (m *MockTopicManager) EnsureTableExists(arg0 string, arg1 int) error { return ret0 } -// EnsureTableExists indicates an expected call of EnsureTableExists +// EnsureTableExists indicates an expected call of EnsureTableExists. func (mr *MockTopicManagerMockRecorder) EnsureTableExists(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureTableExists", reflect.TypeOf((*MockTopicManager)(nil).EnsureTableExists), arg0, arg1) } -// EnsureTopicExists mocks base method +// EnsureTopicExists mocks base method. func (m *MockTopicManager) EnsureTopicExists(arg0 string, arg1, arg2 int, arg3 map[string]string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EnsureTopicExists", arg0, arg1, arg2, arg3) @@ -83,13 +84,13 @@ func (m *MockTopicManager) EnsureTopicExists(arg0 string, arg1, arg2 int, arg3 m return ret0 } -// EnsureTopicExists indicates an expected call of EnsureTopicExists +// EnsureTopicExists indicates an expected call of EnsureTopicExists. func (mr *MockTopicManagerMockRecorder) EnsureTopicExists(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureTopicExists", reflect.TypeOf((*MockTopicManager)(nil).EnsureTopicExists), arg0, arg1, arg2, arg3) } -// GetOffset mocks base method +// GetOffset mocks base method. func (m *MockTopicManager) GetOffset(arg0 string, arg1 int32, arg2 int64) (int64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOffset", arg0, arg1, arg2) @@ -98,13 +99,13 @@ func (m *MockTopicManager) GetOffset(arg0 string, arg1 int32, arg2 int64) (int64 return ret0, ret1 } -// GetOffset indicates an expected call of GetOffset +// GetOffset indicates an expected call of GetOffset. func (mr *MockTopicManagerMockRecorder) GetOffset(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOffset", reflect.TypeOf((*MockTopicManager)(nil).GetOffset), arg0, arg1, arg2) } -// Partitions mocks base method +// Partitions mocks base method. func (m *MockTopicManager) Partitions(arg0 string) ([]int32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Partitions", arg0) @@ -113,36 +114,36 @@ func (m *MockTopicManager) Partitions(arg0 string) ([]int32, error) { return ret0, ret1 } -// Partitions indicates an expected call of Partitions +// Partitions indicates an expected call of Partitions. func (mr *MockTopicManagerMockRecorder) Partitions(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Partitions", reflect.TypeOf((*MockTopicManager)(nil).Partitions), arg0) } -// MockProducer is a mock of Producer interface +// MockProducer is a mock of Producer interface. type MockProducer struct { ctrl *gomock.Controller recorder *MockProducerMockRecorder } -// MockProducerMockRecorder is the mock recorder for MockProducer +// MockProducerMockRecorder is the mock recorder for MockProducer. type MockProducerMockRecorder struct { mock *MockProducer } -// NewMockProducer creates a new mock instance +// NewMockProducer creates a new mock instance. func NewMockProducer(ctrl *gomock.Controller) *MockProducer { mock := &MockProducer{ctrl: ctrl} mock.recorder = &MockProducerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockProducer) EXPECT() *MockProducerMockRecorder { return m.recorder } -// Close mocks base method +// Close mocks base method. func (m *MockProducer) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -150,13 +151,13 @@ func (m *MockProducer) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockProducerMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockProducer)(nil).Close)) } -// Emit mocks base method +// Emit mocks base method. func (m *MockProducer) Emit(arg0, arg1 string, arg2 []byte) *Promise { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Emit", arg0, arg1, arg2) @@ -164,13 +165,13 @@ func (m *MockProducer) Emit(arg0, arg1 string, arg2 []byte) *Promise { return ret0 } -// Emit indicates an expected call of Emit +// Emit indicates an expected call of Emit. func (mr *MockProducerMockRecorder) Emit(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Emit", reflect.TypeOf((*MockProducer)(nil).Emit), arg0, arg1, arg2) } -// EmitWithHeaders mocks base method +// EmitWithHeaders mocks base method. func (m *MockProducer) EmitWithHeaders(arg0, arg1 string, arg2 []byte, arg3 Headers) *Promise { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "EmitWithHeaders", arg0, arg1, arg2, arg3) @@ -178,36 +179,36 @@ func (m *MockProducer) EmitWithHeaders(arg0, arg1 string, arg2 []byte, arg3 Head return ret0 } -// EmitWithHeaders indicates an expected call of EmitWithHeaders +// EmitWithHeaders indicates an expected call of EmitWithHeaders. func (mr *MockProducerMockRecorder) EmitWithHeaders(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EmitWithHeaders", reflect.TypeOf((*MockProducer)(nil).EmitWithHeaders), arg0, arg1, arg2, arg3) } -// MockBroker is a mock of Broker interface +// MockBroker is a mock of Broker interface. type MockBroker struct { ctrl *gomock.Controller recorder *MockBrokerMockRecorder } -// MockBrokerMockRecorder is the mock recorder for MockBroker +// MockBrokerMockRecorder is the mock recorder for MockBroker. type MockBrokerMockRecorder struct { mock *MockBroker } -// NewMockBroker creates a new mock instance +// NewMockBroker creates a new mock instance. func NewMockBroker(ctrl *gomock.Controller) *MockBroker { mock := &MockBroker{ctrl: ctrl} mock.recorder = &MockBrokerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockBroker) EXPECT() *MockBrokerMockRecorder { return m.recorder } -// Addr mocks base method +// Addr mocks base method. func (m *MockBroker) Addr() string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Addr") @@ -215,13 +216,13 @@ func (m *MockBroker) Addr() string { return ret0 } -// Addr indicates an expected call of Addr +// Addr indicates an expected call of Addr. func (mr *MockBrokerMockRecorder) Addr() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Addr", reflect.TypeOf((*MockBroker)(nil).Addr)) } -// Connected mocks base method +// Connected mocks base method. func (m *MockBroker) Connected() (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Connected") @@ -230,13 +231,13 @@ func (m *MockBroker) Connected() (bool, error) { return ret0, ret1 } -// Connected indicates an expected call of Connected +// Connected indicates an expected call of Connected. func (mr *MockBrokerMockRecorder) Connected() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connected", reflect.TypeOf((*MockBroker)(nil).Connected)) } -// CreateTopics mocks base method +// CreateTopics mocks base method. func (m *MockBroker) CreateTopics(arg0 *sarama.CreateTopicsRequest) (*sarama.CreateTopicsResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateTopics", arg0) @@ -245,13 +246,13 @@ func (m *MockBroker) CreateTopics(arg0 *sarama.CreateTopicsRequest) (*sarama.Cre return ret0, ret1 } -// CreateTopics indicates an expected call of CreateTopics +// CreateTopics indicates an expected call of CreateTopics. func (mr *MockBrokerMockRecorder) CreateTopics(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTopics", reflect.TypeOf((*MockBroker)(nil).CreateTopics), arg0) } -// Open mocks base method +// Open mocks base method. func (m *MockBroker) Open(arg0 *sarama.Config) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Open", arg0) @@ -259,7 +260,7 @@ func (m *MockBroker) Open(arg0 *sarama.Config) error { return ret0 } -// Open indicates an expected call of Open +// Open indicates an expected call of Open. func (mr *MockBrokerMockRecorder) Open(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Open", reflect.TypeOf((*MockBroker)(nil).Open), arg0) diff --git a/mockssarama.go b/mockssarama.go index dd00bb0a..8eb6d673 100644 --- a/mockssarama.go +++ b/mockssarama.go @@ -1,39 +1,40 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/Shopify/sarama (interfaces: Client,ClusterAdmin) +// Source: github.com/IBM/sarama (interfaces: Client,ClusterAdmin) // Package goka is a generated GoMock package. package goka import ( - sarama "github.com/Shopify/sarama" - gomock "github.com/golang/mock/gomock" reflect "reflect" + + sarama "github.com/IBM/sarama" + gomock "github.com/golang/mock/gomock" ) -// MockClient is a mock of Client interface +// MockClient is a mock of Client interface. type MockClient struct { ctrl *gomock.Controller recorder *MockClientMockRecorder } -// MockClientMockRecorder is the mock recorder for MockClient +// MockClientMockRecorder is the mock recorder for MockClient. type MockClientMockRecorder struct { mock *MockClient } -// NewMockClient creates a new mock instance +// NewMockClient creates a new mock instance. func NewMockClient(ctrl *gomock.Controller) *MockClient { mock := &MockClient{ctrl: ctrl} mock.recorder = &MockClientMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockClient) EXPECT() *MockClientMockRecorder { return m.recorder } -// Broker mocks base method +// Broker mocks base method. func (m *MockClient) Broker(arg0 int32) (*sarama.Broker, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Broker", arg0) @@ -42,13 +43,13 @@ func (m *MockClient) Broker(arg0 int32) (*sarama.Broker, error) { return ret0, ret1 } -// Broker indicates an expected call of Broker +// Broker indicates an expected call of Broker. func (mr *MockClientMockRecorder) Broker(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Broker", reflect.TypeOf((*MockClient)(nil).Broker), arg0) } -// Brokers mocks base method +// Brokers mocks base method. func (m *MockClient) Brokers() []*sarama.Broker { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Brokers") @@ -56,13 +57,13 @@ func (m *MockClient) Brokers() []*sarama.Broker { return ret0 } -// Brokers indicates an expected call of Brokers +// Brokers indicates an expected call of Brokers. func (mr *MockClientMockRecorder) Brokers() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Brokers", reflect.TypeOf((*MockClient)(nil).Brokers)) } -// Close mocks base method +// Close mocks base method. func (m *MockClient) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -70,13 +71,13 @@ func (m *MockClient) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockClientMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockClient)(nil).Close)) } -// Closed mocks base method +// Closed mocks base method. func (m *MockClient) Closed() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Closed") @@ -84,13 +85,13 @@ func (m *MockClient) Closed() bool { return ret0 } -// Closed indicates an expected call of Closed +// Closed indicates an expected call of Closed. func (mr *MockClientMockRecorder) Closed() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Closed", reflect.TypeOf((*MockClient)(nil).Closed)) } -// Config mocks base method +// Config mocks base method. func (m *MockClient) Config() *sarama.Config { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Config") @@ -98,13 +99,13 @@ func (m *MockClient) Config() *sarama.Config { return ret0 } -// Config indicates an expected call of Config +// Config indicates an expected call of Config. func (mr *MockClientMockRecorder) Config() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Config", reflect.TypeOf((*MockClient)(nil).Config)) } -// Controller mocks base method +// Controller mocks base method. func (m *MockClient) Controller() (*sarama.Broker, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Controller") @@ -113,13 +114,13 @@ func (m *MockClient) Controller() (*sarama.Broker, error) { return ret0, ret1 } -// Controller indicates an expected call of Controller +// Controller indicates an expected call of Controller. func (mr *MockClientMockRecorder) Controller() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Controller", reflect.TypeOf((*MockClient)(nil).Controller)) } -// Coordinator mocks base method +// Coordinator mocks base method. func (m *MockClient) Coordinator(arg0 string) (*sarama.Broker, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Coordinator", arg0) @@ -128,13 +129,13 @@ func (m *MockClient) Coordinator(arg0 string) (*sarama.Broker, error) { return ret0, ret1 } -// Coordinator indicates an expected call of Coordinator +// Coordinator indicates an expected call of Coordinator. func (mr *MockClientMockRecorder) Coordinator(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Coordinator", reflect.TypeOf((*MockClient)(nil).Coordinator), arg0) } -// GetOffset mocks base method +// GetOffset mocks base method. func (m *MockClient) GetOffset(arg0 string, arg1 int32, arg2 int64) (int64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOffset", arg0, arg1, arg2) @@ -143,13 +144,13 @@ func (m *MockClient) GetOffset(arg0 string, arg1 int32, arg2 int64) (int64, erro return ret0, ret1 } -// GetOffset indicates an expected call of GetOffset +// GetOffset indicates an expected call of GetOffset. func (mr *MockClientMockRecorder) GetOffset(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOffset", reflect.TypeOf((*MockClient)(nil).GetOffset), arg0, arg1, arg2) } -// InSyncReplicas mocks base method +// InSyncReplicas mocks base method. func (m *MockClient) InSyncReplicas(arg0 string, arg1 int32) ([]int32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InSyncReplicas", arg0, arg1) @@ -158,13 +159,13 @@ func (m *MockClient) InSyncReplicas(arg0 string, arg1 int32) ([]int32, error) { return ret0, ret1 } -// InSyncReplicas indicates an expected call of InSyncReplicas +// InSyncReplicas indicates an expected call of InSyncReplicas. func (mr *MockClientMockRecorder) InSyncReplicas(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InSyncReplicas", reflect.TypeOf((*MockClient)(nil).InSyncReplicas), arg0, arg1) } -// InitProducerID mocks base method +// InitProducerID mocks base method. func (m *MockClient) InitProducerID() (*sarama.InitProducerIDResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitProducerID") @@ -173,13 +174,13 @@ func (m *MockClient) InitProducerID() (*sarama.InitProducerIDResponse, error) { return ret0, ret1 } -// InitProducerID indicates an expected call of InitProducerID +// InitProducerID indicates an expected call of InitProducerID. func (mr *MockClientMockRecorder) InitProducerID() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitProducerID", reflect.TypeOf((*MockClient)(nil).InitProducerID)) } -// Leader mocks base method +// Leader mocks base method. func (m *MockClient) Leader(arg0 string, arg1 int32) (*sarama.Broker, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Leader", arg0, arg1) @@ -188,13 +189,29 @@ func (m *MockClient) Leader(arg0 string, arg1 int32) (*sarama.Broker, error) { return ret0, ret1 } -// Leader indicates an expected call of Leader +// Leader indicates an expected call of Leader. func (mr *MockClientMockRecorder) Leader(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Leader", reflect.TypeOf((*MockClient)(nil).Leader), arg0, arg1) } -// LeastLoadedBroker mocks base method +// LeaderAndEpoch mocks base method. +func (m *MockClient) LeaderAndEpoch(arg0 string, arg1 int32) (*sarama.Broker, int32, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LeaderAndEpoch", arg0, arg1) + ret0, _ := ret[0].(*sarama.Broker) + ret1, _ := ret[1].(int32) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LeaderAndEpoch indicates an expected call of LeaderAndEpoch. +func (mr *MockClientMockRecorder) LeaderAndEpoch(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeaderAndEpoch", reflect.TypeOf((*MockClient)(nil).LeaderAndEpoch), arg0, arg1) +} + +// LeastLoadedBroker mocks base method. func (m *MockClient) LeastLoadedBroker() *sarama.Broker { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LeastLoadedBroker") @@ -202,13 +219,13 @@ func (m *MockClient) LeastLoadedBroker() *sarama.Broker { return ret0 } -// LeastLoadedBroker indicates an expected call of LeastLoadedBroker +// LeastLoadedBroker indicates an expected call of LeastLoadedBroker. func (mr *MockClientMockRecorder) LeastLoadedBroker() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LeastLoadedBroker", reflect.TypeOf((*MockClient)(nil).LeastLoadedBroker)) } -// OfflineReplicas mocks base method +// OfflineReplicas mocks base method. func (m *MockClient) OfflineReplicas(arg0 string, arg1 int32) ([]int32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OfflineReplicas", arg0, arg1) @@ -217,13 +234,13 @@ func (m *MockClient) OfflineReplicas(arg0 string, arg1 int32) ([]int32, error) { return ret0, ret1 } -// OfflineReplicas indicates an expected call of OfflineReplicas +// OfflineReplicas indicates an expected call of OfflineReplicas. func (mr *MockClientMockRecorder) OfflineReplicas(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OfflineReplicas", reflect.TypeOf((*MockClient)(nil).OfflineReplicas), arg0, arg1) } -// Partitions mocks base method +// Partitions mocks base method. func (m *MockClient) Partitions(arg0 string) ([]int32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Partitions", arg0) @@ -232,13 +249,13 @@ func (m *MockClient) Partitions(arg0 string) ([]int32, error) { return ret0, ret1 } -// Partitions indicates an expected call of Partitions +// Partitions indicates an expected call of Partitions. func (mr *MockClientMockRecorder) Partitions(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Partitions", reflect.TypeOf((*MockClient)(nil).Partitions), arg0) } -// RefreshBrokers mocks base method +// RefreshBrokers mocks base method. func (m *MockClient) RefreshBrokers(arg0 []string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RefreshBrokers", arg0) @@ -246,13 +263,13 @@ func (m *MockClient) RefreshBrokers(arg0 []string) error { return ret0 } -// RefreshBrokers indicates an expected call of RefreshBrokers +// RefreshBrokers indicates an expected call of RefreshBrokers. func (mr *MockClientMockRecorder) RefreshBrokers(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshBrokers", reflect.TypeOf((*MockClient)(nil).RefreshBrokers), arg0) } -// RefreshController mocks base method +// RefreshController mocks base method. func (m *MockClient) RefreshController() (*sarama.Broker, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RefreshController") @@ -261,13 +278,13 @@ func (m *MockClient) RefreshController() (*sarama.Broker, error) { return ret0, ret1 } -// RefreshController indicates an expected call of RefreshController +// RefreshController indicates an expected call of RefreshController. func (mr *MockClientMockRecorder) RefreshController() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshController", reflect.TypeOf((*MockClient)(nil).RefreshController)) } -// RefreshCoordinator mocks base method +// RefreshCoordinator mocks base method. func (m *MockClient) RefreshCoordinator(arg0 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RefreshCoordinator", arg0) @@ -275,13 +292,13 @@ func (m *MockClient) RefreshCoordinator(arg0 string) error { return ret0 } -// RefreshCoordinator indicates an expected call of RefreshCoordinator +// RefreshCoordinator indicates an expected call of RefreshCoordinator. func (mr *MockClientMockRecorder) RefreshCoordinator(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshCoordinator", reflect.TypeOf((*MockClient)(nil).RefreshCoordinator), arg0) } -// RefreshMetadata mocks base method +// RefreshMetadata mocks base method. func (m *MockClient) RefreshMetadata(arg0 ...string) error { m.ctrl.T.Helper() varargs := []interface{}{} @@ -293,13 +310,13 @@ func (m *MockClient) RefreshMetadata(arg0 ...string) error { return ret0 } -// RefreshMetadata indicates an expected call of RefreshMetadata +// RefreshMetadata indicates an expected call of RefreshMetadata. func (mr *MockClientMockRecorder) RefreshMetadata(arg0 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshMetadata", reflect.TypeOf((*MockClient)(nil).RefreshMetadata), arg0...) } -// RefreshTransactionCoordinator mocks base method +// RefreshTransactionCoordinator mocks base method. func (m *MockClient) RefreshTransactionCoordinator(arg0 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RefreshTransactionCoordinator", arg0) @@ -307,13 +324,13 @@ func (m *MockClient) RefreshTransactionCoordinator(arg0 string) error { return ret0 } -// RefreshTransactionCoordinator indicates an expected call of RefreshTransactionCoordinator +// RefreshTransactionCoordinator indicates an expected call of RefreshTransactionCoordinator. func (mr *MockClientMockRecorder) RefreshTransactionCoordinator(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshTransactionCoordinator", reflect.TypeOf((*MockClient)(nil).RefreshTransactionCoordinator), arg0) } -// Replicas mocks base method +// Replicas mocks base method. func (m *MockClient) Replicas(arg0 string, arg1 int32) ([]int32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Replicas", arg0, arg1) @@ -322,13 +339,13 @@ func (m *MockClient) Replicas(arg0 string, arg1 int32) ([]int32, error) { return ret0, ret1 } -// Replicas indicates an expected call of Replicas +// Replicas indicates an expected call of Replicas. func (mr *MockClientMockRecorder) Replicas(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Replicas", reflect.TypeOf((*MockClient)(nil).Replicas), arg0, arg1) } -// Topics mocks base method +// Topics mocks base method. func (m *MockClient) Topics() ([]string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Topics") @@ -337,13 +354,13 @@ func (m *MockClient) Topics() ([]string, error) { return ret0, ret1 } -// Topics indicates an expected call of Topics +// Topics indicates an expected call of Topics. func (mr *MockClientMockRecorder) Topics() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Topics", reflect.TypeOf((*MockClient)(nil).Topics)) } -// TransactionCoordinator mocks base method +// TransactionCoordinator mocks base method. func (m *MockClient) TransactionCoordinator(arg0 string) (*sarama.Broker, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TransactionCoordinator", arg0) @@ -352,13 +369,13 @@ func (m *MockClient) TransactionCoordinator(arg0 string) (*sarama.Broker, error) return ret0, ret1 } -// TransactionCoordinator indicates an expected call of TransactionCoordinator +// TransactionCoordinator indicates an expected call of TransactionCoordinator. func (mr *MockClientMockRecorder) TransactionCoordinator(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionCoordinator", reflect.TypeOf((*MockClient)(nil).TransactionCoordinator), arg0) } -// WritablePartitions mocks base method +// WritablePartitions mocks base method. func (m *MockClient) WritablePartitions(arg0 string) ([]int32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WritablePartitions", arg0) @@ -367,36 +384,36 @@ func (m *MockClient) WritablePartitions(arg0 string) ([]int32, error) { return ret0, ret1 } -// WritablePartitions indicates an expected call of WritablePartitions +// WritablePartitions indicates an expected call of WritablePartitions. func (mr *MockClientMockRecorder) WritablePartitions(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WritablePartitions", reflect.TypeOf((*MockClient)(nil).WritablePartitions), arg0) } -// MockClusterAdmin is a mock of ClusterAdmin interface +// MockClusterAdmin is a mock of ClusterAdmin interface. type MockClusterAdmin struct { ctrl *gomock.Controller recorder *MockClusterAdminMockRecorder } -// MockClusterAdminMockRecorder is the mock recorder for MockClusterAdmin +// MockClusterAdminMockRecorder is the mock recorder for MockClusterAdmin. type MockClusterAdminMockRecorder struct { mock *MockClusterAdmin } -// NewMockClusterAdmin creates a new mock instance +// NewMockClusterAdmin creates a new mock instance. func NewMockClusterAdmin(ctrl *gomock.Controller) *MockClusterAdmin { mock := &MockClusterAdmin{ctrl: ctrl} mock.recorder = &MockClusterAdminMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockClusterAdmin) EXPECT() *MockClusterAdminMockRecorder { return m.recorder } -// AlterClientQuotas mocks base method +// AlterClientQuotas mocks base method. func (m *MockClusterAdmin) AlterClientQuotas(arg0 []sarama.QuotaEntityComponent, arg1 sarama.ClientQuotasOp, arg2 bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AlterClientQuotas", arg0, arg1, arg2) @@ -404,13 +421,13 @@ func (m *MockClusterAdmin) AlterClientQuotas(arg0 []sarama.QuotaEntityComponent, return ret0 } -// AlterClientQuotas indicates an expected call of AlterClientQuotas +// AlterClientQuotas indicates an expected call of AlterClientQuotas. func (mr *MockClusterAdminMockRecorder) AlterClientQuotas(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AlterClientQuotas", reflect.TypeOf((*MockClusterAdmin)(nil).AlterClientQuotas), arg0, arg1, arg2) } -// AlterConfig mocks base method +// AlterConfig mocks base method. func (m *MockClusterAdmin) AlterConfig(arg0 sarama.ConfigResourceType, arg1 string, arg2 map[string]*string, arg3 bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AlterConfig", arg0, arg1, arg2, arg3) @@ -418,13 +435,13 @@ func (m *MockClusterAdmin) AlterConfig(arg0 sarama.ConfigResourceType, arg1 stri return ret0 } -// AlterConfig indicates an expected call of AlterConfig +// AlterConfig indicates an expected call of AlterConfig. func (mr *MockClusterAdminMockRecorder) AlterConfig(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AlterConfig", reflect.TypeOf((*MockClusterAdmin)(nil).AlterConfig), arg0, arg1, arg2, arg3) } -// AlterPartitionReassignments mocks base method +// AlterPartitionReassignments mocks base method. func (m *MockClusterAdmin) AlterPartitionReassignments(arg0 string, arg1 [][]int32) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AlterPartitionReassignments", arg0, arg1) @@ -432,13 +449,13 @@ func (m *MockClusterAdmin) AlterPartitionReassignments(arg0 string, arg1 [][]int return ret0 } -// AlterPartitionReassignments indicates an expected call of AlterPartitionReassignments +// AlterPartitionReassignments indicates an expected call of AlterPartitionReassignments. func (mr *MockClusterAdminMockRecorder) AlterPartitionReassignments(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AlterPartitionReassignments", reflect.TypeOf((*MockClusterAdmin)(nil).AlterPartitionReassignments), arg0, arg1) } -// Close mocks base method +// Close mocks base method. func (m *MockClusterAdmin) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -446,13 +463,13 @@ func (m *MockClusterAdmin) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockClusterAdminMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockClusterAdmin)(nil).Close)) } -// Controller mocks base method +// Controller mocks base method. func (m *MockClusterAdmin) Controller() (*sarama.Broker, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Controller") @@ -461,13 +478,13 @@ func (m *MockClusterAdmin) Controller() (*sarama.Broker, error) { return ret0, ret1 } -// Controller indicates an expected call of Controller +// Controller indicates an expected call of Controller. func (mr *MockClusterAdminMockRecorder) Controller() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Controller", reflect.TypeOf((*MockClusterAdmin)(nil).Controller)) } -// CreateACL mocks base method +// CreateACL mocks base method. func (m *MockClusterAdmin) CreateACL(arg0 sarama.Resource, arg1 sarama.Acl) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateACL", arg0, arg1) @@ -475,13 +492,13 @@ func (m *MockClusterAdmin) CreateACL(arg0 sarama.Resource, arg1 sarama.Acl) erro return ret0 } -// CreateACL indicates an expected call of CreateACL +// CreateACL indicates an expected call of CreateACL. func (mr *MockClusterAdminMockRecorder) CreateACL(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateACL", reflect.TypeOf((*MockClusterAdmin)(nil).CreateACL), arg0, arg1) } -// CreateACLs mocks base method +// CreateACLs mocks base method. func (m *MockClusterAdmin) CreateACLs(arg0 []*sarama.ResourceAcls) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateACLs", arg0) @@ -489,13 +506,13 @@ func (m *MockClusterAdmin) CreateACLs(arg0 []*sarama.ResourceAcls) error { return ret0 } -// CreateACLs indicates an expected call of CreateACLs +// CreateACLs indicates an expected call of CreateACLs. func (mr *MockClusterAdminMockRecorder) CreateACLs(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateACLs", reflect.TypeOf((*MockClusterAdmin)(nil).CreateACLs), arg0) } -// CreatePartitions mocks base method +// CreatePartitions mocks base method. func (m *MockClusterAdmin) CreatePartitions(arg0 string, arg1 int32, arg2 [][]int32, arg3 bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreatePartitions", arg0, arg1, arg2, arg3) @@ -503,13 +520,13 @@ func (m *MockClusterAdmin) CreatePartitions(arg0 string, arg1 int32, arg2 [][]in return ret0 } -// CreatePartitions indicates an expected call of CreatePartitions +// CreatePartitions indicates an expected call of CreatePartitions. func (mr *MockClusterAdminMockRecorder) CreatePartitions(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePartitions", reflect.TypeOf((*MockClusterAdmin)(nil).CreatePartitions), arg0, arg1, arg2, arg3) } -// CreateTopic mocks base method +// CreateTopic mocks base method. func (m *MockClusterAdmin) CreateTopic(arg0 string, arg1 *sarama.TopicDetail, arg2 bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateTopic", arg0, arg1, arg2) @@ -517,13 +534,13 @@ func (m *MockClusterAdmin) CreateTopic(arg0 string, arg1 *sarama.TopicDetail, ar return ret0 } -// CreateTopic indicates an expected call of CreateTopic +// CreateTopic indicates an expected call of CreateTopic. func (mr *MockClusterAdminMockRecorder) CreateTopic(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTopic", reflect.TypeOf((*MockClusterAdmin)(nil).CreateTopic), arg0, arg1, arg2) } -// DeleteACL mocks base method +// DeleteACL mocks base method. func (m *MockClusterAdmin) DeleteACL(arg0 sarama.AclFilter, arg1 bool) ([]sarama.MatchingAcl, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteACL", arg0, arg1) @@ -532,13 +549,13 @@ func (m *MockClusterAdmin) DeleteACL(arg0 sarama.AclFilter, arg1 bool) ([]sarama return ret0, ret1 } -// DeleteACL indicates an expected call of DeleteACL +// DeleteACL indicates an expected call of DeleteACL. func (mr *MockClusterAdminMockRecorder) DeleteACL(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteACL", reflect.TypeOf((*MockClusterAdmin)(nil).DeleteACL), arg0, arg1) } -// DeleteConsumerGroup mocks base method +// DeleteConsumerGroup mocks base method. func (m *MockClusterAdmin) DeleteConsumerGroup(arg0 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteConsumerGroup", arg0) @@ -546,13 +563,13 @@ func (m *MockClusterAdmin) DeleteConsumerGroup(arg0 string) error { return ret0 } -// DeleteConsumerGroup indicates an expected call of DeleteConsumerGroup +// DeleteConsumerGroup indicates an expected call of DeleteConsumerGroup. func (mr *MockClusterAdminMockRecorder) DeleteConsumerGroup(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteConsumerGroup", reflect.TypeOf((*MockClusterAdmin)(nil).DeleteConsumerGroup), arg0) } -// DeleteConsumerGroupOffset mocks base method +// DeleteConsumerGroupOffset mocks base method. func (m *MockClusterAdmin) DeleteConsumerGroupOffset(arg0, arg1 string, arg2 int32) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteConsumerGroupOffset", arg0, arg1, arg2) @@ -560,13 +577,13 @@ func (m *MockClusterAdmin) DeleteConsumerGroupOffset(arg0, arg1 string, arg2 int return ret0 } -// DeleteConsumerGroupOffset indicates an expected call of DeleteConsumerGroupOffset +// DeleteConsumerGroupOffset indicates an expected call of DeleteConsumerGroupOffset. func (mr *MockClusterAdminMockRecorder) DeleteConsumerGroupOffset(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteConsumerGroupOffset", reflect.TypeOf((*MockClusterAdmin)(nil).DeleteConsumerGroupOffset), arg0, arg1, arg2) } -// DeleteRecords mocks base method +// DeleteRecords mocks base method. func (m *MockClusterAdmin) DeleteRecords(arg0 string, arg1 map[int32]int64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteRecords", arg0, arg1) @@ -574,13 +591,13 @@ func (m *MockClusterAdmin) DeleteRecords(arg0 string, arg1 map[int32]int64) erro return ret0 } -// DeleteRecords indicates an expected call of DeleteRecords +// DeleteRecords indicates an expected call of DeleteRecords. func (mr *MockClusterAdminMockRecorder) DeleteRecords(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRecords", reflect.TypeOf((*MockClusterAdmin)(nil).DeleteRecords), arg0, arg1) } -// DeleteTopic mocks base method +// DeleteTopic mocks base method. func (m *MockClusterAdmin) DeleteTopic(arg0 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteTopic", arg0) @@ -588,13 +605,13 @@ func (m *MockClusterAdmin) DeleteTopic(arg0 string) error { return ret0 } -// DeleteTopic indicates an expected call of DeleteTopic +// DeleteTopic indicates an expected call of DeleteTopic. func (mr *MockClusterAdminMockRecorder) DeleteTopic(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTopic", reflect.TypeOf((*MockClusterAdmin)(nil).DeleteTopic), arg0) } -// DeleteUserScramCredentials mocks base method +// DeleteUserScramCredentials mocks base method. func (m *MockClusterAdmin) DeleteUserScramCredentials(arg0 []sarama.AlterUserScramCredentialsDelete) ([]*sarama.AlterUserScramCredentialsResult, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteUserScramCredentials", arg0) @@ -603,13 +620,13 @@ func (m *MockClusterAdmin) DeleteUserScramCredentials(arg0 []sarama.AlterUserScr return ret0, ret1 } -// DeleteUserScramCredentials indicates an expected call of DeleteUserScramCredentials +// DeleteUserScramCredentials indicates an expected call of DeleteUserScramCredentials. func (mr *MockClusterAdminMockRecorder) DeleteUserScramCredentials(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUserScramCredentials", reflect.TypeOf((*MockClusterAdmin)(nil).DeleteUserScramCredentials), arg0) } -// DescribeClientQuotas mocks base method +// DescribeClientQuotas mocks base method. func (m *MockClusterAdmin) DescribeClientQuotas(arg0 []sarama.QuotaFilterComponent, arg1 bool) ([]sarama.DescribeClientQuotasEntry, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeClientQuotas", arg0, arg1) @@ -618,13 +635,13 @@ func (m *MockClusterAdmin) DescribeClientQuotas(arg0 []sarama.QuotaFilterCompone return ret0, ret1 } -// DescribeClientQuotas indicates an expected call of DescribeClientQuotas +// DescribeClientQuotas indicates an expected call of DescribeClientQuotas. func (mr *MockClusterAdminMockRecorder) DescribeClientQuotas(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeClientQuotas", reflect.TypeOf((*MockClusterAdmin)(nil).DescribeClientQuotas), arg0, arg1) } -// DescribeCluster mocks base method +// DescribeCluster mocks base method. func (m *MockClusterAdmin) DescribeCluster() ([]*sarama.Broker, int32, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeCluster") @@ -634,13 +651,13 @@ func (m *MockClusterAdmin) DescribeCluster() ([]*sarama.Broker, int32, error) { return ret0, ret1, ret2 } -// DescribeCluster indicates an expected call of DescribeCluster +// DescribeCluster indicates an expected call of DescribeCluster. func (mr *MockClusterAdminMockRecorder) DescribeCluster() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCluster", reflect.TypeOf((*MockClusterAdmin)(nil).DescribeCluster)) } -// DescribeConfig mocks base method +// DescribeConfig mocks base method. func (m *MockClusterAdmin) DescribeConfig(arg0 sarama.ConfigResource) ([]sarama.ConfigEntry, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeConfig", arg0) @@ -649,13 +666,13 @@ func (m *MockClusterAdmin) DescribeConfig(arg0 sarama.ConfigResource) ([]sarama. return ret0, ret1 } -// DescribeConfig indicates an expected call of DescribeConfig +// DescribeConfig indicates an expected call of DescribeConfig. func (mr *MockClusterAdminMockRecorder) DescribeConfig(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeConfig", reflect.TypeOf((*MockClusterAdmin)(nil).DescribeConfig), arg0) } -// DescribeConsumerGroups mocks base method +// DescribeConsumerGroups mocks base method. func (m *MockClusterAdmin) DescribeConsumerGroups(arg0 []string) ([]*sarama.GroupDescription, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeConsumerGroups", arg0) @@ -664,13 +681,13 @@ func (m *MockClusterAdmin) DescribeConsumerGroups(arg0 []string) ([]*sarama.Grou return ret0, ret1 } -// DescribeConsumerGroups indicates an expected call of DescribeConsumerGroups +// DescribeConsumerGroups indicates an expected call of DescribeConsumerGroups. func (mr *MockClusterAdminMockRecorder) DescribeConsumerGroups(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeConsumerGroups", reflect.TypeOf((*MockClusterAdmin)(nil).DescribeConsumerGroups), arg0) } -// DescribeLogDirs mocks base method +// DescribeLogDirs mocks base method. func (m *MockClusterAdmin) DescribeLogDirs(arg0 []int32) (map[int32][]sarama.DescribeLogDirsResponseDirMetadata, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeLogDirs", arg0) @@ -679,13 +696,13 @@ func (m *MockClusterAdmin) DescribeLogDirs(arg0 []int32) (map[int32][]sarama.Des return ret0, ret1 } -// DescribeLogDirs indicates an expected call of DescribeLogDirs +// DescribeLogDirs indicates an expected call of DescribeLogDirs. func (mr *MockClusterAdminMockRecorder) DescribeLogDirs(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeLogDirs", reflect.TypeOf((*MockClusterAdmin)(nil).DescribeLogDirs), arg0) } -// DescribeTopics mocks base method +// DescribeTopics mocks base method. func (m *MockClusterAdmin) DescribeTopics(arg0 []string) ([]*sarama.TopicMetadata, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeTopics", arg0) @@ -694,13 +711,13 @@ func (m *MockClusterAdmin) DescribeTopics(arg0 []string) ([]*sarama.TopicMetadat return ret0, ret1 } -// DescribeTopics indicates an expected call of DescribeTopics +// DescribeTopics indicates an expected call of DescribeTopics. func (mr *MockClusterAdminMockRecorder) DescribeTopics(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeTopics", reflect.TypeOf((*MockClusterAdmin)(nil).DescribeTopics), arg0) } -// DescribeUserScramCredentials mocks base method +// DescribeUserScramCredentials mocks base method. func (m *MockClusterAdmin) DescribeUserScramCredentials(arg0 []string) ([]*sarama.DescribeUserScramCredentialsResult, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DescribeUserScramCredentials", arg0) @@ -709,13 +726,13 @@ func (m *MockClusterAdmin) DescribeUserScramCredentials(arg0 []string) ([]*saram return ret0, ret1 } -// DescribeUserScramCredentials indicates an expected call of DescribeUserScramCredentials +// DescribeUserScramCredentials indicates an expected call of DescribeUserScramCredentials. func (mr *MockClusterAdminMockRecorder) DescribeUserScramCredentials(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeUserScramCredentials", reflect.TypeOf((*MockClusterAdmin)(nil).DescribeUserScramCredentials), arg0) } -// IncrementalAlterConfig mocks base method +// IncrementalAlterConfig mocks base method. func (m *MockClusterAdmin) IncrementalAlterConfig(arg0 sarama.ConfigResourceType, arg1 string, arg2 map[string]sarama.IncrementalAlterConfigsEntry, arg3 bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IncrementalAlterConfig", arg0, arg1, arg2, arg3) @@ -723,13 +740,13 @@ func (m *MockClusterAdmin) IncrementalAlterConfig(arg0 sarama.ConfigResourceType return ret0 } -// IncrementalAlterConfig indicates an expected call of IncrementalAlterConfig +// IncrementalAlterConfig indicates an expected call of IncrementalAlterConfig. func (mr *MockClusterAdminMockRecorder) IncrementalAlterConfig(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IncrementalAlterConfig", reflect.TypeOf((*MockClusterAdmin)(nil).IncrementalAlterConfig), arg0, arg1, arg2, arg3) } -// ListAcls mocks base method +// ListAcls mocks base method. func (m *MockClusterAdmin) ListAcls(arg0 sarama.AclFilter) ([]sarama.ResourceAcls, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListAcls", arg0) @@ -738,13 +755,13 @@ func (m *MockClusterAdmin) ListAcls(arg0 sarama.AclFilter) ([]sarama.ResourceAcl return ret0, ret1 } -// ListAcls indicates an expected call of ListAcls +// ListAcls indicates an expected call of ListAcls. func (mr *MockClusterAdminMockRecorder) ListAcls(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAcls", reflect.TypeOf((*MockClusterAdmin)(nil).ListAcls), arg0) } -// ListConsumerGroupOffsets mocks base method +// ListConsumerGroupOffsets mocks base method. func (m *MockClusterAdmin) ListConsumerGroupOffsets(arg0 string, arg1 map[string][]int32) (*sarama.OffsetFetchResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListConsumerGroupOffsets", arg0, arg1) @@ -753,13 +770,13 @@ func (m *MockClusterAdmin) ListConsumerGroupOffsets(arg0 string, arg1 map[string return ret0, ret1 } -// ListConsumerGroupOffsets indicates an expected call of ListConsumerGroupOffsets +// ListConsumerGroupOffsets indicates an expected call of ListConsumerGroupOffsets. func (mr *MockClusterAdminMockRecorder) ListConsumerGroupOffsets(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListConsumerGroupOffsets", reflect.TypeOf((*MockClusterAdmin)(nil).ListConsumerGroupOffsets), arg0, arg1) } -// ListConsumerGroups mocks base method +// ListConsumerGroups mocks base method. func (m *MockClusterAdmin) ListConsumerGroups() (map[string]string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListConsumerGroups") @@ -768,13 +785,13 @@ func (m *MockClusterAdmin) ListConsumerGroups() (map[string]string, error) { return ret0, ret1 } -// ListConsumerGroups indicates an expected call of ListConsumerGroups +// ListConsumerGroups indicates an expected call of ListConsumerGroups. func (mr *MockClusterAdminMockRecorder) ListConsumerGroups() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListConsumerGroups", reflect.TypeOf((*MockClusterAdmin)(nil).ListConsumerGroups)) } -// ListPartitionReassignments mocks base method +// ListPartitionReassignments mocks base method. func (m *MockClusterAdmin) ListPartitionReassignments(arg0 string, arg1 []int32) (map[string]map[int32]*sarama.PartitionReplicaReassignmentsStatus, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListPartitionReassignments", arg0, arg1) @@ -783,13 +800,13 @@ func (m *MockClusterAdmin) ListPartitionReassignments(arg0 string, arg1 []int32) return ret0, ret1 } -// ListPartitionReassignments indicates an expected call of ListPartitionReassignments +// ListPartitionReassignments indicates an expected call of ListPartitionReassignments. func (mr *MockClusterAdminMockRecorder) ListPartitionReassignments(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPartitionReassignments", reflect.TypeOf((*MockClusterAdmin)(nil).ListPartitionReassignments), arg0, arg1) } -// ListTopics mocks base method +// ListTopics mocks base method. func (m *MockClusterAdmin) ListTopics() (map[string]sarama.TopicDetail, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListTopics") @@ -798,13 +815,13 @@ func (m *MockClusterAdmin) ListTopics() (map[string]sarama.TopicDetail, error) { return ret0, ret1 } -// ListTopics indicates an expected call of ListTopics +// ListTopics indicates an expected call of ListTopics. func (mr *MockClusterAdminMockRecorder) ListTopics() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTopics", reflect.TypeOf((*MockClusterAdmin)(nil).ListTopics)) } -// RemoveMemberFromConsumerGroup mocks base method +// RemoveMemberFromConsumerGroup mocks base method. func (m *MockClusterAdmin) RemoveMemberFromConsumerGroup(arg0 string, arg1 []string) (*sarama.LeaveGroupResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RemoveMemberFromConsumerGroup", arg0, arg1) @@ -813,13 +830,13 @@ func (m *MockClusterAdmin) RemoveMemberFromConsumerGroup(arg0 string, arg1 []str return ret0, ret1 } -// RemoveMemberFromConsumerGroup indicates an expected call of RemoveMemberFromConsumerGroup +// RemoveMemberFromConsumerGroup indicates an expected call of RemoveMemberFromConsumerGroup. func (mr *MockClusterAdminMockRecorder) RemoveMemberFromConsumerGroup(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RemoveMemberFromConsumerGroup", reflect.TypeOf((*MockClusterAdmin)(nil).RemoveMemberFromConsumerGroup), arg0, arg1) } -// UpsertUserScramCredentials mocks base method +// UpsertUserScramCredentials mocks base method. func (m *MockClusterAdmin) UpsertUserScramCredentials(arg0 []sarama.AlterUserScramCredentialsUpsert) ([]*sarama.AlterUserScramCredentialsResult, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpsertUserScramCredentials", arg0) @@ -828,7 +845,7 @@ func (m *MockClusterAdmin) UpsertUserScramCredentials(arg0 []sarama.AlterUserScr return ret0, ret1 } -// UpsertUserScramCredentials indicates an expected call of UpsertUserScramCredentials +// UpsertUserScramCredentials indicates an expected call of UpsertUserScramCredentials. func (mr *MockClusterAdminMockRecorder) UpsertUserScramCredentials(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertUserScramCredentials", reflect.TypeOf((*MockClusterAdmin)(nil).UpsertUserScramCredentials), arg0) diff --git a/mockstorage.go b/mockstorage.go index 260b6448..5eb29bee 100644 --- a/mockstorage.go +++ b/mockstorage.go @@ -5,35 +5,36 @@ package goka import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" storage "github.com/lovoo/goka/storage" - reflect "reflect" ) -// MockStorage is a mock of Storage interface +// MockStorage is a mock of Storage interface. type MockStorage struct { ctrl *gomock.Controller recorder *MockStorageMockRecorder } -// MockStorageMockRecorder is the mock recorder for MockStorage +// MockStorageMockRecorder is the mock recorder for MockStorage. type MockStorageMockRecorder struct { mock *MockStorage } -// NewMockStorage creates a new mock instance +// NewMockStorage creates a new mock instance. func NewMockStorage(ctrl *gomock.Controller) *MockStorage { mock := &MockStorage{ctrl: ctrl} mock.recorder = &MockStorageMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockStorage) EXPECT() *MockStorageMockRecorder { return m.recorder } -// Close mocks base method +// Close mocks base method. func (m *MockStorage) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -41,13 +42,13 @@ func (m *MockStorage) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockStorageMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockStorage)(nil).Close)) } -// Delete mocks base method +// Delete mocks base method. func (m *MockStorage) Delete(arg0 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delete", arg0) @@ -55,13 +56,13 @@ func (m *MockStorage) Delete(arg0 string) error { return ret0 } -// Delete indicates an expected call of Delete +// Delete indicates an expected call of Delete. func (mr *MockStorageMockRecorder) Delete(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockStorage)(nil).Delete), arg0) } -// Get mocks base method +// Get mocks base method. func (m *MockStorage) Get(arg0 string) ([]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Get", arg0) @@ -70,13 +71,13 @@ func (m *MockStorage) Get(arg0 string) ([]byte, error) { return ret0, ret1 } -// Get indicates an expected call of Get +// Get indicates an expected call of Get. func (mr *MockStorageMockRecorder) Get(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStorage)(nil).Get), arg0) } -// GetOffset mocks base method +// GetOffset mocks base method. func (m *MockStorage) GetOffset(arg0 int64) (int64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOffset", arg0) @@ -85,13 +86,13 @@ func (m *MockStorage) GetOffset(arg0 int64) (int64, error) { return ret0, ret1 } -// GetOffset indicates an expected call of GetOffset +// GetOffset indicates an expected call of GetOffset. func (mr *MockStorageMockRecorder) GetOffset(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOffset", reflect.TypeOf((*MockStorage)(nil).GetOffset), arg0) } -// Has mocks base method +// Has mocks base method. func (m *MockStorage) Has(arg0 string) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Has", arg0) @@ -100,13 +101,13 @@ func (m *MockStorage) Has(arg0 string) (bool, error) { return ret0, ret1 } -// Has indicates an expected call of Has +// Has indicates an expected call of Has. func (mr *MockStorageMockRecorder) Has(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockStorage)(nil).Has), arg0) } -// Iterator mocks base method +// Iterator mocks base method. func (m *MockStorage) Iterator() (storage.Iterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Iterator") @@ -115,13 +116,13 @@ func (m *MockStorage) Iterator() (storage.Iterator, error) { return ret0, ret1 } -// Iterator indicates an expected call of Iterator +// Iterator indicates an expected call of Iterator. func (mr *MockStorageMockRecorder) Iterator() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterator", reflect.TypeOf((*MockStorage)(nil).Iterator)) } -// IteratorWithRange mocks base method +// IteratorWithRange mocks base method. func (m *MockStorage) IteratorWithRange(arg0, arg1 []byte) (storage.Iterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IteratorWithRange", arg0, arg1) @@ -130,13 +131,13 @@ func (m *MockStorage) IteratorWithRange(arg0, arg1 []byte) (storage.Iterator, er return ret0, ret1 } -// IteratorWithRange indicates an expected call of IteratorWithRange +// IteratorWithRange indicates an expected call of IteratorWithRange. func (mr *MockStorageMockRecorder) IteratorWithRange(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IteratorWithRange", reflect.TypeOf((*MockStorage)(nil).IteratorWithRange), arg0, arg1) } -// MarkRecovered mocks base method +// MarkRecovered mocks base method. func (m *MockStorage) MarkRecovered() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "MarkRecovered") @@ -144,13 +145,13 @@ func (m *MockStorage) MarkRecovered() error { return ret0 } -// MarkRecovered indicates an expected call of MarkRecovered +// MarkRecovered indicates an expected call of MarkRecovered. func (mr *MockStorageMockRecorder) MarkRecovered() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkRecovered", reflect.TypeOf((*MockStorage)(nil).MarkRecovered)) } -// Open mocks base method +// Open mocks base method. func (m *MockStorage) Open() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Open") @@ -158,13 +159,13 @@ func (m *MockStorage) Open() error { return ret0 } -// Open indicates an expected call of Open +// Open indicates an expected call of Open. func (mr *MockStorageMockRecorder) Open() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Open", reflect.TypeOf((*MockStorage)(nil).Open)) } -// Set mocks base method +// Set mocks base method. func (m *MockStorage) Set(arg0 string, arg1 []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Set", arg0, arg1) @@ -172,13 +173,13 @@ func (m *MockStorage) Set(arg0 string, arg1 []byte) error { return ret0 } -// Set indicates an expected call of Set +// Set indicates an expected call of Set. func (mr *MockStorageMockRecorder) Set(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockStorage)(nil).Set), arg0, arg1) } -// SetOffset mocks base method +// SetOffset mocks base method. func (m *MockStorage) SetOffset(arg0 int64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SetOffset", arg0) @@ -186,7 +187,7 @@ func (m *MockStorage) SetOffset(arg0 int64) error { return ret0 } -// SetOffset indicates an expected call of SetOffset +// SetOffset indicates an expected call of SetOffset. func (mr *MockStorageMockRecorder) SetOffset(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetOffset", reflect.TypeOf((*MockStorage)(nil).SetOffset), arg0) diff --git a/options.go b/options.go index 4fba8435..b289e4e5 100644 --- a/options.go +++ b/options.go @@ -8,7 +8,7 @@ import ( "path/filepath" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/lovoo/goka/storage" ) diff --git a/partition_processor.go b/partition_processor.go index 8c1d9d4b..a4f8f7fb 100644 --- a/partition_processor.go +++ b/partition_processor.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/hashicorp/go-multierror" "github.com/lovoo/goka/multierr" ) diff --git a/partition_table.go b/partition_table.go index 6f9f04b6..2c97b460 100644 --- a/partition_table.go +++ b/partition_table.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/hashicorp/go-multierror" "github.com/lovoo/goka/multierr" "github.com/lovoo/goka/storage" diff --git a/partition_table_test.go b/partition_table_test.go index f266f7af..ac1a4fef 100644 --- a/partition_table_test.go +++ b/partition_table_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/golang/mock/gomock" "github.com/lovoo/goka/storage" "github.com/stretchr/testify/require" diff --git a/processor.go b/processor.go index 1c4c752e..db35e1f7 100644 --- a/processor.go +++ b/processor.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/hashicorp/go-multierror" "github.com/lovoo/goka/multierr" "github.com/lovoo/goka/storage" diff --git a/processor_test.go b/processor_test.go index 42a8fb06..7ec69aff 100644 --- a/processor_test.go +++ b/processor_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/golang/mock/gomock" "github.com/lovoo/goka/codec" "github.com/lovoo/goka/storage" diff --git a/producer.go b/producer.go index bc95f23e..2bf85dfd 100644 --- a/producer.go +++ b/producer.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) // Producer abstracts the kafka producer diff --git a/promise.go b/promise.go index aad2850b..e5d4c519 100644 --- a/promise.go +++ b/promise.go @@ -3,7 +3,7 @@ package goka import ( "sync" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) // Promise as in https://en.wikipedia.org/wiki/Futures_and_promises diff --git a/proxy_test.go b/proxy_test.go index be584231..90c3e7f6 100644 --- a/proxy_test.go +++ b/proxy_test.go @@ -3,7 +3,7 @@ package goka import ( "testing" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/lovoo/goka/storage" ) diff --git a/storage/storage_test.go b/storage/storage_test.go index 2eab4719..029e5b3b 100644 --- a/storage/storage_test.go +++ b/storage/storage_test.go @@ -2,7 +2,6 @@ package storage import ( "fmt" - "io/ioutil" "os" "testing" "time" @@ -140,7 +139,7 @@ func TestSetGet(t *testing.T) { hasKey bool ) - tmpdir, err := ioutil.TempDir("", "goka_storage_TestSetGet") + tmpdir, err := os.MkdirTemp("", "goka_storage_TestSetGet") require.NoError(t, err) db, err := leveldb.OpenFile(tmpdir, nil) @@ -195,7 +194,7 @@ func TestSetGet(t *testing.T) { } func TestLeveldbStorage(t *testing.T) { - path, err := ioutil.TempDir("", "goka_storage_leveldb_test") + path, err := os.MkdirTemp("", "goka_storage_leveldb_test") require.NoError(t, err) newStorage := func(delete bool, t *testing.T) Storage { diff --git a/systemtest/commit_test.go b/systemtest/commit_test.go index 6d4ef318..b7fa395b 100644 --- a/systemtest/commit_test.go +++ b/systemtest/commit_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/lovoo/goka" "github.com/lovoo/goka/codec" "github.com/stretchr/testify/require" diff --git a/systemtest/emitter_offset_test.go b/systemtest/emitter_offset_test.go index 3bda8fae..4f232396 100644 --- a/systemtest/emitter_offset_test.go +++ b/systemtest/emitter_offset_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/lovoo/goka" "github.com/lovoo/goka/codec" "github.com/stretchr/testify/require" diff --git a/systemtest/processor_test.go b/systemtest/processor_test.go index 13baa7f2..c6abd702 100644 --- a/systemtest/processor_test.go +++ b/systemtest/processor_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/lovoo/goka" "github.com/lovoo/goka/codec" "github.com/lovoo/goka/multierr" @@ -609,7 +609,6 @@ func TestProcessorSlowStuck(t *testing.T) { // * Emit 10 messages with key/value "1"/1 into one topic // * Create a processor that consumes+accumulates this one value into its state. The final state obviously is 10. // * restart this processor a couple of times and check whether it stays 10. -// func TestMessageCommit(t *testing.T) { brokers := initSystemTest(t) diff --git a/systemtest/topicmanager_test.go b/systemtest/topicmanager_test.go index 7b8c7f93..03ce7ad5 100644 --- a/systemtest/topicmanager_test.go +++ b/systemtest/topicmanager_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/lovoo/goka" "github.com/stretchr/testify/require" ) diff --git a/tester/consumer.go b/tester/consumer.go index fff3b7fa..4da66a47 100644 --- a/tester/consumer.go +++ b/tester/consumer.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) type consumerMock struct { diff --git a/tester/consumergroup.go b/tester/consumergroup.go index 3ae08b87..b90ba966 100644 --- a/tester/consumergroup.go +++ b/tester/consumergroup.go @@ -6,7 +6,7 @@ import ( "sync" "sync/atomic" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/hashicorp/go-multierror" "github.com/lovoo/goka" "github.com/lovoo/goka/multierr" diff --git a/tester/tester.go b/tester/tester.go index 867b4832..c13a1369 100644 --- a/tester/tester.go +++ b/tester/tester.go @@ -9,7 +9,7 @@ import ( "github.com/lovoo/goka" "github.com/lovoo/goka/storage" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) type emitOption struct { diff --git a/tester/topic_manager.go b/tester/topic_manager.go index e7b26121..6d96305d 100644 --- a/tester/topic_manager.go +++ b/tester/topic_manager.go @@ -3,7 +3,7 @@ package tester import ( "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) // MockTopicManager mimicks the behavior of the real topic manager diff --git a/topic_manager.go b/topic_manager.go index 1966c473..353664f9 100644 --- a/topic_manager.go +++ b/topic_manager.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) // TopicManager provides an interface to create/check topics and their partitions diff --git a/topic_manager_test.go b/topic_manager_test.go index bdb38c37..e6c3541d 100644 --- a/topic_manager_test.go +++ b/topic_manager_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" ) diff --git a/view.go b/view.go index 72292b6b..d76b3b3a 100644 --- a/view.go +++ b/view.go @@ -6,7 +6,7 @@ import ( "fmt" "sync" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/hashicorp/go-multierror" "github.com/lovoo/goka/multierr" "github.com/lovoo/goka/storage" @@ -223,7 +223,9 @@ func (v *View) runStateMerger(ctx context.Context) { // // The view will shutdown in case of errors or when the context is closed. // It can be initialized with autoreconnect -// view := NewView(..., WithViewAutoReconnect()) +// +// view := NewView(..., WithViewAutoReconnect()) +// // which makes the view internally reconnect in case of errors. // Then it will only stop by canceling the context (see example). func (v *View) Run(ctx context.Context) (rerr error) { @@ -459,20 +461,20 @@ func (v *View) CurrentState() ViewState { // // Example // -// view := goka.NewView(...) -// go view.Run(ctx) +// view := goka.NewView(...) +// go view.Run(ctx) // -// go func(){ -// obs := view.ObserveStateChanges() -// defer obs.Stop() -// for { -// select{ -// case state, ok := <-obs.C: -// // handle state (or closed channel) -// case <-ctx.Done(): -// } -// } -// }() +// go func(){ +// obs := view.ObserveStateChanges() +// defer obs.Stop() +// for { +// select{ +// case state, ok := <-obs.C: +// // handle state (or closed channel) +// case <-ctx.Done(): +// } +// } +// }() func (v *View) ObserveStateChanges() *StateChangeObserver { return v.state.ObserveStateChange() } diff --git a/view_test.go b/view_test.go index 2de3f81f..df4c5085 100644 --- a/view_test.go +++ b/view_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/golang/mock/gomock" "github.com/lovoo/goka/codec" "github.com/lovoo/goka/storage"