Documentation ¶
Index ¶
- type Guard
- type Node
- type Nodes
- func (ns *Nodes) AllNodes() (nsi []*model.Node)
- func (ns *Nodes) Myself(addr string) bool
- func (ns *Nodes) Nodes() (nsi []*model.Node)
- func (ns *Nodes) Replicate(c context.Context, action model.Action, i *model.Instance, otherZone bool) (err error)
- func (ns *Nodes) ReplicateSet(c context.Context, arg *model.ArgSet, otherZone bool) (err error)
- func (ns *Nodes) UP()
- 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, miss []string, 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.
type Nodes ¶
type Nodes struct {
// contains filtered or unexported fields
}
Nodes is helper to manage lifecycle of a collection of Nodes.
func (*Nodes) Replicate ¶
func (ns *Nodes) Replicate(c context.Context, action model.Action, i *model.Instance, otherZone bool) (err error)
Replicate replicate information to all nodes except for this node.
func (*Nodes) ReplicateSet ¶
ReplicateSet replicate set information to all nodes except for this node.
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) 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) Polls ¶
func (r *Registry) Polls(arg *model.ArgPolls) (ch chan map[string]*model.InstanceInfo, new bool, miss []string, err error)
Polls hangs request and then write instances when that has changes, or return NotModified.