From 11a708ac826b62a95c50be881363e71abb9d1d9b Mon Sep 17 00:00:00 2001 From: stewartboyd119 Date: Thu, 17 Oct 2024 11:31:01 -0700 Subject: [PATCH] Updated to v2 --- README.md | 8 ++++---- changelog.md | 4 ++++ client.go | 2 +- client_test.go | 2 +- example/producer/main.go | 2 +- example/producer_avro/go.mod | 6 +++--- example/producer_avro/main.go | 2 +- example/worker-deadletter/main.go | 2 +- example/worker-delay/main.go | 2 +- example/worker/main.go | 2 +- example/worker_avro/go.mod | 6 +++--- example/worker_avro/main.go | 2 +- go.mod | 2 +- mocks/confluent/kafka_consumer.go | 2 +- mocks/confluent/kafka_producer.go | 2 +- mocks/kreader.go | 2 +- mocks/kwriter.go | 2 +- mocks/mock_client.go | 2 +- mocks/mock_reader.go | 2 +- mocks/mock_writer.go | 2 +- reader_test.go | 2 +- test/integration_test.go | 2 +- test/schema_registry_evo_test.go | 14 +++++++------- test/schema_registry_test.go | 10 +++++----- test/worker_test.go | 4 ++-- test/writer_test.go | 4 ++-- work_test.go | 2 +- writer_test.go | 2 +- 28 files changed, 50 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index b2a2901..c3e6f9b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # zkafka -[![License](https://img.shields.io/github/license/zillow/zkafka)](https://github.com/zillow/zkafka/blob/main/LICENSE) -[![GitHub Actions](https://github.com/zillow/zkafka/actions/workflows/go.yml/badge.svg)](https://github.com/zillow/zkafka/actions/workflows/go.yml) +[![License](https://img.shields.io/github/license/zillow/zkafka)](https://github.com/zillow/zkafka/v2/blob/main/LICENSE) +[![GitHub Actions](https://github.com/zillow/zkafka/v2/actions/workflows/go.yml/badge.svg)](https://github.com/zillow/zkafka/v2/actions/workflows/go.yml) [![Codecov](https://codecov.io/gh/zillow/zkafka/branch/main/graph/badge.svg?token=STRT8T67YP)](https://codecov.io/gh/zillow/zkafka) -[![Go Report Card](https://goreportcard.com/badge/github.com/zillow/zkafka)](https://goreportcard.com/report/github.com/zillow/zkafka) +[![Go Report Card](https://goreportcard.com/badge/github.com/zillow/zkafka/v2)](https://goreportcard.com/report/github.com/zillow/zkafka/v2) ## Install -`go get -u github.com/zillow/zkafka` +`go get -u github.com/zillow/zkafka/v2` ## About diff --git a/changelog.md b/changelog.md index 1936597..3faa0a7 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning. +## 2.0.0 (October 17, 2024) + +1. Removed dependency on github.com/golang/mock (deprecated) in favor of github.com/uber-go/mock + ## 1.3.0 (Sep 25, 2024) 1. Added `WithDisableCircuitBreaker` and `WithDisableBusyLoopBreaker` options. These are variants of the now deprecated `DisableCircuitBreaker` diff --git a/client.go b/client.go index 6e44ee9..cc5548e 100644 --- a/client.go +++ b/client.go @@ -22,7 +22,7 @@ type ClientProvider interface { // static type checking for the convenient Writer interface var _ ClientProvider = (*Client)(nil) -const instrumentationName = "github.com/zillow/zkafka" +const instrumentationName = "github.com/zillow/zkafka/v2" // Client helps instantiate usable readers and writers type Client struct { diff --git a/client_test.go b/client_test.go index 1a28950..2f288ab 100644 --- a/client_test.go +++ b/client_test.go @@ -14,7 +14,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" "github.com/zillow/zfmt" - mock_confluent "github.com/zillow/zkafka/mocks/confluent" + mock_confluent "github.com/zillow/zkafka/v2/mocks/confluent" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/noop" diff --git a/example/producer/main.go b/example/producer/main.go index 94cfe77..87fab8a 100644 --- a/example/producer/main.go +++ b/example/producer/main.go @@ -7,7 +7,7 @@ import ( "time" "github.com/zillow/zfmt" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) func main() { diff --git a/example/producer_avro/go.mod b/example/producer_avro/go.mod index 7e0b337..47f1a38 100644 --- a/example/producer_avro/go.mod +++ b/example/producer_avro/go.mod @@ -1,10 +1,10 @@ -module github.com/zillow/zkafka/example/producer_avro +module github.com/zillow/zkafka/v2/example/producer_avro go 1.23.1 -replace github.com/zillow/zkafka v1.0.0 => ../.. +replace github.com/zillow/zkafka/v2 v1.0.0 => ../.. -require github.com/zillow/zkafka v1.0.0 +require github.com/zillow/zkafka/v2 v1.0.0 require ( github.com/actgardner/gogen-avro/v10 v10.2.1 // indirect diff --git a/example/producer_avro/main.go b/example/producer_avro/main.go index 219b53f..891fb87 100644 --- a/example/producer_avro/main.go +++ b/example/producer_avro/main.go @@ -7,7 +7,7 @@ import ( "math/rand" "time" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) //go:embed event.avsc diff --git a/example/worker-deadletter/main.go b/example/worker-deadletter/main.go index 697eebc..8dd6ba1 100644 --- a/example/worker-deadletter/main.go +++ b/example/worker-deadletter/main.go @@ -10,7 +10,7 @@ import ( "syscall" "time" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) // Demonstrates reading from a topic via the zkafka.Work struct which is more convenient, typically, than using the consumer directly diff --git a/example/worker-delay/main.go b/example/worker-delay/main.go index 4725233..73a01bc 100644 --- a/example/worker-delay/main.go +++ b/example/worker-delay/main.go @@ -8,7 +8,7 @@ import ( "syscall" "time" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) // Demonstrates reading from a topic via the zkafka.Work struct which is more convenient, typically, than using the consumer directly diff --git a/example/worker/main.go b/example/worker/main.go index f505582..1d51f4c 100644 --- a/example/worker/main.go +++ b/example/worker/main.go @@ -9,7 +9,7 @@ import ( "time" "github.com/zillow/zfmt" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) // Demonstrates reading from a topic via the zkafka.Work struct which is more convenient, typically, than using the consumer directly diff --git a/example/worker_avro/go.mod b/example/worker_avro/go.mod index ca246bd..ec092ee 100644 --- a/example/worker_avro/go.mod +++ b/example/worker_avro/go.mod @@ -1,12 +1,12 @@ -module github.com/zillow/zkafka/example/worker_avro +module github.com/zillow/zkafka/v2/example/worker_avro go 1.23.1 -replace github.com/zillow/zkafka v1.0.0 => ../.. +replace github.com/zillow/zkafka/v2 v1.0.0 => ../.. require ( github.com/google/uuid v1.6.0 - github.com/zillow/zkafka v1.0.0 + github.com/zillow/zkafka/v2 v1.0.0 ) require ( diff --git a/example/worker_avro/main.go b/example/worker_avro/main.go index 8050c49..8abc1ee 100644 --- a/example/worker_avro/main.go +++ b/example/worker_avro/main.go @@ -10,7 +10,7 @@ import ( "time" "github.com/google/uuid" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) //go:embed event.avsc diff --git a/go.mod b/go.mod index 577618b..8681f10 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/zillow/zkafka +module github.com/zillow/zkafka/v2 go 1.23 diff --git a/mocks/confluent/kafka_consumer.go b/mocks/confluent/kafka_consumer.go index ef2fc83..24aa51f 100644 --- a/mocks/confluent/kafka_consumer.go +++ b/mocks/confluent/kafka_consumer.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/zillow/zkafka (interfaces: KafkaConsumer) +// Source: github.com/zillow/zkafka/v2 (interfaces: KafkaConsumer) // // Generated by this command: // diff --git a/mocks/confluent/kafka_producer.go b/mocks/confluent/kafka_producer.go index e8156a2..bf2da87 100644 --- a/mocks/confluent/kafka_producer.go +++ b/mocks/confluent/kafka_producer.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/zillow/zkafka (interfaces: KafkaProducer) +// Source: github.com/zillow/zkafka/v2 (interfaces: KafkaProducer) // // Generated by this command: // diff --git a/mocks/kreader.go b/mocks/kreader.go index 70d7cc4..4e98256 100644 --- a/mocks/kreader.go +++ b/mocks/kreader.go @@ -5,7 +5,7 @@ package mock_zkafka import ( "context" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) var ( diff --git a/mocks/kwriter.go b/mocks/kwriter.go index 6dc2dc1..ec06ec7 100644 --- a/mocks/kwriter.go +++ b/mocks/kwriter.go @@ -5,7 +5,7 @@ package mock_zkafka import ( "context" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" ) var ( diff --git a/mocks/mock_client.go b/mocks/mock_client.go index 398224b..4bc1f4b 100644 --- a/mocks/mock_client.go +++ b/mocks/mock_client.go @@ -13,7 +13,7 @@ import ( context "context" reflect "reflect" - zkafka "github.com/zillow/zkafka" + zkafka "github.com/zillow/zkafka/v2" gomock "go.uber.org/mock/gomock" ) diff --git a/mocks/mock_reader.go b/mocks/mock_reader.go index 876cdc7..8f5885f 100644 --- a/mocks/mock_reader.go +++ b/mocks/mock_reader.go @@ -13,7 +13,7 @@ import ( context "context" reflect "reflect" - zkafka "github.com/zillow/zkafka" + zkafka "github.com/zillow/zkafka/v2" gomock "go.uber.org/mock/gomock" ) diff --git a/mocks/mock_writer.go b/mocks/mock_writer.go index 85c9c52..7f3fd00 100644 --- a/mocks/mock_writer.go +++ b/mocks/mock_writer.go @@ -13,7 +13,7 @@ import ( context "context" reflect "reflect" - zkafka "github.com/zillow/zkafka" + zkafka "github.com/zillow/zkafka/v2" gomock "go.uber.org/mock/gomock" ) diff --git a/reader_test.go b/reader_test.go index 182c812..66b3efb 100644 --- a/reader_test.go +++ b/reader_test.go @@ -9,7 +9,7 @@ import ( "github.com/confluentinc/confluent-kafka-go/v2/kafka" "github.com/stretchr/testify/require" - mock_confluent "github.com/zillow/zkafka/mocks/confluent" + mock_confluent "github.com/zillow/zkafka/v2/mocks/confluent" "github.com/zillow/zfmt" "go.uber.org/mock/gomock" diff --git a/test/integration_test.go b/test/integration_test.go index 40552f4..081c13f 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" "github.com/zillow/zfmt" - "github.com/zillow/zkafka" + "github.com/zillow/zkafka/v2" "golang.org/x/sync/errgroup" ) diff --git a/test/schema_registry_evo_test.go b/test/schema_registry_evo_test.go index 7252ab2..28d2d9d 100644 --- a/test/schema_registry_evo_test.go +++ b/test/schema_registry_evo_test.go @@ -17,13 +17,13 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/zillow/zkafka" - "github.com/zillow/zkafka/test/evolution/avro1" - "github.com/zillow/zkafka/test/evolution/avro2" - "github.com/zillow/zkafka/test/evolution/json1" - "github.com/zillow/zkafka/test/evolution/json2" - "github.com/zillow/zkafka/test/evolution/proto1" - "github.com/zillow/zkafka/test/evolution/proto2" + "github.com/zillow/zkafka/v2" + "github.com/zillow/zkafka/v2/test/evolution/avro1" + "github.com/zillow/zkafka/v2/test/evolution/avro2" + "github.com/zillow/zkafka/v2/test/evolution/json1" + "github.com/zillow/zkafka/v2/test/evolution/json2" + "github.com/zillow/zkafka/v2/test/evolution/proto1" + "github.com/zillow/zkafka/v2/test/evolution/proto2" ) // Test_SchemaRegistryReal_Avro_AutoRegisterSchemas_BackwardCompatibleSchemasCanBeRegisteredAndReadFrom tests diff --git a/test/schema_registry_test.go b/test/schema_registry_test.go index d04f433..5033995 100644 --- a/test/schema_registry_test.go +++ b/test/schema_registry_test.go @@ -13,11 +13,11 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" "github.com/zillow/zfmt" - "github.com/zillow/zkafka" - "github.com/zillow/zkafka/test/evolution/avro1" - avro1x "github.com/zillow/zkafka/test/evolution/avro1x" - "github.com/zillow/zkafka/test/evolution/json1" - "github.com/zillow/zkafka/test/evolution/proto1" + "github.com/zillow/zkafka/v2" + "github.com/zillow/zkafka/v2/test/evolution/avro1" + avro1x "github.com/zillow/zkafka/v2/test/evolution/avro1x" + "github.com/zillow/zkafka/v2/test/evolution/json1" + "github.com/zillow/zkafka/v2/test/evolution/proto1" ) //go:embed evolution/schema_1.avsc diff --git a/test/worker_test.go b/test/worker_test.go index 2c13a32..3d6de43 100644 --- a/test/worker_test.go +++ b/test/worker_test.go @@ -16,8 +16,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" "github.com/zillow/zfmt" - "github.com/zillow/zkafka" - zkafka_mocks "github.com/zillow/zkafka/mocks" + "github.com/zillow/zkafka/v2" + zkafka_mocks "github.com/zillow/zkafka/v2/mocks" "golang.org/x/sync/errgroup" "go.uber.org/mock/gomock" diff --git a/test/writer_test.go b/test/writer_test.go index 7d9ed50..722b80c 100644 --- a/test/writer_test.go +++ b/test/writer_test.go @@ -11,8 +11,8 @@ import ( "github.com/confluentinc/confluent-kafka-go/v2/kafka" "github.com/stretchr/testify/require" "github.com/zillow/zfmt" - "github.com/zillow/zkafka" - mock_confluent "github.com/zillow/zkafka/mocks/confluent" + "github.com/zillow/zkafka/v2" + mock_confluent "github.com/zillow/zkafka/v2/mocks/confluent" "go.uber.org/mock/gomock" ) diff --git a/work_test.go b/work_test.go index 153c76a..70b1996 100644 --- a/work_test.go +++ b/work_test.go @@ -18,7 +18,7 @@ import ( "go.opentelemetry.io/otel/trace/noop" "github.com/confluentinc/confluent-kafka-go/v2/kafka" - mock_confluent "github.com/zillow/zkafka/mocks/confluent" + mock_confluent "github.com/zillow/zkafka/v2/mocks/confluent" "go.uber.org/mock/gomock" ) diff --git a/writer_test.go b/writer_test.go index f384fa1..48f41c5 100644 --- a/writer_test.go +++ b/writer_test.go @@ -9,7 +9,7 @@ import ( "github.com/confluentinc/confluent-kafka-go/v2/kafka" "github.com/stretchr/testify/require" "github.com/zillow/zfmt" - mock_confluent "github.com/zillow/zkafka/mocks/confluent" + mock_confluent "github.com/zillow/zkafka/v2/mocks/confluent" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace/noop"