From b4c60c05956311e778b3d72d6920599b74aa55e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E5=B0=8F=E9=BE=99?= Date: Wed, 15 May 2019 13:58:38 +0800 Subject: [PATCH] add go mod for pulsar-client-go (#4) Signed-off-by: xiaolong.ran --- go.mod | 18 +++++++++++++ go.sum | 36 ++++++++++++++++++++++++++ perf/perf-consumer.go | 2 +- perf/perf-producer.go | 3 ++- pulsar/client.go | 2 +- pulsar/impl_client.go | 6 ++--- pulsar/impl_message.go | 2 +- pulsar/impl_partition_producer.go | 6 ++--- pulsar/impl_producer.go | 2 +- pulsar/internal/auth/disabled.go | 3 +-- pulsar/internal/auth/provider.go | 9 ++++--- pulsar/internal/batch_builder.go | 4 +-- pulsar/internal/commands.go | 3 ++- pulsar/internal/compression/noop.go | 3 +-- pulsar/internal/compression/zlib.go | 3 +-- pulsar/internal/compression/zstd.go | 3 +-- pulsar/internal/connection.go | 4 +-- pulsar/internal/connection_pool.go | 2 +- pulsar/internal/connection_reader.go | 2 +- pulsar/internal/lookup_service.go | 2 +- pulsar/internal/lookup_service_test.go | 2 +- pulsar/internal/rpc_client.go | 2 +- pulsar/producer_test.go | 2 +- 23 files changed, 87 insertions(+), 34 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000000000..2433c968cf867 --- /dev/null +++ b/go.mod @@ -0,0 +1,18 @@ +module github.com/apache/pulsar-client-go + +go 1.12 + +require ( + github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6 + github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b + github.com/golang/protobuf v1.3.1 + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/pierrec/lz4 v2.0.5+incompatible + github.com/pkg/errors v0.8.1 + github.com/sirupsen/logrus v1.4.1 + github.com/spaolacci/murmur3 v1.1.0 + github.com/spf13/cobra v0.0.3 + github.com/spf13/pflag v1.0.3 // indirect + github.com/stretchr/testify v1.3.0 + github.com/valyala/gozstd v1.4.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000000000..0fc836c7429d8 --- /dev/null +++ b/go.sum @@ -0,0 +1,36 @@ +github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6 h1:KXlsf+qt/X5ttPGEjR0tPH1xaWWoKBEg9Q1THAj2h3I= +github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA= +github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b h1:AP/Y7sqYicnjGDfD5VcY4CIfh1hRXBUavxrvELjTiOE= +github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/valyala/gozstd v1.4.1 h1:3/+pPStlV5Py2TsGhzNUItnYgX2yaX2tHMw/32c/0dM= +github.com/valyala/gozstd v1.4.1/go.mod h1:oYOS+oJovjw9ewtrwEYb9+ybolEXd6pHyLMuAWN5zts= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/perf/perf-consumer.go b/perf/perf-consumer.go index ee315ba6fd9cf..9866519bb9f80 100644 --- a/perf/perf-consumer.go +++ b/perf/perf-consumer.go @@ -22,7 +22,7 @@ package main import ( "context" "encoding/json" - "pulsar-client-go/pulsar" + "github.com/apache/pulsar-client-go/pulsar" "github.com/spf13/cobra" log "github.com/sirupsen/logrus" "sync/atomic" diff --git a/perf/perf-producer.go b/perf/perf-producer.go index e8fd76fb60ddc..94777302bb4e5 100644 --- a/perf/perf-producer.go +++ b/perf/perf-producer.go @@ -22,11 +22,12 @@ package main import ( "context" "encoding/json" + `github.com/Anankke/bilibili-backup/library/net/http/blademaster/middleware/rate` "github.com/beefsack/go-rate" "github.com/bmizerany/perks/quantile" "github.com/spf13/cobra" log "github.com/sirupsen/logrus" - "pulsar-client-go/pulsar" + "github.com/apache/pulsar-client-go/pulsar" "time" ) diff --git a/pulsar/client.go b/pulsar/client.go index 0225a8334a57b..8c48cdf558098 100644 --- a/pulsar/client.go +++ b/pulsar/client.go @@ -20,7 +20,7 @@ package pulsar import ( - "pulsar-client-go/pulsar/internal/auth" + "github.com/apache/pulsar-client-go/pulsar/internal/auth" "time" ) diff --git a/pulsar/impl_client.go b/pulsar/impl_client.go index a952efcb8f868..ddcb51f56d7c9 100644 --- a/pulsar/impl_client.go +++ b/pulsar/impl_client.go @@ -24,9 +24,9 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" "net/url" - "pulsar-client-go/pulsar/internal" - "pulsar-client-go/pulsar/internal/auth" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + "github.com/apache/pulsar-client-go/pulsar/internal" + "github.com/apache/pulsar-client-go/pulsar/internal/auth" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" ) type client struct { diff --git a/pulsar/impl_message.go b/pulsar/impl_message.go index b73445f42ed3c..3300913e28769 100644 --- a/pulsar/impl_message.go +++ b/pulsar/impl_message.go @@ -21,7 +21,7 @@ package pulsar import ( "github.com/golang/protobuf/proto" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" ) type messageId struct { diff --git a/pulsar/impl_partition_producer.go b/pulsar/impl_partition_producer.go index 0e38fa6c46e0a..ae3a8d6b28660 100644 --- a/pulsar/impl_partition_producer.go +++ b/pulsar/impl_partition_producer.go @@ -23,9 +23,9 @@ import ( "context" "github.com/golang/protobuf/proto" log "github.com/sirupsen/logrus" - "pulsar-client-go/pulsar/internal" - "pulsar-client-go/pulsar/internal/util" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + "github.com/apache/pulsar-client-go/pulsar/internal" + "github.com/apache/pulsar-client-go/pulsar/internal/util" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" "sync" "sync/atomic" "time" diff --git a/pulsar/impl_producer.go b/pulsar/impl_producer.go index afe8b3a808643..b8cd7152cec3a 100644 --- a/pulsar/impl_producer.go +++ b/pulsar/impl_producer.go @@ -21,7 +21,7 @@ package pulsar import ( "context" - "pulsar-client-go/pulsar/internal" + "github.com/apache/pulsar-client-go/pulsar/internal" ) type producer struct { diff --git a/pulsar/internal/auth/disabled.go b/pulsar/internal/auth/disabled.go index 7d8bbf76121ce..989b1a91c022b 100644 --- a/pulsar/internal/auth/disabled.go +++ b/pulsar/internal/auth/disabled.go @@ -21,8 +21,7 @@ package auth import "crypto/tls" -type disabled struct { -} +type disabled struct {} func NewAuthDisabled() Provider { return &disabled{} diff --git a/pulsar/internal/auth/provider.go b/pulsar/internal/auth/provider.go index 48c20dc3c9af9..3f2df9a6abe4e 100644 --- a/pulsar/internal/auth/provider.go +++ b/pulsar/internal/auth/provider.go @@ -20,10 +20,11 @@ package auth import ( - "crypto/tls" - "fmt" - "github.com/pkg/errors" - "io" + "crypto/tls" + "fmt" + "io" + + "github.com/pkg/errors" ) type Provider interface { diff --git a/pulsar/internal/batch_builder.go b/pulsar/internal/batch_builder.go index 5c18850d83eab..4421c61123ccc 100644 --- a/pulsar/internal/batch_builder.go +++ b/pulsar/internal/batch_builder.go @@ -22,8 +22,8 @@ package internal import ( "github.com/golang/protobuf/proto" log "github.com/sirupsen/logrus" - "pulsar-client-go/pulsar/internal/compression" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + "github.com/apache/pulsar-client-go/pulsar/internal/compression" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" "time" ) diff --git a/pulsar/internal/commands.go b/pulsar/internal/commands.go index b375817815371..3f75e1b975d00 100644 --- a/pulsar/internal/commands.go +++ b/pulsar/internal/commands.go @@ -21,8 +21,9 @@ package internal import ( "github.com/golang/protobuf/proto" + + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" log "github.com/sirupsen/logrus" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" ) const MaxFrameSize = 5 * 1024 * 1024 diff --git a/pulsar/internal/compression/noop.go b/pulsar/internal/compression/noop.go index 533ab2c33fbce..c8068625401eb 100644 --- a/pulsar/internal/compression/noop.go +++ b/pulsar/internal/compression/noop.go @@ -19,8 +19,7 @@ package compression -type noopProvider struct { -} +type noopProvider struct {} func NewNoopProvider() Provider { return &noopProvider{} diff --git a/pulsar/internal/compression/zlib.go b/pulsar/internal/compression/zlib.go index 1646bc50eee24..692a29a6c2c8e 100644 --- a/pulsar/internal/compression/zlib.go +++ b/pulsar/internal/compression/zlib.go @@ -24,8 +24,7 @@ import ( "compress/zlib" ) -type zlibProvider struct { -} +type zlibProvider struct {} func NewZLibProvider() Provider { return &zlibProvider{} diff --git a/pulsar/internal/compression/zstd.go b/pulsar/internal/compression/zstd.go index ffad2bc3f27ce..8d52e9e6d1911 100644 --- a/pulsar/internal/compression/zstd.go +++ b/pulsar/internal/compression/zstd.go @@ -23,8 +23,7 @@ import ( zstd "github.com/valyala/gozstd" ) -type zstdProvider struct { -} +type zstdProvider struct {} func NewZStdProvider() Provider { return &zstdProvider{} diff --git a/pulsar/internal/connection.go b/pulsar/internal/connection.go index 07b1d681595c7..bc2dcf1afdbad 100644 --- a/pulsar/internal/connection.go +++ b/pulsar/internal/connection.go @@ -28,8 +28,8 @@ import ( "io/ioutil" "net" "net/url" - "pulsar-client-go/pulsar/internal/auth" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + "github.com/apache/pulsar-client-go/pulsar/internal/auth" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" "sync" "sync/atomic" "time" diff --git a/pulsar/internal/connection_pool.go b/pulsar/internal/connection_pool.go index b8cdd0fb08cd5..88146acce14e6 100644 --- a/pulsar/internal/connection_pool.go +++ b/pulsar/internal/connection_pool.go @@ -22,7 +22,7 @@ package internal import ( log "github.com/sirupsen/logrus" "net/url" - "pulsar-client-go/pulsar/internal/auth" + "github.com/apache/pulsar-client-go/pulsar/internal/auth" "sync" ) diff --git a/pulsar/internal/connection_reader.go b/pulsar/internal/connection_reader.go index 836d7ce09cc32..347fad6bb4d46 100644 --- a/pulsar/internal/connection_reader.go +++ b/pulsar/internal/connection_reader.go @@ -24,7 +24,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/pkg/errors" "io" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" ) type connectionReader struct { diff --git a/pulsar/internal/lookup_service.go b/pulsar/internal/lookup_service.go index 1ec8841761d12..52c162dc27cd8 100644 --- a/pulsar/internal/lookup_service.go +++ b/pulsar/internal/lookup_service.go @@ -25,7 +25,7 @@ import ( "github.com/golang/protobuf/proto" log "github.com/sirupsen/logrus" "net/url" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" ) type LookupResult struct { diff --git a/pulsar/internal/lookup_service_test.go b/pulsar/internal/lookup_service_test.go index 7e0d14837b70a..b7facaa8187a9 100644 --- a/pulsar/internal/lookup_service_test.go +++ b/pulsar/internal/lookup_service_test.go @@ -23,7 +23,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "net/url" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" "testing" ) diff --git a/pulsar/internal/rpc_client.go b/pulsar/internal/rpc_client.go index 2281deff9d62f..4a5d72fd9e31e 100644 --- a/pulsar/internal/rpc_client.go +++ b/pulsar/internal/rpc_client.go @@ -22,7 +22,7 @@ package internal import ( "github.com/golang/protobuf/proto" "net/url" - pb "pulsar-client-go/pulsar/internal/pulsar_proto" + pb "github.com/apache/pulsar-client-go/pulsar/internal/pulsar_proto" "sync" "sync/atomic" ) diff --git a/pulsar/producer_test.go b/pulsar/producer_test.go index 5d781a308f0a3..bb188ce2f75d4 100644 --- a/pulsar/producer_test.go +++ b/pulsar/producer_test.go @@ -23,7 +23,7 @@ import ( "context" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "pulsar-client-go/pulsar/internal/util" + "github.com/apache/pulsar-client-go/pulsar/internal/util" "sync" "testing" "time"