sapcc / go-api-declarations

Reusable declarations for Go types appearing in our APIs
Apache License 2.0
3 stars 0 forks source link

liquid: add support for rates #33

Closed majewsky closed 2 months ago

majewsky commented 2 months ago

This is modeled on the existing QuotaPlugin.ScrapeRates facility in Limes. The rate scraping and resource scraping are currently split in Limes, but I intend to merge them into one loop since there never was any benefit from keeping them separate (and it just creates a bunch of useless parallel structures).

The remark about SerializedState not working for liquids that have resources is because, in Limes, serializedState is only carried through ScrapeRates and not through Scrape (the latter of which handles resources).

I also used the opportunity to add some more omitempty in usage reports where they make sense. This is a backwards-compatible change because Limes does not care either way about map fields being omitted or null.