Documentation ¶
Index ¶
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) 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 ConfRegDiscvServer ¶
type ConfRegDiscvServer 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 register-discover service Write(key string, data []byte) error // Discover the config change Discover(key string) (<-chan *DiscoverEvent, error) }
ConfRegDiscvServer 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