Add PathStruct definition and child ctor generating code for ypathgen #315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first step to a generating library (ypathgen) alongside ygen
which generates an API for creating YANG paths given a set of YANG
schema files. While ygen creates a set of structs for storing the data
of a YANG tree, ypathgen creates a set of structs for generating paths
denoting nodes in a YANG tree. This avoids any manual construction of
paths.
Envisioned API example:
oc.Interface("eth0").Counters().InOctets()
Each selector constructs and returns a child struct that keeps track of
the absolute path it represents.
This change includes the generation of these child constructors.
List of primary changes:
implemented by every path struct node.
a string for use by gNMI as a list key value.
Directory elements for use by the ypathgen generation library. The
output of this function is very similar to part of what ygen uses for
its generation.