Documentation
¶
Overview ¶
Package ofrep provides a OpenFeature Provider for interacting with the OFREP service using the OpenFeature Go SDK.
Index ¶
- func WithApiKeyAuth(token string) func(*outbound.Configuration)
- func WithBaseURI(baseURI string) func(*outbound.Configuration)
- func WithBearerToken(token string) func(*outbound.Configuration)
- func WithClient(client *http.Client) func(configuration *outbound.Configuration)
- func WithHeader(key, value string) func(*outbound.Configuration)
- func WithHeaderProvider(callback outbound.HeaderCallback) func(*outbound.Configuration)
- func WithTimeout(timeout time.Duration) func(*outbound.Configuration)
- type Evaluator
- type Option
- type Provider
- func (p Provider) BooleanEvaluation(ctx context.Context, flag string, defaultValue bool, ...) openfeature.BoolResolutionDetail
- func (p Provider) FloatEvaluation(ctx context.Context, flag string, defaultValue float64, ...) openfeature.FloatResolutionDetail
- func (p Provider) Hooks() []openfeature.Hook
- func (p Provider) IntEvaluation(ctx context.Context, flag string, defaultValue int64, ...) openfeature.IntResolutionDetail
- func (p Provider) Metadata() openfeature.Metadata
- func (p Provider) ObjectEvaluation(ctx context.Context, flag string, defaultValue any, ...) openfeature.ObjectResolutionDetail
- func (p Provider) StringEvaluation(ctx context.Context, flag string, defaultValue string, ...) openfeature.StringResolutionDetail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithApiKeyAuth ¶
func WithApiKeyAuth(token string) func(*outbound.Configuration)
WithApiKeyAuth allows to set token to be used for api key authorization
func WithBaseURI ¶
func WithBaseURI(baseURI string) func(*outbound.Configuration)
WithBaseURI allows to override the base URI of the OFREP service
func WithBearerToken ¶
func WithBearerToken(token string) func(*outbound.Configuration)
WithBearerToken allows to set token to be used for bearer token authorization
func WithClient ¶
func WithClient(client *http.Client) func(configuration *outbound.Configuration)
WithClient allows to provide a pre-configured http.Client for the communication with the OFREP service
func WithHeader ¶
func WithHeader(key, value string) func(*outbound.Configuration)
WithHeader allows to set a custom header
func WithHeaderProvider ¶
func WithHeaderProvider(callback outbound.HeaderCallback) func(*outbound.Configuration)
WithHeaderProvider allows to configure a custom header callback to set a custom authorization header
func WithTimeout ¶
func WithTimeout(timeout time.Duration) func(*outbound.Configuration)
WithTimeout allows to configure the timeout for the http client used for communication with the OFREP service. This option is ignored if a custom client is provided via WithClient.
Types ¶
type Evaluator ¶
type Evaluator interface {
ResolveBoolean(ctx context.Context, key string, defaultValue bool,
evalCtx map[string]any) of.BoolResolutionDetail
ResolveString(ctx context.Context, key string, defaultValue string,
evalCtx map[string]any) of.StringResolutionDetail
ResolveFloat(ctx context.Context, key string, defaultValue float64,
evalCtx map[string]any) of.FloatResolutionDetail
ResolveInt(ctx context.Context, key string, defaultValue int64,
evalCtx map[string]any) of.IntResolutionDetail
ResolveObject(ctx context.Context, key string, defaultValue any,
evalCtx map[string]any) of.ObjectResolutionDetail
}
Evaluator contract for flag evaluation
type Option ¶
type Option func(*outbound.Configuration)
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implementation for OFREP
func NewProvider ¶
NewProvider returns an OFREP provider configured with provided configuration.
func (Provider) BooleanEvaluation ¶
func (p Provider) BooleanEvaluation(ctx context.Context, flag string, defaultValue bool, evalCtx openfeature.FlattenedContext) openfeature.BoolResolutionDetail
func (Provider) FloatEvaluation ¶
func (p Provider) FloatEvaluation(ctx context.Context, flag string, defaultValue float64, evalCtx openfeature.FlattenedContext) openfeature.FloatResolutionDetail
func (Provider) Hooks ¶
func (p Provider) Hooks() []openfeature.Hook
func (Provider) IntEvaluation ¶
func (p Provider) IntEvaluation(ctx context.Context, flag string, defaultValue int64, evalCtx openfeature.FlattenedContext) openfeature.IntResolutionDetail
func (Provider) Metadata ¶
func (p Provider) Metadata() openfeature.Metadata
func (Provider) ObjectEvaluation ¶
func (p Provider) ObjectEvaluation(ctx context.Context, flag string, defaultValue any, evalCtx openfeature.FlattenedContext) openfeature.ObjectResolutionDetail
func (Provider) StringEvaluation ¶
func (p Provider) StringEvaluation(ctx context.Context, flag string, defaultValue string, evalCtx openfeature.FlattenedContext) openfeature.StringResolutionDetail