A tool used to configure the ygot generator via a simple yaml file.
- Create a
test.yaml
where you specify your ygot configuration.
---
generator_options:
- option: package_name
value: openconfig
- 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
- Let
go-ygot-generator-generator
generate to go file that can be used withgo generate
.
go-yang-generator-generator test.yaml test.go
go generate test.go