package
0.29.22
Repository: https://github.com/openconfig/ygot.git
Documentation: pkg.go.dev

# Functions

AppendErr appends err to errors if it is not nil and returns the result.
AppendErrs appends newErrs to errors and returns the result.
Children returns all child elements of a directory element e that are not RPC entries.
ChildSchema returns the schema for the struct field f, if f contains a valid path tag and the schema path is found in the schema tree.
ChildSchemaPreferShadow returns the shadow schema (if exists) or schema for the struct field f, if f contains a valid "shadow-path" or "path" tag and the schema path is found in the schema tree.
ComparePaths returns the set relation between two paths.
DataSchemaTreesString outputs a combined data/schema tree string where schema is displayed alongside the data tree e.g.
DbgErr DbgPrints err and returns it.
DbgPrint prints v if the package global variable debugLibrary is set.
DbgSchema prints v if the package global variable debugSchema is set.
Dedent decreases DbgPrint Indent level.
DeepEqualDerefPtrs compares the values of a and b.
DefaultWalkOptions initialize a WalkOptions.
DefiningType returns the type of definition of a subtype within a leaf type.
EnumeratedUnionTypes recursively searches the set of yang.YangTypes supplied to extract the enumerated types that are within a union.
FindFirstNonChoiceOrCase recursively traverses the schema tree and returns a map with the set of the first nodes in every path that are neither case nor choice nodes.
FindLeafRefSchema returns a schema Entry at the path pathStr relative to schema if it exists, or an error otherwise.
FindModelData takes an input slice of yang.Entry pointers, which are assumed to represent YANG modules, and returns the gNMI ModelData that corresponds with each of the input modules.
FindPathElemPrefix finds the longest common prefix of the paths specified.
FirstChild returns the first child entry that matches path from the given root.
FlattenedTypes returns in tree order (in-order) the subtypes of a union type.
ForEachDataField iterates the value supplied and calls the iterFunction for each data tree node found in the supplied value.
ForEachDataField2 is an improved ForEachDataField that allows iteration over the data tree in the supplied value with custom iteration behaviour at each iteration step.
ForEachField recursively iterates through the fields of value (which may be any Go type) and executes iterFunction on each field.
GetNodes returns the nodes in the data tree at the indicated path, relative to the supplied root and their corresponding schemas at the same slice index.
HasOnlyChild returns true if the directory passed to it only has a single element below it.
Indent increases DbgPrint Indent level.
InitializeStructField initializes the given field in the given struct.
InsertIntoMap inserts value with key into parent which must be a map.
InsertIntoMapStructField inserts fieldValue into a field of type map in parentStruct called fieldName (which must exist, but may be nil), using the given key.
InsertIntoSlice inserts value into parent which must be a slice ptr.
InsertIntoSliceStructField inserts fieldValue into a field of type slice in parentStruct called fieldName (which must exist, but may be nil).
InsertIntoStruct updates a field called fieldName (which must exist, but may be nil) in parentStruct, with value fieldValue.
IsAnydata returns true if the entry is an Anydata node.
IsChoiceOrCase returns true if the entry is either a 'case' or a 'choice' node within the schema.
IsCompressedSchema determines whether the yang.Entry s provided is part of a generated set of structs that have schema compression enabled.
IsConfig takes a yang.Entry and traverses up the tree to find the config state of that element.
IsConfigState returns true if the entry is an entity that represents a container called config or state.
IsDirectEntryChild determines whether the entry c is a direct child of the entry p within the output code.
IsEnumeratedType returns true if the entry is an enumerated type within the YANG schema - i.e., an enumeration or identityref leaf.
IsFakeRoot reports whether the supplied yang.Entry represents the synthesised root entity in the generated code.
IsIdentityrefLeaf returns true if the supplied yang.Entry represents an identityref.
IsKeyedList returns true if the supplied yang.Entry represents a keyed list.
IsLeafRef reports whether schema is a leafref schema node type.
IsNilOrInvalidValue reports whether v is nil or reflect.Zero.
IsOCCompressedValidElement returns true if the element would be output in the compressed YANG code.
IsRoot returns true if the entry is an entity at the root of the tree.
IsSimpleEnumerationType returns true when the type supplied is a simple enumeration (i.e., a leaf that is defined as type enumeration { ..
IsStructValueWithNFields returns true if the reflect.Value representing a struct v has n fields.
IsTypeInterface reports whether v is an interface.
IsTypeMap reports whether v is a map type.
IsTypeSlice reports whether v is a slice type.
IsTypeSliceOfInterface reports whether v is a slice of interface.
IsTypeSlicePtr reports whether v is a slice ptr type.
IsTypeStruct reports whether t is a struct type.
IsTypeStructPtr reports whether v is a struct ptr type.
IsUnionType returns true if the entry is a union within the YANG schema, checked by determining the length of the Type slice within the YangType.
IsUnkeyedList reports whether e is an unkeyed list.
IsValueInterface reports whether v is an interface type.
IsValueInterfaceToStructPtr reports whether v is an interface that contains a pointer to a struct.
IsValueMap reports whether v is a map type.
IsValueNil returns true if either value is nil, or has dynamic type {ptr, map, slice} with value nil.
IsValueNilOrDefault returns true if either IsValueNil(value) or the default value for the type.
IsValuePtr reports whether v is a ptr type.
IsValueScalar reports whether v is a scalar type.
IsValueSlice reports whether v is a slice type.
IsValueStruct reports whether v is a struct type.
IsValueStructPtr reports whether v is a struct ptr type.
IsValueTypeCompatible reports whether f.Set(v) can be called successfully on a struct field f with type t.
IsYANGBaseType determines whether the supplied YangType is a built-in type in YANG, or a derived type (i.e., typedef).
IsYangPresence reports whether struct field s is a YANG presence container.
IsYgotAnnotation reports whether struct field s is an annotation field.
JoinPaths joins an prefix and suffix paths, returning an error if their target or origin fields are both non-empty but don't match.
ListKeyFieldsMap returns a map[string]bool where the keys of the map are the fields that are the keys of the list described by the supplied yang.Entry.
NewErrs returns a slice of error with a single element err.
PathElemsEqual replaces the proto.Equal() check for PathElems.
PathElemSlicesEqual compares whether two PathElem slices are equal.
PathMatchesPathElemPrefix checks whether prefix is a prefix of path.
PathMatchesPrefix reports whether prefix is a prefix of path.
PathMatchesQuery returns whether query is prefix of path.
PathPartiallyMatchesPrefix reports whether the path partially or wholly matches the prefix.
PathStringToElements splits the string s, which represents a gNMI string path into its constituent elements.
PopGNMIPath returns the supplied GNMI path with the first path element removed.
PrefixErrors prefixes each error within the supplied Errors slice with the string pfx.
RelativeSchemaPath returns a path to the schema for the struct field f.
RelativeSchemaPathPreferShadow returns a shadow path (if exists) or path to the schema for the struct field f.
ReplacePathSuffix replaces the non-prefix part of a prefixed path name, or the whole path name otherwise.
ResetIndent sets the indent level to zero.
ResolveIfLeafRef returns a ptr to the schema pointed to by the leaf-ref path in schema if it's a leafref, or schema itself if it's not.
SanitizedPattern returns the values of the posix-pattern extension statements for the YangType.
SchemaEntryPathNoChoiceCase takes an input yang.Entry and walks up the tree to find its path, expressed as a slice of Entrys, which is returned.
SchemaPathNoChoiceCase takes an input yang.Entry and walks up the tree to find its path, expressed as a slice of strings, which is returned.
SchemaPaths returns all the paths in the path tag.
SchemaTreePath returns the schema tree path of the supplied yang.Entry skipping any nodes that are themselves not in the path (e.g., choice and case).
SchemaTreePathNoModule takes an input yang.Entry, and returns its YANG schema path.
SchemaTreeString returns the schema hierarchy tree as a string with node names and types only e.g.
SchemaTypeStr returns a string representation of the type of element schema represents e.g.
ShadowSchemaPaths returns all the paths in the shadow-path tag.
SlicePathToString concatenates a slice of strings into a / separated path.
SplitPath splits path across unescaped /.
StripModulePrefix removes the prefix from a YANG path element, and the string format is invalid, simply returns the argument.
StripModulePrefixesStr returns "in" with each element with the format "A:B" changed to "B".
TopLevelModule returns the module in which the root node of the schema tree in which the input node was instantiated was declared.
ToString returns a string representation of errors.
TrimGNMIPathElemPrefix returns the path with the prefix trimmed.
TrimGNMIPathPrefix returns path with the prefix trimmed.
UniqueErrors returns the unique errors from the supplied Errors slice.
UpdateField updates a field called fieldName (which must exist, but may be nil) in parentStruct, with value fieldValue.
ValuesAreSameType returns true if v1 and v2 has the same reflect.Type, otherwise it returns false.
ValueStr returns a string representation of value which may be a value, ptr, or struct type.
ValueStrDebug returns "<not calculated>" if the package global variable debugLibrary is not set.
Walk traverses the nodes with a customized visitor.
WalkNodeFromGoStruct converts a GoStruct to WalkNode with empty schema.
WalkNodeFromNodeInfo converts a NodeInfo to WalkNode.
YangIntTypeBits returns the number of bits for a YANG int type.
YangTypeToDebugString returns a debug string representation of a YangType.

# Constants

CompressedSchemaAnnotation stores the name of the annotation indicating whether a set of structs were built with -compress_path.
ContinueIteration means to continue the preorder traversal.
Disjoint means the paths do not overlap at all.
DoNotIterateDescendants means to continue traversal but skip the descendant elements of this subtree node.
Equal means the paths are the same.
PartialIntersect means a path partial overlaps the other.
Subset means a path is strictly smaller than the other.
Superset means a path is strictly larger than the other.

# Structs

DefaultWalkErrors is the default WalkErrors used unless overwritten via WithWalkErrors.
NodeInfo describes a node in a tree being traversed.
PathQueryNodeMemo caches previous path queries done against a particular node.
PathQueryResult stores a datanode query result.
WalkOptions are configurations of the Walk function.

# Interfaces

Visitor has a visit method that is invoked for each node encountered by Walk.
WalkErrors is an abstraction of collecting Errors during the util.Walk.
WalkNode is an abstraction of NodeInfo during the util.Walk.

# Type aliases

CompareRelation describes of the relation between to gNMI paths.
Errors is a slice of error.
FieldIteratorFunc is an iteration function for arbitrary field traversals.
FieldIteratorFunc2 is an iteration function for arbitrary field traversals.
IterationAction is an enumeration representing different iteration actions.
PathQueryMemo caches nodes retrieved from (string) path queries.