I’m writing a backend datasource plugin in go and there is a lot of json being passed around. It’s easy enough to do this:
var model map[string]interface{}
json.Unmarshal([]byte(tsdbReq.Queries[0].ModelJson), &model)
but it seems like there must be actual models somewhere for either that, or at least for the more detailed objects once you get past queryType. I wrote a findMetrics() method but I don’t really want to pass it unstructured json. What I’d prefer to know is what are the interface for the actual, expected object; then I can marshal to the correct thing and limit the amount of time I spend without type safety.
Can anybody point me to these interfaces, if they exist?
–Chris