pkg/sr: update for new APIs and to be forward compatible #548
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With an HTTP API, the API can add query parameters periodically, any addition of which breaks a Go API where all query parameters are spelled out as method arguments.
Now, we have moved all query parameters into values in a context, and added a helper sr.WithParams to make it easy to build parameters. All APIs document which parameters they support. We also have global parameters on the client itself, if you always want to show deleted or something.
This also adds metadata and ruleset to the schema type, even though the validation of these is really only possible in the Java client (as documented via limitations).
Lastly, this adds support for a few missing APIs:
This breaks all CompatibilityLevel APIs, since the compatibility level stuff has been expanded to a whole bunch of compatibility / configuration settings. Namely, we just drop the "Level".
This breaks all APIs that had ShowHideDeleted arguments, favoring instead the new ShowDeleted Param.
We keep the DeleteHow param, because it is important at call sites to see that you are using hard deletion.