Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PathStruct definition and child ctor generating code for ypathgen #315

Merged
merged 2 commits into from
Oct 1, 2019

Commits on Sep 26, 2019

  1. Add PathStruct definition and child constructor generating code for y…

    …pathgen.
    
    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.
    wenovus committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    0f89119 View commit details
    Browse the repository at this point in the history
  2. gofmt gogen_test.go

    wenovus committed Sep 26, 2019
    Configuration menu
    Copy the full SHA
    a930971 View commit details
    Browse the repository at this point in the history