Documentation ¶
Index ¶
- type ConfRegDiscover
- func (crd *ConfRegDiscover) DiscoverConfig(key string) (<-chan *DiscoverEvent, error)
- func (crd *ConfRegDiscover) Ping() error
- func (crd *ConfRegDiscover) Read(path string) (string, error)
- func (crd *ConfRegDiscover) Start() error
- func (crd *ConfRegDiscover) Stop() error
- func (crd *ConfRegDiscover) Write(key string, data []byte) error
- type ConfRegDiscvIf
- type DiscoverEvent
- type ZkRegDiscover
- func (zkRD *ZkRegDiscover) Discover(key string) (<-chan *DiscoverEvent, error)
- func (zkRD *ZkRegDiscover) Ping() error
- func (zkRD *ZkRegDiscover) Read(path string) (string, error)
- func (zkRD *ZkRegDiscover) Start() error
- func (zkRD *ZkRegDiscover) Stop() error
- func (zkRD *ZkRegDiscover) Write(path string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfRegDiscover ¶
type ConfRegDiscover struct {
// contains filtered or unexported fields
}
ConfRegDiscover is config register and discover
func NewConfRegDiscover ¶
func NewConfRegDiscover(serv string) *ConfRegDiscover
NewConfRegDiscover used to create a object of ConfRegDiscover session timeout default 60 second
func NewConfRegDiscoverWithTimeOut ¶
func NewConfRegDiscoverWithTimeOut(serv string, timeOut time.Duration) *ConfRegDiscover
NewConfRegDiscoverWithTimeOut used to create a object
func (*ConfRegDiscover) DiscoverConfig ¶
func (crd *ConfRegDiscover) DiscoverConfig(key string) (<-chan *DiscoverEvent, error)
DiscoverConfig discover the config wether is changed
func (*ConfRegDiscover) Read ¶
func (crd *ConfRegDiscover) Read(path string) (string, error)
Read the configure data
func (*ConfRegDiscover) Start ¶
func (crd *ConfRegDiscover) Start() error
Start the register and discover service
func (*ConfRegDiscover) Stop ¶
func (crd *ConfRegDiscover) Stop() error
Stop the register and discover service
type ConfRegDiscvIf ¶
type ConfRegDiscvIf interface { // Ping to ping server Ping() error // Start the register and discover service Start() error // Stop the register and discover service Stop() error // Write the config data into configure register-discover service Write(key string, data []byte) error // Read the config data from configure register-discover service Read(key string) (string, error) // Discover the config change Discover(key string) (<-chan *DiscoverEvent, error) }
ConfRegDiscvIf define the configurate register and discover function interface
type DiscoverEvent ¶
DiscoverEvent if servers changed, will create a discover event
type ZkRegDiscover ¶
type ZkRegDiscover struct {
// contains filtered or unexported fields
}
ZkRegDiscover config register and discover by zookeeper
func NewZkRegDiscover ¶
func NewZkRegDiscover(serv string, timeOut time.Duration) *ZkRegDiscover
NewZkRegDiscover create a object of ZkRegDiscover
func (*ZkRegDiscover) Discover ¶
func (zkRD *ZkRegDiscover) Discover(key string) (<-chan *DiscoverEvent, error)
func (*ZkRegDiscover) Start ¶
func (zkRD *ZkRegDiscover) Start() error
Start used to run register and discover server
func (*ZkRegDiscover) Stop ¶
func (zkRD *ZkRegDiscover) Stop() error
Stop to stop register and discover server