Ejemplo n.º 1
0
Archivo: tree.go Proyecto: cfstras/pcm
// Recursively descend through connections tree, writing paths->connection mappings
// into the conns map. Start with prefix ""
func descendConnections(prefix string, node *types.Container,
	conns map[string]*types.Connection, includeDescription bool) {
	node.Path_ = prefix
	for i := range node.Connections {
		c := &node.Connections[i]
		key := prefix + "/" + c.Name
		if includeDescription {
			key += "  " + c.Info.Description
		}
		conns[key] = c
		c.Path_ = key
	}
	for i := range node.Containers {
		n := &node.Containers[i]
		descendConnections(prefix+"/"+n.Name, n, conns,
			includeDescription)
	}
}