Open shushukl-cisco opened 4 years ago
What is the format of the JSON input that you have? There are two sets of functions that might be of interest in ygot for this:
ygot.StringToStructuredPath
-- this will take an input path string (per this spec) and convert it to a gnmi.Path
protobuf message.<generated package>.Unmarshal
combined with ygot.TogNMINotifications
-- this will allow you to unmarshal an RFC7951-compliant JSON output into a ygot-generated Go struct, the TogNMINotifications
will then marshal its contents as a set of gnmi.Notification
messages containing both the path and value.Cheers, r.
Hi,
I want to generate proto inputs in this format from a json equivalent. Is there a way to do so?
path: < elem: < name: "a"
Or is there some proto structure / library I can use to dynamically populate proto structures like the above?