Commit d2552d96 authored by wangwx's avatar wangwx

move client struct to client.go

parent fde1b715
......@@ -44,6 +44,24 @@ var (
once sync.Once
)
// ZookeeperClient represents zookeeper Client Configuration
type ZookeeperClient struct {
name string
ZkAddrs []string
sync.RWMutex // for conn
Conn *zk.Conn
activeNumber uint32
Timeout time.Duration
Wait sync.WaitGroup
valid uint32
share bool
reconnectCh chan struct{}
eventRegistry map[string][]*chan struct{}
eventRegistryLock sync.RWMutex
zkEventHandler ZkEventHandler
Session <-chan zk.Event
}
type zookeeperClientPool struct {
sync.Mutex
zkClient map[string]*ZookeeperClient
......
......@@ -18,7 +18,6 @@
package gxzookeeper
import (
"sync"
"time"
)
......@@ -43,24 +42,6 @@ func WithZkName(name string) Option {
}
}
// ZookeeperClient represents zookeeper Client Configuration
type ZookeeperClient struct {
name string
ZkAddrs []string
sync.RWMutex // for conn
Conn *zk.Conn
activeNumber uint32
Timeout time.Duration
Wait sync.WaitGroup
valid uint32
share bool
reconnectCh chan struct{}
eventRegistry map[string][]*chan struct{}
eventRegistryLock sync.RWMutex
zkEventHandler ZkEventHandler
Session <-chan zk.Event
}
type zkClientOption func(*ZookeeperClient)
// WithZkEventHandler sets zk Client event
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment