diff --git a/config_center/zookeeper/impl.go b/config_center/zookeeper/impl.go index 6842d9e37711e954a93c7982bc959aa0798a9c93..ce1c65f6764276cf3e0ec87a8b70e82b999858a3 100644 --- a/config_center/zookeeper/impl.go +++ b/config_center/zookeeper/impl.go @@ -25,7 +25,7 @@ import ( import ( perrors "github.com/pkg/errors" - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" ) import ( diff --git a/config_center/zookeeper/impl_test.go b/config_center/zookeeper/impl_test.go index e614009faa5b32873c6245dea5c85cc2747e19ea..cca4427587534c1c4d0f9324f932f8018502521c 100644 --- a/config_center/zookeeper/impl_test.go +++ b/config_center/zookeeper/impl_test.go @@ -24,7 +24,7 @@ import ( ) import ( - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" "github.com/stretchr/testify/assert" ) diff --git a/go.mod b/go.mod index db6dc92c63176334f6dfa0436889ffab6f3c9c53..80598f576babdbe334edcd6383de30a9a47b903d 100644 --- a/go.mod +++ b/go.mod @@ -13,6 +13,7 @@ require ( github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/creasty/defaults v1.3.0 github.com/dubbogo/getty v1.3.2 + github.com/dubbogo/go-zookeeper v0.0.0-20200204040540-322d5e0859db github.com/dubbogo/gost v1.5.2 github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect github.com/go-errors/errors v1.0.1 // indirect @@ -38,7 +39,6 @@ require ( github.com/opentracing/opentracing-go v1.1.0 github.com/pkg/errors v0.8.1 github.com/prometheus/client_golang v1.1.0 // indirect - github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec github.com/satori/go.uuid v1.2.0 github.com/smartystreets/goconvey v0.0.0-20190710185942-9d28bd7c0945 // indirect github.com/soheilhy/cmux v0.1.4 // indirect diff --git a/go.sum b/go.sum index f215a81b209579c0bb5de0123153b10b7a36767b..a82d4bbe0c5e5a3c4285f0abf9a2eb87f76083c5 100644 --- a/go.sum +++ b/go.sum @@ -106,6 +106,8 @@ github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dubbogo/getty v1.3.2 h1:l1KVSs/1CtTKbIPTrkTtBT6S9ddvmswDGoAnnl2CDpM= github.com/dubbogo/getty v1.3.2/go.mod h1:ANbVQ9tbpZ2b0xdR8nRrgS/oXIsZAeRxzvPSOn/7mbk= +github.com/dubbogo/go-zookeeper v0.0.0-20200204040540-322d5e0859db h1:/0iknuYOXMrAJSDrBCTe9fQqJacmmc+pN4XlDsXABDs= +github.com/dubbogo/go-zookeeper v0.0.0-20200204040540-322d5e0859db/go.mod h1:jw+p63E9ErZLsWvfRwC1z5en+t5lsSWLMCE2vBfVWTY= github.com/dubbogo/gost v1.5.1 h1:oG5dzaWf1KYynBaBoUIOkgT+YD0niHV6xxI0Odq7hDg= github.com/dubbogo/gost v1.5.1/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= github.com/dubbogo/gost v1.5.2 h1:ri/03971hdpnn3QeCU+4UZgnRNGDXLDGDucR/iozZm8= @@ -432,8 +434,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735 h1:7YvPJVmEeFHR1Tj9sZEYsmarJEQfMVYpd/Vyy/A8dqE= github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec h1:6ncX5ko6B9LntYM0YBRXkiSaZMmLYeZ/NWcmeB43mMY= -github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/dubbogo/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec h1:6ncX5ko6B9LntYM0YBRXkiSaZMmLYeZ/NWcmeB43mMY= +github.com/dubbogo/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index bc815c3ae0eaf1b5700d0e9d613e3189d64a2da2..cefdce4dbf1f72dd838daf411f490b48124bce9b 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -31,7 +31,7 @@ import ( import ( gxnet "github.com/dubbogo/gost/net" perrors "github.com/pkg/errors" - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" ) import ( diff --git a/remoting/zookeeper/client.go b/remoting/zookeeper/client.go index 594d87b14ca932c3a2e8c1e271757c9d94d93bb8..f99fe1f0f9299b93e7f83c92305248e587de3929 100644 --- a/remoting/zookeeper/client.go +++ b/remoting/zookeeper/client.go @@ -26,7 +26,7 @@ import ( import ( perrors "github.com/pkg/errors" - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" ) import ( @@ -506,7 +506,7 @@ func (z *ZookeeperClient) GetChildrenW(path string) ([]string, <-chan zk.Event, err error children []string stat *zk.Stat - event <-chan zk.Event + watcher *zk.Watcher ) err = errNilZkClientConn @@ -514,7 +514,7 @@ func (z *ZookeeperClient) GetChildrenW(path string) ([]string, <-chan zk.Event, conn := z.Conn z.Unlock() if conn != nil { - children, stat, event, err = conn.ChildrenW(path) + children, stat, watcher, err = conn.ChildrenW(path) } if err != nil { @@ -534,7 +534,7 @@ func (z *ZookeeperClient) GetChildrenW(path string) ([]string, <-chan zk.Event, return nil, nil, errNilChildren } - return children, event, nil + return children, watcher.EvtCh, nil } // GetChildren ... @@ -573,9 +573,9 @@ func (z *ZookeeperClient) GetChildren(path string) ([]string, error) { // ExistW ... func (z *ZookeeperClient) ExistW(zkPath string) (<-chan zk.Event, error) { var ( - exist bool - err error - event <-chan zk.Event + exist bool + err error + watcher *zk.Watcher ) err = errNilZkClientConn @@ -583,7 +583,7 @@ func (z *ZookeeperClient) ExistW(zkPath string) (<-chan zk.Event, error) { conn := z.Conn z.Unlock() if conn != nil { - exist, _, event, err = conn.ExistsW(zkPath) + exist, _, watcher, err = conn.ExistsW(zkPath) } if err != nil { @@ -595,7 +595,7 @@ func (z *ZookeeperClient) ExistW(zkPath string) (<-chan zk.Event, error) { return nil, perrors.Errorf("zkClient{%s} App zk path{%s} does not exist.", z.name, zkPath) } - return event, nil + return watcher.EvtCh, nil } // GetContent ... diff --git a/remoting/zookeeper/client_test.go b/remoting/zookeeper/client_test.go index 17b9f0f33128eab7fc682fd37aeb454c8c2c5066..cb41eb326be95470e39694fc5df233fdf073b905 100644 --- a/remoting/zookeeper/client_test.go +++ b/remoting/zookeeper/client_test.go @@ -24,7 +24,7 @@ import ( ) import ( - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" "github.com/stretchr/testify/assert" ) diff --git a/remoting/zookeeper/facade_test.go b/remoting/zookeeper/facade_test.go index 58e0d69dcfd9bf645c147f6e920e56ed5f3951eb..577d6af98fec2e6eb5437d020ff51c7c42a38329 100644 --- a/remoting/zookeeper/facade_test.go +++ b/remoting/zookeeper/facade_test.go @@ -24,7 +24,7 @@ import ( "time" ) import ( - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" "github.com/stretchr/testify/assert" ) import ( diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index 43ee54f81f71ff74064aa5756ea11c70ba2055fa..51ac9acea9ff7bc7456f3ffb70c68bf616666319 100644 --- a/remoting/zookeeper/listener.go +++ b/remoting/zookeeper/listener.go @@ -26,7 +26,7 @@ import ( import ( "github.com/dubbogo/getty" perrors "github.com/pkg/errors" - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" ) import ( diff --git a/remoting/zookeeper/listener_test.go b/remoting/zookeeper/listener_test.go index 1276e5363f5e3f1fcde9a36d8a94e671e030e6c3..43e9aca3f44470873c3c97ec2447bebcc57e5545 100644 --- a/remoting/zookeeper/listener_test.go +++ b/remoting/zookeeper/listener_test.go @@ -24,7 +24,7 @@ import ( "time" ) import ( - "github.com/samuel/go-zookeeper/zk" + "github.com/dubbogo/go-zookeeper/zk" "github.com/stretchr/testify/assert" ) import (