Documentation ¶
Index ¶
- Constants
- func ForceShowSecrets(opts *unionOptions)
- func HideSecrets(opts *unionOptions)
- func IncludeDefaults(opts *unionOptions)
- func UnmarshalJSONConfigsWithoutValidation(configs [][]byte, ms schema.ModelSet) (*data.Node, error)
- func UnmarshalJSONIntoNodeWithoutValidation(ut Node, cfgOrState encoding.ConfigOrState, jsonInput []byte) (err error)
- type Auther
- type BySystem
- type ByUser
- type Choice
- func (n Choice) Added() bool
- func (n Choice) Changed() bool
- func (n Choice) Child(name string) Node
- func (n Choice) Children() map[string]Node
- func (n Choice) Data() *data.Node
- func (n Choice) Default() bool
- func (n Choice) Delete(auth Auther, path []string, checkAuth bool) error
- func (n Choice) Descendant(auth Auther, path []string) (Node, error)
- func (n Choice) Empty() bool
- func (n Choice) Exists(auth Auther, path []string) error
- func (n Choice) Get(auth Auther, path []string) ([]string, error)
- func (n Choice) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n Choice) GetSchema() schema.Node
- func (n Choice) GetStateJson(path []string) ([][]byte, error)
- func (n Choice) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n Choice) IsDefault(auth Auther, path []string) (bool, error)
- func (n Choice) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n Choice) MarshalInternalJSON(options ...UnionOption) []byte
- func (n Choice) Merge() *data.Node
- func (n Choice) MergeWithoutDefaults() *data.Node
- func (n Choice) Module() string
- func (n Choice) Name() string
- func (n Choice) NumChildren() int
- func (n Choice) Parent() Node
- func (n Choice) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n Choice) Set(auth Auther, path []string) error
- func (n Choice) Show(path []string, options ...UnionOption) (string, error)
- func (n Choice) SortedChildren() []Node
- func (n Choice) ToJSON(options ...UnionOption) []byte
- func (n Choice) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n Choice) ToRFC7951(options ...UnionOption) []byte
- func (n Choice) ToXML(rootName string, options ...UnionOption) []byte
- func (n Choice) Updated() bool
- func (n Choice) YangDataChildren() []datanode.DataNode
- func (n Choice) YangDataChildrenNoSorting() []datanode.DataNode
- func (n Choice) YangDataName() string
- func (n Choice) YangDataValues() []string
- func (n Choice) YangDataValuesNoSorting() []string
- type Container
- func (n Container) Added() bool
- func (n Container) Changed() bool
- func (n Container) Child(name string) Node
- func (n Container) Children() map[string]Node
- func (n Container) Data() *data.Node
- func (n Container) Default() bool
- func (n Container) Delete(auth Auther, path []string, checkAuth bool) error
- func (n Container) Descendant(auth Auther, path []string) (Node, error)
- func (n Container) Empty() bool
- func (n Container) Exists(auth Auther, path []string) error
- func (n Container) Get(auth Auther, path []string) ([]string, error)
- func (n Container) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n Container) GetSchema() schema.Node
- func (n Container) GetStateJson(path []string) ([][]byte, error)
- func (n Container) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n Container) IsDefault(auth Auther, path []string) (bool, error)
- func (n Container) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n Container) MarshalInternalJSON(options ...UnionOption) []byte
- func (n Container) Merge() *data.Node
- func (n Container) MergeWithoutDefaults() *data.Node
- func (n Container) Module() string
- func (n Container) Name() string
- func (n Container) NumChildren() int
- func (n Container) Parent() Node
- func (n Container) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n Container) Set(auth Auther, path []string) error
- func (n Container) Show(path []string, options ...UnionOption) (string, error)
- func (n Container) SortedChildren() []Node
- func (n Container) ToJSON(options ...UnionOption) []byte
- func (n Container) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n Container) ToRFC7951(options ...UnionOption) []byte
- func (n Container) ToXML(rootName string, options ...UnionOption) []byte
- func (n Container) Updated() bool
- func (n Container) YangDataChildren() []datanode.DataNode
- func (n Container) YangDataChildrenNoSorting() []datanode.DataNode
- func (n Container) YangDataName() string
- func (n Container) YangDataValues() []string
- func (n Container) YangDataValuesNoSorting() []string
- type Flags
- type InternalJSONWriter
- type JSONWriter
- func (b *JSONWriter) BeginContainer(n *Container, empty bool, level int)
- func (b *JSONWriter) BeginLeaf(n *Leaf, empty bool, level int, hideSecrets bool)
- func (b *JSONWriter) BeginLeafList(n *LeafList, empty bool, level int, hideSecrets bool)
- func (b *JSONWriter) BeginList(n *List, empty bool, level int)
- func (b *JSONWriter) BeginListEntry(n *ListEntry, empty bool, level int, hideSecrets bool)
- func (b *JSONWriter) EndContainer(n *Container, empty bool, level int)
- func (b *JSONWriter) EndLeaf(n *Leaf, empty bool, level int)
- func (b *JSONWriter) EndLeafList(n *LeafList, empty bool, level int)
- func (b *JSONWriter) EndList(n *List, empty bool, level int)
- func (b *JSONWriter) EndListEntry(n *ListEntry, empty bool, level int)
- func (b *JSONWriter) PrintSep()
- func (b *JSONWriter) WriteLeafListValues(n *LeafList, empty bool, level int, hideSecrets bool)
- func (b *JSONWriter) WriteLeafValue(n *Leaf, empty bool, level int, hideSecrets bool)
- type Leaf
- func (n Leaf) Added() bool
- func (n Leaf) Changed() bool
- func (n Leaf) Child(name string) Node
- func (n Leaf) Children() map[string]Node
- func (n Leaf) Data() *data.Node
- func (n Leaf) Default() bool
- func (n Leaf) Delete(auth Auther, path []string, checkAuth bool) error
- func (n Leaf) Descendant(auth Auther, path []string) (Node, error)
- func (n Leaf) Empty() bool
- func (n Leaf) Exists(auth Auther, path []string) error
- func (n Leaf) Get(auth Auther, path []string) ([]string, error)
- func (n Leaf) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n Leaf) GetSchema() schema.Node
- func (n Leaf) GetStateJson(path []string) ([][]byte, error)
- func (n Leaf) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n Leaf) IsDefault(auth Auther, path []string) (bool, error)
- func (n Leaf) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n Leaf) MarshalInternalJSON(options ...UnionOption) []byte
- func (n Leaf) Merge() *data.Node
- func (n Leaf) MergeWithoutDefaults() *data.Node
- func (n Leaf) Module() string
- func (n Leaf) Name() string
- func (n Leaf) NumChildren() int
- func (n Leaf) Parent() Node
- func (n Leaf) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n Leaf) Set(auth Auther, path []string) error
- func (n Leaf) Show(path []string, options ...UnionOption) (string, error)
- func (n Leaf) SortedChildren() []Node
- func (n Leaf) ToJSON(options ...UnionOption) []byte
- func (n Leaf) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n Leaf) ToRFC7951(options ...UnionOption) []byte
- func (n Leaf) ToXML(rootName string, options ...UnionOption) []byte
- func (n Leaf) Updated() bool
- func (n Leaf) YangDataChildren() []datanode.DataNode
- func (n Leaf) YangDataChildrenNoSorting() []datanode.DataNode
- func (n Leaf) YangDataName() string
- func (n Leaf) YangDataValues() []string
- func (n Leaf) YangDataValuesNoSorting() []string
- type LeafList
- func (n LeafList) Added() bool
- func (n LeafList) Changed() bool
- func (n LeafList) Child(name string) Node
- func (n LeafList) Children() map[string]Node
- func (n LeafList) Data() *data.Node
- func (n LeafList) Default() bool
- func (n LeafList) Delete(auth Auther, path []string, checkAuth bool) error
- func (n LeafList) Descendant(auth Auther, path []string) (Node, error)
- func (n LeafList) Empty() bool
- func (n LeafList) Exists(auth Auther, path []string) error
- func (n LeafList) Get(auth Auther, path []string) ([]string, error)
- func (n LeafList) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n LeafList) GetSchema() schema.Node
- func (n LeafList) GetStateJson(path []string) ([][]byte, error)
- func (n LeafList) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n LeafList) IsDefault(auth Auther, path []string) (bool, error)
- func (n LeafList) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n LeafList) MarshalInternalJSON(options ...UnionOption) []byte
- func (n LeafList) Merge() *data.Node
- func (n LeafList) MergeWithoutDefaults() *data.Node
- func (n LeafList) Module() string
- func (n LeafList) Name() string
- func (n LeafList) NumChildren() int
- func (n LeafList) Parent() Node
- func (n LeafList) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n LeafList) Set(auth Auther, path []string) error
- func (n LeafList) Show(path []string, options ...UnionOption) (string, error)
- func (n LeafList) SortedChildren() []Node
- func (n LeafList) ToJSON(options ...UnionOption) []byte
- func (n LeafList) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n LeafList) ToRFC7951(options ...UnionOption) []byte
- func (n LeafList) ToXML(rootName string, options ...UnionOption) []byte
- func (n LeafList) Updated() bool
- func (n LeafList) YangDataChildren() []datanode.DataNode
- func (n LeafList) YangDataChildrenNoSorting() []datanode.DataNode
- func (n LeafList) YangDataName() string
- func (n LeafList) YangDataValues() []string
- func (n LeafList) YangDataValuesNoSorting() []string
- type LeafValue
- func (n LeafValue) Added() bool
- func (n LeafValue) Changed() bool
- func (n LeafValue) Child(name string) Node
- func (n LeafValue) Children() map[string]Node
- func (n LeafValue) Data() *data.Node
- func (n LeafValue) Default() bool
- func (n LeafValue) Delete(auth Auther, path []string, checkAuth bool) error
- func (n LeafValue) Descendant(auth Auther, path []string) (Node, error)
- func (n LeafValue) Empty() bool
- func (n LeafValue) Exists(auth Auther, path []string) error
- func (n LeafValue) Get(auth Auther, path []string) ([]string, error)
- func (n LeafValue) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n LeafValue) GetSchema() schema.Node
- func (n LeafValue) GetStateJson(path []string) ([][]byte, error)
- func (n LeafValue) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n LeafValue) IsDefault(auth Auther, path []string) (bool, error)
- func (n LeafValue) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n LeafValue) MarshalInternalJSON(options ...UnionOption) []byte
- func (n LeafValue) Merge() *data.Node
- func (n LeafValue) MergeWithoutDefaults() *data.Node
- func (n LeafValue) Module() string
- func (n LeafValue) Name() string
- func (n LeafValue) NumChildren() int
- func (n LeafValue) Parent() Node
- func (n LeafValue) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n LeafValue) Set(auth Auther, path []string) error
- func (n LeafValue) Show(path []string, options ...UnionOption) (string, error)
- func (n LeafValue) SortedChildren() []Node
- func (n LeafValue) ToJSON(options ...UnionOption) []byte
- func (n LeafValue) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n LeafValue) ToRFC7951(options ...UnionOption) []byte
- func (n LeafValue) ToXML(rootName string, options ...UnionOption) []byte
- func (n LeafValue) Updated() bool
- func (n LeafValue) YangDataChildren() []datanode.DataNode
- func (n LeafValue) YangDataChildrenNoSorting() []datanode.DataNode
- func (n LeafValue) YangDataName() string
- func (n LeafValue) YangDataValues() []string
- func (n LeafValue) YangDataValuesNoSorting() []string
- type List
- func (n List) Added() bool
- func (n List) Changed() bool
- func (n List) Child(name string) Node
- func (n List) Children() map[string]Node
- func (n List) Data() *data.Node
- func (n List) Default() bool
- func (n List) Delete(auth Auther, path []string, checkAuth bool) error
- func (n List) Descendant(auth Auther, path []string) (Node, error)
- func (n List) Empty() bool
- func (n List) Exists(auth Auther, path []string) error
- func (n List) Get(auth Auther, path []string) ([]string, error)
- func (n List) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n List) GetSchema() schema.Node
- func (n List) GetStateJson(path []string) ([][]byte, error)
- func (n List) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n List) IsDefault(auth Auther, path []string) (bool, error)
- func (n List) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n List) MarshalInternalJSON(options ...UnionOption) []byte
- func (n List) Merge() *data.Node
- func (n List) MergeWithoutDefaults() *data.Node
- func (n List) Module() string
- func (n List) Name() string
- func (n List) NumChildren() int
- func (n List) Parent() Node
- func (n List) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n List) Set(auth Auther, path []string) error
- func (n List) Show(path []string, options ...UnionOption) (string, error)
- func (n List) SortedChildren() []Node
- func (n List) ToJSON(options ...UnionOption) []byte
- func (n List) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n List) ToRFC7951(options ...UnionOption) []byte
- func (n List) ToXML(rootName string, options ...UnionOption) []byte
- func (n List) Updated() bool
- func (n List) YangDataChildren() []datanode.DataNode
- func (n List) YangDataChildrenNoSorting() []datanode.DataNode
- func (n List) YangDataName() string
- func (n List) YangDataValues() []string
- func (n List) YangDataValuesNoSorting() []string
- type ListEntry
- func (n ListEntry) Added() bool
- func (n ListEntry) Changed() bool
- func (n ListEntry) Child(name string) Node
- func (n ListEntry) Children() map[string]Node
- func (n ListEntry) Data() *data.Node
- func (n ListEntry) Default() bool
- func (n ListEntry) Delete(auth Auther, path []string, checkAuth bool) error
- func (n ListEntry) Descendant(auth Auther, path []string) (Node, error)
- func (n ListEntry) Empty() bool
- func (n ListEntry) Exists(auth Auther, path []string) error
- func (n ListEntry) Get(auth Auther, path []string) ([]string, error)
- func (n ListEntry) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n ListEntry) GetSchema() schema.Node
- func (n ListEntry) GetStateJson(path []string) ([][]byte, error)
- func (n ListEntry) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n ListEntry) IsDefault(auth Auther, path []string) (bool, error)
- func (n ListEntry) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n ListEntry) MarshalInternalJSON(options ...UnionOption) []byte
- func (n ListEntry) Merge() *data.Node
- func (n ListEntry) MergeWithoutDefaults() *data.Node
- func (n ListEntry) Module() string
- func (n ListEntry) Name() string
- func (n ListEntry) NumChildren() int
- func (n ListEntry) Parent() Node
- func (n ListEntry) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n ListEntry) Set(auth Auther, path []string) error
- func (n ListEntry) Show(path []string, options ...UnionOption) (string, error)
- func (n ListEntry) SortedChildren() []Node
- func (n ListEntry) ToJSON(options ...UnionOption) []byte
- func (n ListEntry) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n ListEntry) ToRFC7951(options ...UnionOption) []byte
- func (n ListEntry) ToXML(rootName string, options ...UnionOption) []byte
- func (n ListEntry) Updated() bool
- func (n ListEntry) YangDataChildren() []datanode.DataNode
- func (n ListEntry) YangDataChildrenNoSorting() []datanode.DataNode
- func (n ListEntry) YangDataName() string
- func (n ListEntry) YangDataValues() []string
- func (n ListEntry) YangDataValuesNoSorting() []string
- type Node
- func NewNode(overlay, underlay *data.Node, sch schema.Node, parent Node, flags Flags) Node
- func UnmarshalJSON(schemaRoot schema.Node, jsonInput []byte) (Node, error)
- func UnmarshalJSONWithoutValidation(schemaRoot schema.Node, jsonInput []byte) (Node, error)
- func UnmarshalRFC7951(schemaRoot schema.Node, jsonInput []byte) (Node, error)
- func UnmarshalXML(schemaRoot schema.Node, xml_input []byte) (root Node, err error)
- type Root
- func (n Root) Added() bool
- func (n Root) Changed() bool
- func (n Root) Child(name string) Node
- func (n Root) Children() map[string]Node
- func (n Root) Data() *data.Node
- func (n Root) Default() bool
- func (n Root) Delete(auth Auther, path []string, checkAuth bool) error
- func (n Root) Descendant(auth Auther, path []string) (Node, error)
- func (n Root) Empty() bool
- func (n Root) Exists(auth Auther, path []string) error
- func (n Root) Get(auth Auther, path []string) ([]string, error)
- func (n Root) GetHelp(auth Auther, fromSchema bool, path []string) (map[string]string, error)
- func (n Root) GetSchema() schema.Node
- func (n Root) GetStateJson(path []string) ([][]byte, error)
- func (n Root) GetStateJsonWithWarnings(path []string, logger schema.StateLogger) ([][]byte, []error)
- func (n Root) IsDefault(auth Auther, path []string) (bool, error)
- func (n Root) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
- func (n Root) MarshalInternalJSON(options ...UnionOption) []byte
- func (n Root) Merge() *data.Node
- func (n Root) MergeWithoutDefaults() *data.Node
- func (n Root) Module() string
- func (n Root) Name() string
- func (n Root) NumChildren() int
- func (n Root) Parent() Node
- func (n Root) Serialize(b Serializer, path []string, options ...UnionOption)
- func (n Root) Set(auth Auther, path []string) error
- func (n Root) Show(path []string, options ...UnionOption) (string, error)
- func (n Root) SortedChildren() []Node
- func (n Root) ToJSON(options ...UnionOption) []byte
- func (n Root) ToNETCONF(rootName string, options ...UnionOption) []byte
- func (n Root) ToRFC7951(options ...UnionOption) []byte
- func (n Root) ToXML(rootName string, options ...UnionOption) []byte
- func (n Root) Updated() bool
- func (n Root) YangDataChildren() []datanode.DataNode
- func (n Root) YangDataChildrenNoSorting() []datanode.DataNode
- func (n Root) YangDataName() string
- func (n Root) YangDataValues() []string
- func (n Root) YangDataValuesNoSorting() []string
- type Serializer
- type StringWriter
- func (b *StringWriter) BeginContainer(n *Container, empty bool, level int)
- func (b *StringWriter) BeginLeaf(n *Leaf, empty bool, level int, hideSecrets bool)
- func (b *StringWriter) BeginLeafList(n *LeafList, empty bool, level int, hideSecrets bool)
- func (b *StringWriter) BeginList(n *List, empty bool, level int)
- func (b *StringWriter) BeginListEntry(n *ListEntry, empty bool, level int, hideSecrets bool)
- func (b *StringWriter) EndContainer(n *Container, empty bool, level int)
- func (b *StringWriter) EndLeaf(n *Leaf, empty bool, level int)
- func (b *StringWriter) EndLeafList(n *LeafList, empty bool, level int)
- func (b *StringWriter) EndList(n *List, empty bool, level int)
- func (b *StringWriter) EndListEntry(n *ListEntry, empty bool, level int)
- func (b *StringWriter) PrintSep()
- func (b *StringWriter) WriteLeafListValues(n *LeafList, empty bool, level int, hideSecrets bool)
- func (b *StringWriter) WriteLeafValue(n *Leaf, empty bool, level int, hideSecrets bool)
- type UnionOption
- type Unmarshaller
- type XMLWriter
- func (enc *XMLWriter) BeginContainer(n *Container, empty bool, level int)
- func (enc *XMLWriter) BeginLeaf(n *Leaf, empty bool, level int, hideSecrets bool)
- func (enc *XMLWriter) BeginLeafList(n *LeafList, empty bool, level int, hideSecrets bool)
- func (enc *XMLWriter) BeginList(n *List, empty bool, level int)
- func (enc *XMLWriter) BeginListEntry(n *ListEntry, empty bool, level int, hideSecrets bool)
- func (enc *XMLWriter) EndContainer(n *Container, empty bool, level int)
- func (enc *XMLWriter) EndLeaf(n *Leaf, empty bool, level int)
- func (enc *XMLWriter) EndLeafList(n *LeafList, empty bool, level int)
- func (enc *XMLWriter) EndList(n *List, empty bool, level int)
- func (enc *XMLWriter) EndListEntry(n *ListEntry, empty bool, level int)
- func (enc *XMLWriter) PrintSep()
- func (enc *XMLWriter) WriteLeafListValues(n *LeafList, empty bool, level int, hideSecrets bool)
- func (enc *XMLWriter) WriteLeafValue(n *Leaf, empty bool, level int, hideSecrets bool)
Constants ¶
const ( DontCheckAuth = false DontCare = false CheckAuth = true )
Variables ¶
This section is empty.
Functions ¶
func ForceShowSecrets ¶
func ForceShowSecrets(opts *unionOptions)
ForceShowSecrets forces secrets to not be filtered, even if the usual secret filtering logic would suggest they should be filtered.
func HideSecrets ¶
func HideSecrets(opts *unionOptions)
func IncludeDefaults ¶
func IncludeDefaults(opts *unionOptions)
func UnmarshalJSONConfigsWithoutValidation ¶
func UnmarshalJSONConfigsWithoutValidation( configs [][]byte, ms schema.ModelSet, ) (*data.Node, error)
UnmarshalJSONConfigsWithoutValidation - merge JSON configs into data tree Function is of type schema.ConfigMultiplexerFn
Only used for test (from configd) - so needs to be exported, and can't be exported from _test.go file as that doesn't work outside this package (only works for exporting from pkg foo to foo_test AFAICT).
func UnmarshalJSONIntoNodeWithoutValidation ¶
func UnmarshalJSONIntoNodeWithoutValidation( ut Node, cfgOrState encoding.ConfigOrState, jsonInput []byte, ) (err error)
Types ¶
type ByUser ¶
type ByUser []Node
Sorting interface for lists of Nodes. ByUser handles the ordered-by user semantics from the Yang spec this stores the list in the order they were inserted by the user. BySystem does natural sort order.
type Choice ¶
func (Choice) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (Choice) GetStateJson ¶
func (Choice) GetStateJsonWithWarnings ¶
func (n Choice) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (Choice) Marshal ¶
func (n Choice) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (Choice) MarshalInternalJSON ¶
func (n Choice) MarshalInternalJSON(options ...UnionOption) []byte
func (Choice) MergeWithoutDefaults ¶
func (Choice) NumChildren ¶
func (n Choice) NumChildren() int
func (Choice) Serialize ¶
func (n Choice) Serialize(b Serializer, path []string, options ...UnionOption)
func (Choice) SortedChildren ¶
func (n Choice) SortedChildren() []Node
func (Choice) ToJSON ¶
func (n Choice) ToJSON(options ...UnionOption) []byte
func (Choice) ToNETCONF ¶
func (n Choice) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (Choice) ToRFC7951 ¶
func (n Choice) ToRFC7951(options ...UnionOption) []byte
func (Choice) ToXML ¶
func (n Choice) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (Choice) YangDataChildren ¶
func (Choice) YangDataChildrenNoSorting ¶
func (Choice) YangDataName ¶
func (n Choice) YangDataName() string
func (Choice) YangDataValues ¶
func (n Choice) YangDataValues() []string
func (Choice) YangDataValuesNoSorting ¶
func (n Choice) YangDataValuesNoSorting() []string
type Container ¶
func NewContainer ¶
func (Container) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (Container) Descendant ¶
func (Container) GetStateJson ¶
func (Container) GetStateJsonWithWarnings ¶
func (n Container) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (Container) Marshal ¶
func (n Container) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (Container) MarshalInternalJSON ¶
func (n Container) MarshalInternalJSON(options ...UnionOption) []byte
func (Container) MergeWithoutDefaults ¶
func (Container) NumChildren ¶
func (n Container) NumChildren() int
func (Container) Serialize ¶
func (n Container) Serialize(b Serializer, path []string, options ...UnionOption)
func (Container) Show ¶
func (n Container) Show(path []string, options ...UnionOption) (string, error)
func (Container) SortedChildren ¶
func (n Container) SortedChildren() []Node
func (Container) ToJSON ¶
func (n Container) ToJSON(options ...UnionOption) []byte
func (Container) ToNETCONF ¶
func (n Container) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (Container) ToRFC7951 ¶
func (n Container) ToRFC7951(options ...UnionOption) []byte
func (Container) ToXML ¶
func (n Container) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (Container) YangDataChildren ¶
func (Container) YangDataChildrenNoSorting ¶
func (Container) YangDataName ¶
func (n Container) YangDataName() string
func (Container) YangDataValues ¶
func (n Container) YangDataValues() []string
func (Container) YangDataValuesNoSorting ¶
func (n Container) YangDataValuesNoSorting() []string
type InternalJSONWriter ¶
type InternalJSONWriter struct {
*JSONWriter
}
func (*InternalJSONWriter) BeginList ¶
func (b *InternalJSONWriter) BeginList(n *List, empty bool, level int)
func (*InternalJSONWriter) BeginListEntry ¶
func (b *InternalJSONWriter) BeginListEntry(n *ListEntry, empty bool, level int, hideSecrets bool)
type JSONWriter ¶
func (*JSONWriter) BeginContainer ¶
func (b *JSONWriter) BeginContainer(n *Container, empty bool, level int)
func (*JSONWriter) BeginLeaf ¶
func (b *JSONWriter) BeginLeaf(n *Leaf, empty bool, level int, hideSecrets bool)
func (*JSONWriter) BeginLeafList ¶
func (b *JSONWriter) BeginLeafList( n *LeafList, empty bool, level int, hideSecrets bool, )
func (*JSONWriter) BeginListEntry ¶
func (b *JSONWriter) BeginListEntry(n *ListEntry, empty bool, level int, hideSecrets bool)
func (*JSONWriter) EndContainer ¶
func (b *JSONWriter) EndContainer(n *Container, empty bool, level int)
func (*JSONWriter) EndLeafList ¶
func (b *JSONWriter) EndLeafList(n *LeafList, empty bool, level int)
func (*JSONWriter) EndListEntry ¶
func (b *JSONWriter) EndListEntry(n *ListEntry, empty bool, level int)
func (*JSONWriter) PrintSep ¶
func (b *JSONWriter) PrintSep()
func (*JSONWriter) WriteLeafListValues ¶
func (b *JSONWriter) WriteLeafListValues( n *LeafList, empty bool, level int, hideSecrets bool, )
func (*JSONWriter) WriteLeafValue ¶
func (b *JSONWriter) WriteLeafValue( n *Leaf, empty bool, level int, hideSecrets bool, )
type Leaf ¶
func (Leaf) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (Leaf) GetStateJson ¶
func (Leaf) GetStateJsonWithWarnings ¶
func (n Leaf) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (Leaf) Marshal ¶
func (n Leaf) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (Leaf) MarshalInternalJSON ¶
func (n Leaf) MarshalInternalJSON(options ...UnionOption) []byte
func (Leaf) MergeWithoutDefaults ¶
func (Leaf) NumChildren ¶
func (n Leaf) NumChildren() int
func (Leaf) Serialize ¶
func (n Leaf) Serialize(b Serializer, path []string, options ...UnionOption)
func (Leaf) SortedChildren ¶
func (n Leaf) SortedChildren() []Node
func (Leaf) ToJSON ¶
func (n Leaf) ToJSON(options ...UnionOption) []byte
func (Leaf) ToNETCONF ¶
func (n Leaf) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (Leaf) ToRFC7951 ¶
func (n Leaf) ToRFC7951(options ...UnionOption) []byte
func (Leaf) ToXML ¶
func (n Leaf) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (Leaf) YangDataChildren ¶
func (Leaf) YangDataChildrenNoSorting ¶
func (Leaf) YangDataName ¶
func (n Leaf) YangDataName() string
func (Leaf) YangDataValues ¶
func (n Leaf) YangDataValues() []string
func (Leaf) YangDataValuesNoSorting ¶
func (n Leaf) YangDataValuesNoSorting() []string
type LeafList ¶
func NewLeafList ¶
func (LeafList) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (LeafList) GetStateJson ¶
func (LeafList) GetStateJsonWithWarnings ¶
func (n LeafList) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (LeafList) Marshal ¶
func (n LeafList) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (LeafList) MarshalInternalJSON ¶
func (n LeafList) MarshalInternalJSON(options ...UnionOption) []byte
func (LeafList) MergeWithoutDefaults ¶
func (LeafList) NumChildren ¶
func (n LeafList) NumChildren() int
func (LeafList) Serialize ¶
func (n LeafList) Serialize(b Serializer, path []string, options ...UnionOption)
func (LeafList) Show ¶
func (n LeafList) Show(path []string, options ...UnionOption) (string, error)
func (LeafList) SortedChildren ¶
func (n LeafList) SortedChildren() []Node
func (LeafList) ToJSON ¶
func (n LeafList) ToJSON(options ...UnionOption) []byte
func (LeafList) ToNETCONF ¶
func (n LeafList) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (LeafList) ToRFC7951 ¶
func (n LeafList) ToRFC7951(options ...UnionOption) []byte
func (LeafList) ToXML ¶
func (n LeafList) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (LeafList) YangDataChildren ¶
func (LeafList) YangDataChildrenNoSorting ¶
func (LeafList) YangDataName ¶
func (n LeafList) YangDataName() string
func (LeafList) YangDataValues ¶
func (n LeafList) YangDataValues() []string
func (LeafList) YangDataValuesNoSorting ¶
func (n LeafList) YangDataValuesNoSorting() []string
type LeafValue ¶
func NewLeafValue ¶
func (LeafValue) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (LeafValue) Descendant ¶
func (LeafValue) GetStateJson ¶
func (LeafValue) GetStateJsonWithWarnings ¶
func (n LeafValue) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (LeafValue) Marshal ¶
func (n LeafValue) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (LeafValue) MarshalInternalJSON ¶
func (n LeafValue) MarshalInternalJSON(options ...UnionOption) []byte
func (LeafValue) MergeWithoutDefaults ¶
func (LeafValue) NumChildren ¶
func (n LeafValue) NumChildren() int
func (LeafValue) Serialize ¶
func (n LeafValue) Serialize(b Serializer, path []string, options ...UnionOption)
func (LeafValue) Show ¶
func (n LeafValue) Show(path []string, options ...UnionOption) (string, error)
func (LeafValue) SortedChildren ¶
func (n LeafValue) SortedChildren() []Node
func (LeafValue) ToJSON ¶
func (n LeafValue) ToJSON(options ...UnionOption) []byte
func (LeafValue) ToNETCONF ¶
func (n LeafValue) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (LeafValue) ToRFC7951 ¶
func (n LeafValue) ToRFC7951(options ...UnionOption) []byte
func (LeafValue) ToXML ¶
func (n LeafValue) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (LeafValue) YangDataChildren ¶
func (LeafValue) YangDataChildrenNoSorting ¶
func (LeafValue) YangDataName ¶
func (n LeafValue) YangDataName() string
func (LeafValue) YangDataValues ¶
func (n LeafValue) YangDataValues() []string
func (LeafValue) YangDataValuesNoSorting ¶
func (n LeafValue) YangDataValuesNoSorting() []string
type List ¶
func (List) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (List) GetStateJson ¶
func (List) GetStateJsonWithWarnings ¶
func (n List) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (List) Marshal ¶
func (n List) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (List) MarshalInternalJSON ¶
func (n List) MarshalInternalJSON(options ...UnionOption) []byte
func (List) MergeWithoutDefaults ¶
func (List) NumChildren ¶
func (n List) NumChildren() int
func (List) Serialize ¶
func (n List) Serialize(b Serializer, path []string, options ...UnionOption)
func (List) SortedChildren ¶
func (n List) SortedChildren() []Node
func (List) ToJSON ¶
func (n List) ToJSON(options ...UnionOption) []byte
func (List) ToNETCONF ¶
func (n List) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (List) ToRFC7951 ¶
func (n List) ToRFC7951(options ...UnionOption) []byte
func (List) ToXML ¶
func (n List) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (List) YangDataChildren ¶
func (List) YangDataChildrenNoSorting ¶
func (List) YangDataName ¶
func (n List) YangDataName() string
func (List) YangDataValues ¶
func (n List) YangDataValues() []string
func (List) YangDataValuesNoSorting ¶
func (n List) YangDataValuesNoSorting() []string
type ListEntry ¶
func NewListEntry ¶
func (ListEntry) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (ListEntry) Descendant ¶
func (ListEntry) GetStateJson ¶
func (ListEntry) GetStateJsonWithWarnings ¶
func (n ListEntry) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (ListEntry) Marshal ¶
func (n ListEntry) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (ListEntry) MarshalInternalJSON ¶
func (n ListEntry) MarshalInternalJSON(options ...UnionOption) []byte
func (ListEntry) MergeWithoutDefaults ¶
func (ListEntry) NumChildren ¶
func (n ListEntry) NumChildren() int
func (ListEntry) Serialize ¶
func (n ListEntry) Serialize(b Serializer, path []string, options ...UnionOption)
func (ListEntry) Show ¶
func (n ListEntry) Show(path []string, options ...UnionOption) (string, error)
func (ListEntry) SortedChildren ¶
func (n ListEntry) SortedChildren() []Node
func (ListEntry) ToJSON ¶
func (n ListEntry) ToJSON(options ...UnionOption) []byte
func (ListEntry) ToNETCONF ¶
func (n ListEntry) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (ListEntry) ToRFC7951 ¶
func (n ListEntry) ToRFC7951(options ...UnionOption) []byte
func (ListEntry) ToXML ¶
func (n ListEntry) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (ListEntry) YangDataChildren ¶
func (ListEntry) YangDataChildrenNoSorting ¶
func (ListEntry) YangDataName ¶
func (n ListEntry) YangDataName() string
func (ListEntry) YangDataValues ¶
func (n ListEntry) YangDataValues() []string
func (ListEntry) YangDataValuesNoSorting ¶
func (n ListEntry) YangDataValuesNoSorting() []string
type Node ¶
Node describes the full external API
func UnmarshalJSON ¶
Take the JSON message and create a UnionTree using the given schema and message content.
func UnmarshalRFC7951 ¶
type Root ¶
func (Root) Delete ¶
Two modes of operation:
- CheckAuth: check authorization on each node. Bottom up deletion - DontCheckAuth: propagate top level authorization. Top down deletion
func (Root) GetStateJson ¶
func (Root) GetStateJsonWithWarnings ¶
func (n Root) GetStateJsonWithWarnings( path []string, logger schema.StateLogger, ) ([][]byte, []error)
func (Root) Marshal ¶
func (n Root) Marshal(rootName, encoding string, options ...UnionOption) (string, error)
func (Root) MarshalInternalJSON ¶
func (n Root) MarshalInternalJSON(options ...UnionOption) []byte
func (Root) MergeWithoutDefaults ¶
func (Root) NumChildren ¶
func (n Root) NumChildren() int
func (Root) Serialize ¶
func (n Root) Serialize(b Serializer, path []string, options ...UnionOption)
func (Root) SortedChildren ¶
func (n Root) SortedChildren() []Node
func (Root) ToJSON ¶
func (n Root) ToJSON(options ...UnionOption) []byte
func (Root) ToNETCONF ¶
func (n Root) ToNETCONF(rootName string, options ...UnionOption) []byte
ToNETCONF - return <n> serialized in NETCONF format.
For 'netconf', we need to fill in the enclosing tags up to root, eg if <n> represents '/interfaces/dataplane/dp0s1/address', we need to return tags for interfaces, dataplane *and* tagnode (dp0s1)
func (Root) ToRFC7951 ¶
func (n Root) ToRFC7951(options ...UnionOption) []byte
func (Root) ToXML ¶
func (n Root) ToXML(rootName string, options ...UnionOption) []byte
ToXML - return <n> serialized in XML format.
For 'xml', we just return the node and entries under it, wrapped in the tag for the rootName.
func (Root) YangDataChildren ¶
func (Root) YangDataChildrenNoSorting ¶
func (Root) YangDataName ¶
func (n Root) YangDataName() string
func (Root) YangDataValues ¶
func (n Root) YangDataValues() []string
func (Root) YangDataValuesNoSorting ¶
func (n Root) YangDataValuesNoSorting() []string
type Serializer ¶
type Serializer interface { BeginContainer(n *Container, empty bool, level int) EndContainer(n *Container, empty bool, level int) BeginList(n *List, empty bool, level int) EndList(n *List, empty bool, level int) BeginListEntry(n *ListEntry, empty bool, level int, hidesecrets bool) EndListEntry(n *ListEntry, empty bool, level int) BeginLeaf(n *Leaf, empty bool, level int, hideSecrets bool) WriteLeafValue(n *Leaf, empty bool, level int, hideSecrets bool) EndLeaf(n *Leaf, empty bool, level int) BeginLeafList(n *LeafList, empty bool, level int, hideSecrets bool) WriteLeafListValues(n *LeafList, empty bool, level int, hideSecrets bool) EndLeafList(n *LeafList, empty bool, level int) PrintSep() }
type StringWriter ¶
func (*StringWriter) BeginContainer ¶
func (b *StringWriter) BeginContainer(n *Container, empty bool, level int)
func (*StringWriter) BeginLeaf ¶
func (b *StringWriter) BeginLeaf(n *Leaf, empty bool, level int, hideSecrets bool)
func (*StringWriter) BeginLeafList ¶
func (b *StringWriter) BeginLeafList(n *LeafList, empty bool, level int, hideSecrets bool)
func (*StringWriter) BeginListEntry ¶
func (b *StringWriter) BeginListEntry(n *ListEntry, empty bool, level int, hideSecrets bool)
func (*StringWriter) EndContainer ¶
func (b *StringWriter) EndContainer(n *Container, empty bool, level int)
func (*StringWriter) EndLeafList ¶
func (b *StringWriter) EndLeafList(n *LeafList, empty bool, level int)
func (*StringWriter) EndListEntry ¶
func (b *StringWriter) EndListEntry(n *ListEntry, empty bool, level int)
func (*StringWriter) PrintSep ¶
func (b *StringWriter) PrintSep()
func (*StringWriter) WriteLeafListValues ¶
func (b *StringWriter) WriteLeafListValues(n *LeafList, empty bool, level int, hideSecrets bool)
func (*StringWriter) WriteLeafValue ¶
func (b *StringWriter) WriteLeafValue(n *Leaf, empty bool, level int, hideSecrets bool)
type UnionOption ¶
type UnionOption func(*unionOptions)
func Authorizer ¶
func Authorizer(auth Auther) UnionOption
type Unmarshaller ¶
type Unmarshaller struct {
// contains filtered or unexported fields
}
We can completely avoid the rat's nest of ever increasing APIs for unmarshalling different encoding types with different validation requirements by using the generic unmarshaller interface provided by the 'encoder'.
func NewUnmarshaller ¶
func NewUnmarshaller(enc encoding.EncType) *Unmarshaller
func (*Unmarshaller) SetValidation ¶
func (um *Unmarshaller) SetValidation( valType yang.ValidationType, ) *Unmarshaller