Пример #1
0
// NewWeavePublisher makes a new Weave.
func NewWeavePublisher(weaveClient WeaveClient, dockerClient DockerClient, interfaces InterfaceFunc, hostname, containerName string) *WeavePublisher {
	w := &WeavePublisher{
		containerName: containerName,
		hostname:      hostname,
		dockerClient:  dockerClient,
		weaveClient:   weaveClient,
		interfaces:    interfaces,
	}
	w.backoff = backoff.New(w.updateDNS, "updating weaveDNS")
	go w.backoff.Start()
	return w
}
Пример #2
0
// NewWeave returns a new Weave tagger based on the Weave router at
// address. The address should be an IP or FQDN, no port.
func NewWeave(hostID string, client weave.Client) *Weave {
	w := &Weave{
		client:  client,
		hostID:  hostID,
		psCache: map[string]weave.PSEntry{},
	}

	w.backoff = backoff.New(w.collect, "collecting weave info")
	w.backoff.SetInitialBackoff(5 * time.Second)
	go w.backoff.Start()
	return w
}