-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PathStruct definition and child ctor generating code for ypathgen (…
…#315) * Add PathStruct definition and child constructor generating code for ypathgen. 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: - ygot/path_types.go defines the base struct and interface to be implemented by every path struct node. - KeyValueAsString() is enhanced to allow ygen.Binary to be converted to a string for use by gNMI as a list key value. - A GetDirectories() call is added to ygen for retrieving a parsed map of 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. - The configuration struct for ygen code generation is reorganized. - pathgen.go contains the child path struct constructor generation code. * gofmt gogen_test.go
- Loading branch information
Showing
18 changed files
with
1,668 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.