github.com/openconfig/goyang@v1.4.5/README.md (about)

     1  ![Go](https://github.com/openconfig/goyang/workflows/Go/badge.svg?branch=master)
     2  [![Coverage Status](https://coveralls.io/repos/github/openconfig/goyang/badge.svg?branch=master)](https://coveralls.io/github/openconfig/goyang?branch=master)
     3  
     4  Current support for `goyang` is for the [latest 3 Go releases](https://golang.org/project/#release).
     5  
     6  # goyang
     7  YANG parser and compiler for Go programs.
     8  
     9  The yang package (pkg/yang) is used to convert a YANG schema into either an
    10  in memory abstract syntax trees (ast) or more fully resolved, in memory, "Entry"
    11  trees.  An Entry tree consists only of Entry structures and has had
    12  augmentation, imports, and includes all applied.
    13  
    14  goyang is a sample program that uses the yang (pkg/yang) package.
    15  
    16  goyang uses the yang package to create an in-memory tree representation of
    17  schemas defined in YANG and then dumps out the contents in several forms.
    18  The forms include:
    19  
    20  *  tree - a simple tree representation
    21  *  types - list understood types extracted from the schema
    22  
    23  The yang package, and the goyang program, are not complete and are a work in
    24  progress.
    25  
    26  For more complex output types, such as Go structs, and protobuf messages
    27  please use the [openconfig/ygot](https://github.com/openconfig/ygot) package,
    28  which uses this package as its backend.
    29  
    30  ### Getting started
    31  
    32  To build goyang, ensure you have go language tools installed
    33  (available at [golang.org](https://golang.org/dl)) and that the `GOPATH`
    34  environment variable is set to your Go workspace.
    35  
    36  1. `go get github.com/openconfig/goyang`
    37      * This will download goyang code and dependencies into the src
    38  subdirectory in your workspace.
    39  
    40  2. `cd <workspace>/src/github.com/openconfig/goyang`
    41  
    42  3. `go build`
    43  
    44     * This will build the goyang binary and place it in the bin
    45  subdirectory in your workspace.
    46  
    47  ### Contributing to goyang
    48  
    49  goyang is still a work-in-progress and we welcome contributions.  Please see
    50  the `CONTRIBUTING` file for information about how to contribute to the codebase.
    51  
    52  ### Disclaimer
    53  
    54  This is not an official Google product.