Documentation ¶
Overview ¶
Package igenutil contains internal generation utilities.
Index ¶
Constants ¶
View Source
const ( // RootElementNodeName is the synthesised node name that is used for an // element that represents the root. Such an element is generated only // when the GenerateFakeRoot bool is set to true within the // YANGCodeGenerator instance used as a receiver. RootElementNodeName = "!fakeroot!" // DefaultRootName is the default name for the root structure if GenerateFakeRoot is // set to true. DefaultRootName = "device" )
Variables ¶
View Source
var ( // TemplateHelperFunctions specifies a set of functions that are supplied as // helpers to the templates that are used within this file. TemplateHelperFunctions = template.FuncMap{ "inc": func(i int) int { return i + 1 }, "toUpper": strings.ToUpper, "indentLines": func(s string) string { var b bytes.Buffer p := strings.Split(s, "\n") b.WriteRune('\n') for i, l := range p { if l == "" { continue } b.WriteString(fmt.Sprintf(" %s", l)) if i != len(p)-1 { b.WriteRune('\n') } } return b.String() }, "stripAsteriskPrefix": func(s string) string { return strings.TrimPrefix(s, "*") }, } )
Functions ¶
func IsFakeRoot ¶
IsFakeRoot checks whether a given entry is the generated fake root.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.