Documentation ¶
Index ¶
- type Guard
- type Node
- type Nodes
- type Registry
- func (r *Registry) Cancel(arg *model.ArgCancel) (i *model.Instance, ok bool)
- func (r *Registry) DelConns(arg *model.ArgPolls)
- func (r *Registry) Fetch(zone, env, appid string, latestTime int64, status uint32) (info *model.InstanceInfo, err error)
- func (r *Registry) FetchAll() (im map[string][]*model.Instance)
- func (r *Registry) Polls(arg *model.ArgPolls) (ch chan map[string]*model.InstanceInfo, new bool, err error)
- func (r *Registry) Register(ins *model.Instance, latestTime int64) (err error)
- func (r *Registry) Renew(arg *model.ArgRenew) (i *model.Instance, ok bool)
- func (r *Registry) Set(arg *model.ArgSet) (ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard count the renew of all operations for self protection
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a peer node to which information should be shared from this node.
This struct handles replicating all update operations like 'Register,Renew,Cancel,Expiration and Status Changes' to the <Discovery Server> node it represents.
func (*Node) Cancel ¶
Cancel send the cancellation information of Instance receiving by this node to the peer node represented.
func (*Node) Register ¶
Register send the registration information of Instance receiving by this node to the peer node represented.
func (*Node) Renew ¶
Renew send the heartbeat information of Instance receiving by this node to the peer node represented. If the instance does not exist the node, the instance registration information is sent again to the peer node.
type Nodes ¶
type Nodes struct {
// contains filtered or unexported fields
}
Nodes is helper to manage lifecycle of a collection of Nodes.
func (*Nodes) AllNodes ¶
AllNodes returns nodes contain other zone nodes.
func (*Nodes) Myself ¶
Myself returns whether or not myself.
func (*Nodes) Nodes ¶
Nodes returns nodes of local zone.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry handles replication of all operations to peer Discovery nodes to keep them all in sync.
func (*Registry) Cancel ¶
Cancel cancels the registration of an instance.
func (*Registry) DelConns ¶
DelConns delete conn of host in appid
func (*Registry) Fetch ¶
func (r *Registry) Fetch(zone, env, appid string, latestTime int64, status uint32) (info *model.InstanceInfo, err error)
Fetch fetch all instances by appid.
func (*Registry) FetchAll ¶
FetchAll fetch all instances of all the families.
func (*Registry) Polls ¶
func (r *Registry) Polls(arg *model.ArgPolls) (ch chan map[string]*model.InstanceInfo, new bool, err error)
Polls hangs request and then write instances when that has changes, or return NotModified.
func (*Registry) Register ¶
Register a new instance.
func (*Registry) Renew ¶
Renew marks the given instance of the given app name as renewed, and also marks whether it originated from replication.