Documentation
¶
Index ¶
- Variables
- type DogRegister
- type EtcdRegister
- func (r *EtcdRegister) Close()
- func (r *EtcdRegister) GetRootNode() (root string)
- func (r *EtcdRegister) NewRegister(hosts []string, root, environ, group, service string)
- func (r *EtcdRegister) Run(ip string, port int, weight uint64) (err error)
- func (r *EtcdRegister) SetHeartBeat(heartBeat time.Duration)
- func (r *EtcdRegister) SetOffline(offline bool)
- func (r *EtcdRegister) SetRootNode(root string) (err error)
- type ZkRegister
- func (z *ZkRegister) Close()
- func (z *ZkRegister) GetRootNode() (root string)
- func (z *ZkRegister) NewRegister(hosts []string, root, environ, group, service string)
- func (z *ZkRegister) Run(ip string, port int, weight uint64) (err error)
- func (z *ZkRegister) SetHeartBeat(heartBeat time.Duration)
- func (z *ZkRegister) SetOffline(offline bool)
- func (z *ZkRegister) SetRootNode(root string) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultHeartBeat uint64 = 10 DefaultRetryTimes = 3 )
Functions ¶
This section is empty.
Types ¶
type DogRegister ¶
type DogRegister interface {
NewRegister(hosts []string, root, environ, group, service string)
SetRootNode(node string) error
GetRootNode() (root string)
SetHeartBeat(heartBeat time.Duration)
SetOffline(offline bool)
Run(ip string, port int, weight uint64) error
Close()
}
register server
type EtcdRegister ¶
type EtcdRegister struct {
// contains filtered or unexported fields
}
server path : /root/group/service/environ/pool/ip:port
func (*EtcdRegister) Close ¶
func (r *EtcdRegister) Close()
func (*EtcdRegister) GetRootNode ¶
func (r *EtcdRegister) GetRootNode() (root string)
func (*EtcdRegister) NewRegister ¶
func (r *EtcdRegister) NewRegister(hosts []string, root, environ, group, service string)
func (*EtcdRegister) Run ¶
func (r *EtcdRegister) Run(ip string, port int, weight uint64) (err error)
func (*EtcdRegister) SetHeartBeat ¶
func (r *EtcdRegister) SetHeartBeat(heartBeat time.Duration)
func (*EtcdRegister) SetOffline ¶
func (r *EtcdRegister) SetOffline(offline bool)
func (*EtcdRegister) SetRootNode ¶
func (r *EtcdRegister) SetRootNode(root string) (err error)
type ZkRegister ¶
type ZkRegister struct {
// contains filtered or unexported fields
}
func (*ZkRegister) Close ¶
func (z *ZkRegister) Close()
func (*ZkRegister) GetRootNode ¶
func (z *ZkRegister) GetRootNode() (root string)
func (*ZkRegister) NewRegister ¶
func (z *ZkRegister) NewRegister(hosts []string, root, environ, group, service string)
func (*ZkRegister) SetHeartBeat ¶
func (z *ZkRegister) SetHeartBeat(heartBeat time.Duration)
func (*ZkRegister) SetOffline ¶
func (z *ZkRegister) SetOffline(offline bool)
func (*ZkRegister) SetRootNode ¶
func (z *ZkRegister) SetRootNode(root string) (err error)
Click to show internal directories.
Click to hide internal directories.