示例#1
0
func (n *Nameserver) AddEntry(hostname, containerid string, origin router.PeerName, addr address.Address) error {
	n.infof("adding entry %s -> %s", hostname, addr.String())
	n.Lock()
	entry := n.entries.add(hostname, containerid, origin, addr)
	n.Unlock()
	return n.broadcastEntries(entry)
}
示例#2
0
文件: nameserver.go 项目: brb/weave
func (n *Nameserver) AddEntry(hostname, containerid string, origin mesh.PeerName, addr address.Address) {
	n.Lock()
	n.infof("adding entry for %s: %s -> %s", containerid, hostname, addr.String())
	entry := n.entries.add(hostname, containerid, origin, addr)
	n.Unlock()
	n.broadcastEntries(entry)
}
示例#3
0
func (n *Nameserver) AddEntry(hostname, containerid string, origin router.PeerName, addr address.Address) error {
	n.infof("adding entry %s -> %s", hostname, addr.String())
	n.Lock()
	entry := n.entries.add(hostname, containerid, origin, addr)
	n.Unlock()

	if n.gossip != nil {
		return n.gossip.GossipBroadcast(&Entries{entry})
	}
	return nil
}