예제 #1
0
파일: nameserver.go 프로젝트: binhnv/weave
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
}