Closed Kavindu-Dodan closed 3 months ago
Attention: Patch coverage is 91.66667%
with 9 lines
in your changes are missing coverage. Please review.
Project coverage is 81.92%. Comparing base (
aeb4f6c
) to head (c7ede79
).
Files | Patch % | Lines |
---|---|---|
openfeature/client.go | 72.22% | 5 Missing :warning: |
openfeature/openfeature_api.go | 93.33% | 2 Missing and 2 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
sorry for the slow response on this, and thanks for merging it!
This PR
Partially address #266 by providing interface contracts for the SDK. There are no breaking changes in this change
I have introduced
IEvaluation
interface, which represents the general OpenFeatuer API layer [1]. Before this change, there was no such interface so mocking API interactions was impossible. To obtain the singleton instance ofIEvaluation
interface, I have introducedGetApiInstance()
helper.Consider the example below,
In the future, we can update our documentation to make API instance based operations the preferred interaction method.
Further,
IEvaluation
exposes client creation methodsGetClient()
&GetNamedClient(clientName string)
(similar to spec [2]). These methods returnIClient
instances, making it easy to test OpenFeature client related operations.[1] - https://openfeature.dev/specification/sections/flag-evaluation [2] - https://openfeature.dev/specification/sections/flag-evaluation#creating-clients