func (e Environment) FindFromRoot(path []string) (yaml.Node, bool) { if len(e.Scope) == 0 { return nil, false } return yaml.Find(yaml.NewNode(e.Scope[0], "scope"), path...) }
func (e Environment) FindReference(path []string) (yaml.Node, bool) { root, found := resolveSymbol(path[0], e.Scope) if !found { return nil, false } return yaml.Find(root, path[1:]...) }
func (e Environment) FindInStubs(path []string) (yaml.Node, bool) { for _, stub := range e.Stubs { val, found := yaml.Find(stub, path...) if found { return val, true } } return nil, false }
func (c MapContext) FindReference(path []string) (yaml.Node, bool) { for name, node := range c.names { if len(path) >= 1 && path[0] == name { debug.Debug("map: catch find ref: %v\n", path) if len(path) == 1 { return node, true } return yaml.Find(node, path[1:]...) } } debug.Debug("map: forward find ref: %v\n", path) return c.Binding.FindReference(path) }
func newEntries(a []yaml.Node, b []yaml.Node) []yaml.Node { added := []yaml.Node{} for _, val := range a { name, ok := yaml.FindString(val, "name") if ok { _, found := yaml.Find(yaml.NewNode(b, "some map"), name) // TODO if found { continue } } added = append(added, val) } return added }