示例#1
0
文件: weave.go 项目: dilgerma/scope
// 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
文件: weave.go 项目: dilgerma/scope
// 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
}