Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gostnops
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
gostnops
Commits
eaa68766
Commit
eaa68766
authored
Mar 03, 2021
by
wangwx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix hound error
parent
4469ec29
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
client.go
database/kv/zk/client.go
+9
-4
go.mod
go.mod
+1
-2
go.sum
go.sum
+2
-0
No files found.
database/kv/zk/client.go
View file @
eaa68766
...
@@ -31,25 +31,30 @@ import (
...
@@ -31,25 +31,30 @@ import (
)
)
var
(
var
(
// ErrNilZkClientConn no conn error
ErrNilZkClientConn
=
perrors
.
New
(
"zookeeper Client{conn} is nil"
)
ErrNilZkClientConn
=
perrors
.
New
(
"zookeeper Client{conn} is nil"
)
// ErrNilChildren no children error
ErrNilChildren
=
perrors
.
Errorf
(
"has none children"
)
ErrNilChildren
=
perrors
.
Errorf
(
"has none children"
)
// ErrNilNode no node error
ErrNilNode
=
perrors
.
Errorf
(
"node does not exist"
)
ErrNilNode
=
perrors
.
Errorf
(
"node does not exist"
)
)
)
var
(
var
(
zkClientPool
Z
ookeeperClientPool
zkClientPool
z
ookeeperClientPool
once
sync
.
Once
once
sync
.
Once
)
)
type
Z
ookeeperClientPool
struct
{
type
z
ookeeperClientPool
struct
{
sync
.
Mutex
sync
.
Mutex
zkClient
map
[
string
]
*
ZookeeperClient
zkClient
map
[
string
]
*
ZookeeperClient
}
}
// ZkEventHandler interface
type
ZkEventHandler
interface
{
type
ZkEventHandler
interface
{
HandleZkEvent
(
z
*
ZookeeperClient
)
HandleZkEvent
(
z
*
ZookeeperClient
)
}
}
// DefaultHandler is default handler for zk event
type
DefaultHandler
struct
{
type
DefaultHandler
struct
{
}
}
...
...
go.mod
View file @
eaa68766
...
@@ -8,7 +8,7 @@ require (
...
@@ -8,7 +8,7 @@ require (
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/davecgh/go-spew v1.1.1
github.com/davecgh/go-spew v1.1.1
github.com/dubbogo/go-zookeeper v1.0.
2
github.com/dubbogo/go-zookeeper v1.0.
3
github.com/dubbogo/jsonparser v1.0.1
github.com/dubbogo/jsonparser v1.0.1
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
...
@@ -43,7 +43,6 @@ require (
...
@@ -43,7 +43,6 @@ require (
replace (
replace (
github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.4
github.com/coreos/bbolt => go.etcd.io/bbolt v1.3.4
github.com/dubbogo/go-zookeeper => github.com/wenxuwan/go-zookeeper v1.0.3-0.20210303051024-8a4fef629f1a
go.etcd.io/bbolt v1.3.4 => github.com/coreos/bbolt v1.3.4
go.etcd.io/bbolt v1.3.4 => github.com/coreos/bbolt v1.3.4
google.golang.org/grpc v1.33.1 => google.golang.org/grpc v1.26.0
google.golang.org/grpc v1.33.1 => google.golang.org/grpc v1.26.0
)
)
...
...
go.sum
View file @
eaa68766
...
@@ -64,6 +64,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC
...
@@ -64,6 +64,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dubbogo/go-zookeeper v1.0.2 h1:xmEnPL8SlCe3/+J5ZR9e8qE35LmFVYe8VVpDakjNM4A=
github.com/dubbogo/go-zookeeper v1.0.2 h1:xmEnPL8SlCe3/+J5ZR9e8qE35LmFVYe8VVpDakjNM4A=
github.com/dubbogo/go-zookeeper v1.0.2/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c=
github.com/dubbogo/go-zookeeper v1.0.2/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c=
github.com/dubbogo/go-zookeeper v1.0.3 h1:UkuY+rBsxdT7Bs63QAzp9z7XqQ53W1j8E5rwl83me8g=
github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c=
github.com/dubbogo/jsonparser v1.0.1 h1:sAIr8gk+gkahkIm6CnUxh9wTCkbgwLEQ8dTXTnAXyzo=
github.com/dubbogo/jsonparser v1.0.1 h1:sAIr8gk+gkahkIm6CnUxh9wTCkbgwLEQ8dTXTnAXyzo=
github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU=
github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment