-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Required Version API Call #177
Comments
My initial idea was to split this SDK along major versions of Grafana. So, |
I'm not sure if I mentioned this, I'm working on a dashboard manager that uses this SDK to communicate with Grafana. What I was thinking of doing is inspecting the server version and then based on the version fail a bit more gracefully. A 404 or a stack trace isn't really that helpful over say unsupported version, you need to upgrade for feature X. As long as you can import multiple versions of the API without conflicts that's fine. My concern is that for elastic there's usually not much of a use case where you're trying to support v6, v7 and v8 in the same code base. There's two items that I find to be missing in the SDK.
I'm sure it's not very Go like, particularly since Go doesn't have annotations but my idea would be (My java background tainting me is showing up here) @Version(min=6.0, max=8.0) If we can try to have some patterns where we can try to ensure we can import multiple versions without too many issues, the /v6 /v7 IS a much cleaner implementation. Just voicing my concerns with that path. Anyways, It would be REALLY nice to have an API definition from Grafana one of these days. It would make this whole versioning thing a bit easier to handle. Anyways sorry for that rant, hopefully there's some value in this. Naturally i'm voicing my need specifically. It is a library so the common pattern should be given preference. |
This is more of a conversational starter than an issue, but I was wondering if there was a way to implement a behavior where we can tag the various API calls with a minimum/max version.
Aka we know that. client.GetHealth() requires grafana version X, so if grafana version is set either through a init method, or via an API call where state is populated, we would fail the SDK call more gracefully.
Any thoughts?
The text was updated successfully, but these errors were encountered: