From 454d7c29392cf79fabfee463d4d5db01197021b9 Mon Sep 17 00:00:00 2001 From: Wei Han Date: Fri, 16 Jun 2017 22:17:45 -0700 Subject: [PATCH] Logrus package change fix --- client/cherami/authprovider.go | 2 +- client/cherami/basePublisher.go | 18 +++++------ client/cherami/client.go | 12 +++---- client/cherami/client_test.go | 2 +- client/cherami/connection_test.go | 2 +- client/cherami/delivery_test.go | 2 +- client/cherami/outputhostconnection_test.go | 2 +- client/cherami/reconfigurable.go | 2 +- client/cherami/tchanPublisher.go | 10 +++--- client/cherami/tchanPublisher_test.go | 2 +- client/cherami/wsconnector.go | 2 +- common/util.go | 2 +- common/websocket/base_test.go | 2 +- common/websocket/serverclient_test.go | 2 +- common/websocket/stream.go | 2 +- common/websocket/stream_test.go | 2 +- example.go | 6 ++-- glide.lock | 34 ++++++++++++-------- glide.yaml | 2 +- mocks/clients/cherami/MockTChanBInClient.go | 2 +- mocks/clients/cherami/MockTChanBOutClient.go | 2 +- 21 files changed, 59 insertions(+), 53 deletions(-) diff --git a/client/cherami/authprovider.go b/client/cherami/authprovider.go index df91da8..742931b 100644 --- a/client/cherami/authprovider.go +++ b/client/cherami/authprovider.go @@ -32,7 +32,7 @@ type ( } // BypassAuthProvider is a dummy implementation for AuthProvider - BypassAuthProvider struct {} + BypassAuthProvider struct{} ) // NewBypassAuthProvider creates a dummy AuthProvider instance diff --git a/client/cherami/basePublisher.go b/client/cherami/basePublisher.go index 4235d49..2ea3846 100644 --- a/client/cherami/basePublisher.go +++ b/client/cherami/basePublisher.go @@ -30,10 +30,10 @@ import ( "github.com/uber-common/bark" - "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/uber/cherami-client-go/common" "github.com/uber/cherami-client-go/common/backoff" "github.com/uber/cherami-client-go/common/metrics" + "github.com/uber/cherami-thrift/.generated/go/cherami" ) type ( @@ -41,14 +41,14 @@ type ( // common to all types of Publisher // implementations basePublisher struct { - idCounter int64 - path string - client Client - logger bark.Logger - reporter metrics.Reporter - retryPolicy backoff.RetryPolicy - checksumOption cherami.ChecksumOption - reconfigurationPollingInterval time.Duration + idCounter int64 + path string + client Client + logger bark.Logger + reporter metrics.Reporter + retryPolicy backoff.RetryPolicy + checksumOption cherami.ChecksumOption + reconfigurationPollingInterval time.Duration } // publishError represents a message publishing error diff --git a/client/cherami/client.go b/client/cherami/client.go index 7850a4c..cb9568c 100644 --- a/client/cherami/client.go +++ b/client/cherami/client.go @@ -32,8 +32,8 @@ import ( "github.com/uber/cherami-client-go/common/metrics" "github.com/uber/cherami-thrift/.generated/go/cherami" - log "github.com/Sirupsen/logrus" "github.com/pborman/uuid" + log "github.com/sirupsen/logrus" "github.com/uber-common/bark" "github.com/uber/tchannel-go" "github.com/uber/tchannel-go/thrift" @@ -357,9 +357,9 @@ func getDefaultLogger() bark.Logger { func getDefaultOptions() *ClientOptions { return &ClientOptions{ - Timeout: time.Minute, - Logger: getDefaultLogger(), - MetricsReporter: metrics.NewNullReporter(), + Timeout: time.Minute, + Logger: getDefaultLogger(), + MetricsReporter: metrics.NewNullReporter(), ReconfigurationPollingInterval: defaultReconfigurationPollingInterval, } } @@ -367,7 +367,7 @@ func getDefaultOptions() *ClientOptions { // verifyOptions is used to verify if we have a metrics reporter and // a logger. If not, just setup a default logger and a null reporter // it also validate the timeout is sane -func verifyOptions(opts *ClientOptions) (*ClientOptions, error){ +func verifyOptions(opts *ClientOptions) (*ClientOptions, error) { if opts == nil { opts = getDefaultOptions() } @@ -417,4 +417,4 @@ func isTransientError(err error) bool { func getMetricTagValueForPath(path string) string { return strings.Replace(path, "/", "_", -1) -} \ No newline at end of file +} diff --git a/client/cherami/client_test.go b/client/cherami/client_test.go index 7421c0a..8e25532 100644 --- a/client/cherami/client_test.go +++ b/client/cherami/client_test.go @@ -26,7 +26,7 @@ import ( "github.com/uber/cherami-client-go/common/metrics" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/client/cherami/connection_test.go b/client/cherami/connection_test.go index 31b53e9..6635055 100644 --- a/client/cherami/connection_test.go +++ b/client/cherami/connection_test.go @@ -35,7 +35,7 @@ import ( mc "github.com/uber/cherami-client-go/mocks/clients/cherami" "github.com/uber/cherami-thrift/.generated/go/cherami" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/client/cherami/delivery_test.go b/client/cherami/delivery_test.go index bdcae9f..d93e510 100644 --- a/client/cherami/delivery_test.go +++ b/client/cherami/delivery_test.go @@ -27,8 +27,8 @@ import ( "github.com/stretchr/testify/suite" - "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/uber/cherami-client-go/common" + "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/stretchr/testify/require" ) diff --git a/client/cherami/outputhostconnection_test.go b/client/cherami/outputhostconnection_test.go index fdefb12..ba6f842 100644 --- a/client/cherami/outputhostconnection_test.go +++ b/client/cherami/outputhostconnection_test.go @@ -36,7 +36,7 @@ import ( mc "github.com/uber/cherami-client-go/mocks/clients/cherami" "github.com/uber/cherami-thrift/.generated/go/cherami" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/uber-common/bark" diff --git a/client/cherami/reconfigurable.go b/client/cherami/reconfigurable.go index 90c4d2c..b3a03a3 100644 --- a/client/cherami/reconfigurable.go +++ b/client/cherami/reconfigurable.go @@ -23,8 +23,8 @@ package cherami import ( "time" - "github.com/uber/cherami-client-go/common" "github.com/uber-common/bark" + "github.com/uber/cherami-client-go/common" ) type ( diff --git a/client/cherami/tchanPublisher.go b/client/cherami/tchanPublisher.go index 0c31ee2..58829df 100644 --- a/client/cherami/tchanPublisher.go +++ b/client/cherami/tchanPublisher.go @@ -78,11 +78,11 @@ var _ Publisher = (*tchannelBatchPublisher)(nil) func newTChannelBatchPublisher(client Client, tchan *tchannel.Channel, path string, logger bark.Logger, metricsReporter metrics.Reporter, reconfigurationPollingInterval time.Duration) Publisher { base := basePublisher{ - client: client, - retryPolicy: createDefaultPublisherRetryPolicy(), - path: path, - logger: logger.WithField(common.TagDstPth, common.FmtDstPth(path)), - reporter: metricsReporter, + client: client, + retryPolicy: createDefaultPublisherRetryPolicy(), + path: path, + logger: logger.WithField(common.TagDstPth, common.FmtDstPth(path)), + reporter: metricsReporter, reconfigurationPollingInterval: reconfigurationPollingInterval, } return &tchannelBatchPublisher{ diff --git a/client/cherami/tchanPublisher_test.go b/client/cherami/tchanPublisher_test.go index b7b835c..1b922e9 100644 --- a/client/cherami/tchanPublisher_test.go +++ b/client/cherami/tchanPublisher_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/client/cherami/wsconnector.go b/client/cherami/wsconnector.go index 26d13fd..c4316cc 100644 --- a/client/cherami/wsconnector.go +++ b/client/cherami/wsconnector.go @@ -25,10 +25,10 @@ import ( "net/http" "reflect" - "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/uber/cherami-client-go/common" "github.com/uber/cherami-client-go/common/websocket" "github.com/uber/cherami-client-go/stream" + "github.com/uber/cherami-thrift/.generated/go/cherami" ) type ( diff --git a/common/util.go b/common/util.go index 4f28b89..016ce41 100644 --- a/common/util.go +++ b/common/util.go @@ -37,7 +37,7 @@ import ( "github.com/uber/cherami-thrift/.generated/go/cherami" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/uber/tchannel-go" "github.com/uber/tchannel-go/hyperbahn" ) diff --git a/common/websocket/base_test.go b/common/websocket/base_test.go index 25f9bf8..f47c2a6 100644 --- a/common/websocket/base_test.go +++ b/common/websocket/base_test.go @@ -26,8 +26,8 @@ import ( "reflect" "sync" + log "github.com/sirupsen/logrus" "github.com/uber/cherami-thrift/.generated/go/cherami" - log "github.com/Sirupsen/logrus" ) // -- Websocket Streaming Server -- // diff --git a/common/websocket/serverclient_test.go b/common/websocket/serverclient_test.go index 64ab6f2..3cc8a63 100644 --- a/common/websocket/serverclient_test.go +++ b/common/websocket/serverclient_test.go @@ -27,7 +27,7 @@ import ( "time" // "github.com/stretchr/testify/mock" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) diff --git a/common/websocket/stream.go b/common/websocket/stream.go index 0eb7149..22d0d33 100644 --- a/common/websocket/stream.go +++ b/common/websocket/stream.go @@ -27,9 +27,9 @@ import ( "sync/atomic" "time" - "github.com/uber/cherami-client-go/common" "github.com/apache/thrift/lib/go/thrift" gorilla "github.com/gorilla/websocket" + "github.com/uber/cherami-client-go/common" ) type ( diff --git a/common/websocket/stream_test.go b/common/websocket/stream_test.go index a865fba..e4ef7c4 100644 --- a/common/websocket/stream_test.go +++ b/common/websocket/stream_test.go @@ -36,9 +36,9 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/uber/cherami-client-go/common" mockWS "github.com/uber/cherami-client-go/mocks/common/websocket" + "github.com/uber/cherami-thrift/.generated/go/cherami" ) type ( diff --git a/example.go b/example.go index e3e8257..3aad7c5 100644 --- a/example.go +++ b/example.go @@ -27,9 +27,9 @@ import ( "runtime/debug" "time" - cthrift "github.com/uber/cherami-thrift/.generated/go/cherami" - "github.com/uber/cherami-client-go/client/cherami" "github.com/apache/thrift/lib/go/thrift" + "github.com/uber/cherami-client-go/client/cherami" + cthrift "github.com/uber/cherami-thrift/.generated/go/cherami" ) var host = flag.String("host", "127.0.0.1", "cherami-frontend host IP") @@ -59,7 +59,7 @@ func main() { // First, create the client to interact with Cherami // Here we directly connect to cherami running on host:port cClient, err := cherami.NewClient("cherami-example", *host, *port, &cherami.ClientOptions{ - Timeout: time.Minute, + Timeout: time.Minute, AuthProvider: cherami.NewBypassAuthProvider(), }) exitIfError(err) diff --git a/glide.lock b/glide.lock index 029add1..34f8686 100644 --- a/glide.lock +++ b/glide.lock @@ -1,12 +1,12 @@ -hash: 12dacdfb5ddb80110f75dd0dd4f2359bf534a9e868314ba77dc0110ea03ee16e -updated: 2017-05-09T13:43:20.353037788-07:00 +hash: e81effd1b4925df77951f652ceb2693e674ef707142ce3c19b6476614ac7105e +updated: 2017-06-16T21:14:51.795801923-07:00 imports: - name: github.com/apache/thrift - version: b2a4d4ae21c789b689dd162deb819665567f481c + version: b8ee72de5bf9318d50846852082325d0f932682b subpackages: - lib/go/thrift - name: github.com/cactus/go-statsd-client - version: d8eabe07bc70ff9ba6a56836cde99d1ea3d005f7 + version: 1139cdac1a56e404b5382e3a3503a2c587d2c0c3 subpackages: - statsd - name: github.com/davecgh/go-spew @@ -16,37 +16,37 @@ imports: - name: github.com/gorilla/websocket version: 3ab3a8b8831546bd18fd182c20687ca853b2bb13 - name: github.com/opentracing/opentracing-go - version: f2364047356159ed6494d3c50ca004939f79a557 + version: eaaf4e1eeb7a5373b38e70901270c83577dc6fb9 subpackages: - ext - log - name: github.com/pborman/uuid - version: a97ce2ca70fa5a848076093f05e639a89ca34d06 + version: e790cca94e6cc75c7064b1332e63811d4aae1a53 - name: github.com/pmezard/go-difflib version: 792786c7400a136282c1664665ae0a8db921c6c2 subpackages: - difflib -- name: github.com/Sirupsen/logrus - version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f +- name: github.com/sirupsen/logrus + version: 85b1699d505667d13f8ac4478c1debbf85d6c5de - name: github.com/stretchr/objx version: 1a9d0bb9f541897e62256577b352fdbc1fb4fd94 - name: github.com/stretchr/testify - version: 4d4bfba8f1d1027c4fdbe371823030df51419987 + version: f6abca593680b2315d2075e0f5e2a9751e3f431a subpackages: - assert - mock - require - suite - name: github.com/uber-common/bark - version: 8841a0f8e7ca869284ccb29c08a14cf3f4310f46 + version: dbf558e8a7b65e2b54e1e01c14ee0e4207a865f5 - name: github.com/uber-go/atomic - version: 3b8db5e93c4c02efbc313e17b2e796b0914a01fb + version: 0506d69f5564c56e25797bf7183c28921d4c6360 - name: github.com/uber/cherami-thrift version: be4d5fc25dbf54affd1d8be5bf49bd3fc0440330 subpackages: - .generated/go/cherami - name: github.com/uber/tchannel-go - version: 0b7f160817553b0bacb5b108dd84a5022dbdd1c4 + version: b99c1d7cecb0fdc882bed0098e7cae6ec7459059 subpackages: - hyperbahn - hyperbahn/gen-go/hyperbahn @@ -56,14 +56,20 @@ imports: - thrift - thrift/gen-go/meta - tnet + - tos - trand - typed - name: golang.org/x/net - version: a6577fac2d73be281a500b310739095313165611 + version: 973f3f3bbd50e92b13faa6c53ec16f49b45e851c subpackages: + - bpf - context + - internal/iana + - internal/socket + - ipv4 + - ipv6 - name: golang.org/x/sys - version: d4feaf1a7e61e1d9e79e6c4e76c6349e9cab0a03 + version: fb4cac33e3196ff7f507ab9b2d2a44b0142f5b5a subpackages: - unix testImports: [] diff --git a/glide.yaml b/glide.yaml index 2befd06..24f0f53 100644 --- a/glide.yaml +++ b/glide.yaml @@ -4,7 +4,7 @@ import: version: v1.20.0 subpackages: - .generated/go/cherami -- package: github.com/Sirupsen/logrus +- package: github.com/sirupsen/logrus - package: github.com/apache/thrift subpackages: - lib/go/thrift diff --git a/mocks/clients/cherami/MockTChanBInClient.go b/mocks/clients/cherami/MockTChanBInClient.go index d7e5f5e..4fddea2 100644 --- a/mocks/clients/cherami/MockTChanBInClient.go +++ b/mocks/clients/cherami/MockTChanBInClient.go @@ -21,8 +21,8 @@ package cherami import ( - "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/uber/cherami-client-go/stream" + "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/stretchr/testify/mock" "github.com/uber/tchannel-go/thrift" diff --git a/mocks/clients/cherami/MockTChanBOutClient.go b/mocks/clients/cherami/MockTChanBOutClient.go index 018c1e7..0c2e651 100644 --- a/mocks/clients/cherami/MockTChanBOutClient.go +++ b/mocks/clients/cherami/MockTChanBOutClient.go @@ -21,8 +21,8 @@ package cherami import ( - "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/uber/cherami-client-go/stream" + "github.com/uber/cherami-thrift/.generated/go/cherami" "github.com/stretchr/testify/mock" "github.com/uber/tchannel-go/thrift"