Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/bucketeer-io/openfeature-go-server-sdk
go 1.24.2

require (
github.com/bucketeer-io/go-server-sdk v1.5.5
github.com/bucketeer-io/go-server-sdk v1.5.6-0.20250515121938-9e1d5ff17a1d
github.com/open-feature/go-sdk v1.14.1
github.com/stretchr/testify v1.10.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bucketeer-io/bucketeer v1.3.0 h1:ge+rc+TfzWMx3VBJbzUQg/1nl/fQFBZYojQ/7JVUYRU=
github.com/bucketeer-io/bucketeer v1.3.0/go.mod h1:StIY3RFNVH5HHftNFizB1sN1TMC9M7MwVyV9y6Dcvso=
github.com/bucketeer-io/go-server-sdk v1.5.5 h1:W3ZrZLQMl+m6adsWWiDQbAeBgkLXiIj+jFL6cr1V7Zs=
github.com/bucketeer-io/go-server-sdk v1.5.5/go.mod h1:2nqgq8KLjdtCPUv/P9IcO0R33Mt5igjQiXYgqcp2Afs=
github.com/bucketeer-io/go-server-sdk v1.5.6-0.20250515121938-9e1d5ff17a1d h1:i/jzjeGbogQ7PrPLA/JVezbjxl/SOzrxkdjkcv/MXuI=
github.com/bucketeer-io/go-server-sdk v1.5.6-0.20250515121938-9e1d5ff17a1d/go.mod h1:2nqgq8KLjdtCPUv/P9IcO0R33Mt5igjQiXYgqcp2Afs=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
Expand Down
6 changes: 6 additions & 0 deletions pkg/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/bucketeer-io/go-server-sdk/pkg/bucketeer/model"
"github.com/bucketeer-io/go-server-sdk/pkg/bucketeer/user"

"github.com/bucketeer-io/openfeature-go-server-sdk/pkg/version"

"github.com/open-feature/go-sdk/openfeature"
)

Expand Down Expand Up @@ -61,6 +63,8 @@ func NewProviderWithContext(
ctx context.Context,
opts ProviderOptions,
) (*Provider, error) {
opts = append(opts, bucketeer.WithWrapperSDKVersion(version.SDKVersion))
opts = append(opts, bucketeer.WithWrapperSourceID(sourceIDOpenFeatureGo.Int32()))
sdk, err := bucketeer.NewSDK(ctx, opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -90,6 +94,8 @@ func convertReason(reason model.EvaluationReason) openfeature.Reason {
return openfeature.Reason(reason)
case model.EvaluationReasonDefault:
return openfeature.DefaultReason
// TODO: Remove ReasonClient
// nolint:staticcheck
case model.EvaluationReasonClient:
return openfeature.StaticReason
case model.EvaluationReasonOffVariation:
Expand Down
6 changes: 3 additions & 3 deletions pkg/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (

// newTestProvider is a helper function that creates a Provider with a mock SDK for testing
func newTestProvider(mockSDK BucketeerSDK) *Provider {
provider, _ := NewProvider(ProviderOptions{})
provider.sdk = mockSDK
return provider
return &Provider{
sdk: mockSDK,
}
}

// mockBucketeerSDK implements BucketeerSDK interface for testing
Expand Down
11 changes: 11 additions & 0 deletions pkg/source_id.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package provider

type sourceIDType int32

const (
sourceIDOpenFeatureGo sourceIDType = 103
)

func (s sourceIDType) Int32() int32 {
return int32(s)
}