Exemplo n.º 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)
}
Exemplo n.º 2
0
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)
}
Exemplo n.º 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
}