Skip to content

Commit

Permalink
fixup! solidify interfaces to match OF API & client
Browse files Browse the repository at this point in the history
  • Loading branch information
Kavindu-Dodan committed May 1, 2024
1 parent 8a6ae70 commit a6c2c55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ While you may use global methods to interact with the API, it is recommended to
openfeature.SetProvider(myProvider)

// singleton instance - preferred
apiInstance := openfeature.GetAPIInstance()
apiInstance := openfeature.GetApiInstance()
apiInstance.SetProvider(myProvider)
```

Expand All @@ -388,7 +388,7 @@ Similarly, while you have options (due to historical reasons) to create a client
openfeature.NewClient("myClient")

// using API instance - preferred
apiInstance := openfeature.GetAPIInstance()
apiInstance := openfeature.GetApiInstance()
apiInstance.GetClient()
apiInstance.GetNamedClient("myClient")
```
Expand Down
4 changes: 2 additions & 2 deletions openfeature/openfeature.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func initSingleton() {
api = NewEvaluationAPI(exec, logger)
}

// GetAPIInstance returns the current singleton IOFApi instance
func GetAPIInstance() IOFApi {
// GetApiInstance returns the current singleton IOFApi instance
func GetApiInstance() IOFApi {
return api
}

Expand Down
2 changes: 1 addition & 1 deletion openfeature/openfeature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestRequirement_1_1_1(t *testing.T) {
mockProvider := NewMockFeatureProvider(ctrl)
mockProvider.EXPECT().Metadata().AnyTimes()

ofAPI := GetAPIInstance()
ofAPI := GetApiInstance()

// set through instance level
err := ofAPI.SetProvider(mockProvider)
Expand Down

0 comments on commit a6c2c55

Please sign in to comment.