https://github.com/andresterba/go-ygot-generator-generator
https://github.com/andresterba/go-ygot-generator-generator
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/andresterba/go-ygot-generator-generator
- Owner: andresterba
- License: mit
- Created: 2022-05-11T15:38:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-02T16:44:44.000Z (about 2 years ago)
- Last Synced: 2024-06-20T01:56:08.091Z (almost 2 years ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-ygot-generator-generator
A tool used to configure the [ygot](https://github.com/openconfig/ygot#generating-go-structures-from-yang) generator via a simple yaml file.
## Usage
1. Create a `test.yaml` where you specify your ygot configuration.
```yaml
---
generator_options:
- option: output_file
value: ./yang.go
- option: include_model_data
value: true
- option: generate_fakeroot
value: true
- option: fakeroot_name
value: device
- option: exclude_modules
value: ietf-interfaces
models:
- ../../../models/openconfig/release/models/system/openconfig-system.yang
- ../../../models/openconfig/release/models/interfaces/openconfig-interfaces.yang
- ../../../models/openconfig/release/models/interfaces/openconfig-if-ethernet.yang
- ../../../models/openconfig/release/models/interfaces/openconfig-if-ip.yang
path_to_generator: ../../../build-tools/generator
path_to_models: ../../../models/openconfig
```
2. Let `go-ygot-generator-generator` generate the go file that can be used with `go generate`.
```sh
go-yang-generator-generator test.yaml test.go
go generate test.go
```