MCPcopy Index your code
hub / github.com/koding/kite / Flatten

Method Flatten

kontrol/node.go:33–45  ·  view source on GitHub ↗

Flatten converts the recursive etcd directory structure to a flat one that contains all kontrolNodes

()

Source from the content-addressed store, hash-verified

31// Flatten converts the recursive etcd directory structure to a flat one that
32// contains all kontrolNodes
33func (n *Node) Flatten() []*Node {
34 nodes := make([]*Node, 0)
35 for _, node := range n.Node.Nodes {
36 if node.Dir {
37 nodes = append(nodes, NewNode(node).Flatten()...)
38 continue
39 }
40
41 nodes = append(nodes, NewNode(node))
42 }
43
44 return nodes
45}
46
47// Kite returns a single kite gathered from the key and the value for the
48// current node.

Callers 1

KitesMethod · 0.95

Calls 1

NewNodeFunction · 0.85

Tested by

no test coverage detected