Skip to content
Snippets Groups Projects

"Overhaul Architecture"

Merged Ghost User requested to merge 67-overhaul-architecture into develop
3 files
+ 16
14
Compare changes
  • Side-by-side
  • Inline
Files
3
package main
package main
import (
import (
"code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
schema "code.fbi.h-da.de/cocsn/yang-models/generated/arista"
"fmt"
"fmt"
"github.com/openconfig/goyang/pkg/yang"
"github.com/openconfig/goyang/pkg/yang"
)
)
@@ -12,12 +12,14 @@ type PathElement struct {
@@ -12,12 +12,14 @@ type PathElement struct {
}
}
func main() {
func main() {
tree := openconfig.SchemaTree
tree := schema.SchemaTree
paths := make(map[string]*PathElement)
paths := make(map[string]*PathElement)
for k,v := range tree {
for k,v := range tree {
if v.Parent.Name == "device" {
if v.Parent != nil {
paths[k] = processEntry(v)
if v.Parent.Name == "device" {
 
paths[k] = processEntry(v)
 
}
}
}
}
}
fmt.Println("stop")
fmt.Println("stop")
@@ -33,7 +35,7 @@ func processEntry(e *yang.Entry) *PathElement {
@@ -33,7 +35,7 @@ func processEntry(e *yang.Entry) *PathElement {
child := processEntry(v)
child := processEntry(v)
elem.Children = append(elem.Children, child)
elem.Children = append(elem.Children, child)
}
}
return elem
}
}
leaf := &PathElement{
leaf := &PathElement{
Name: e.Name,
Name: e.Name,
Loading