Documentation
¶
Overview ¶
Package memprovider provides an in-memory feature flag provider for OpenFeature.
Index ¶
- type ContextEvaluator
- type InMemoryEvent
- type InMemoryFlag
- type InMemoryProvider
- func (i InMemoryProvider) BooleanEvaluation(ctx context.Context, flag string, defaultValue bool, ...) openfeature.BoolResolutionDetail
- func (i InMemoryProvider) FloatEvaluation(ctx context.Context, flag string, defaultValue float64, ...) openfeature.FloatResolutionDetail
- func (i InMemoryProvider) Hooks() []openfeature.Hook
- func (i InMemoryProvider) IntEvaluation(ctx context.Context, flag string, defaultValue int64, ...) openfeature.IntResolutionDetail
- func (i InMemoryProvider) Metadata() openfeature.Metadata
- func (i InMemoryProvider) ObjectEvaluation(ctx context.Context, flag string, defaultValue any, ...) openfeature.InterfaceResolutionDetail
- func (i InMemoryProvider) StringEvaluation(ctx context.Context, flag string, defaultValue string, ...) openfeature.StringResolutionDetail
- func (i InMemoryProvider) Track(ctx context.Context, trackingEventName string, ...)
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextEvaluator ¶
type ContextEvaluator *func(this InMemoryFlag, flatCtx openfeature.FlattenedContext) (any, openfeature.ProviderResolutionDetail)
ContextEvaluator is a callback to perform openfeature.EvaluationContext backed evaluations. This is a callback implemented by the flag definer.
type InMemoryEvent ¶ added in v1.14.0
type InMemoryFlag ¶
type InMemoryFlag struct {
Key string
State State
DefaultVariant string
Variants map[string]any
ContextEvaluator ContextEvaluator
}
InMemoryFlag is the feature flag representation accepted by InMemoryProvider
func (*InMemoryFlag) Resolve ¶
func (flag *InMemoryFlag) Resolve(defaultValue any, flatCtx openfeature.FlattenedContext) ( any, openfeature.ProviderResolutionDetail, )
type InMemoryProvider ¶
type InMemoryProvider struct {
// contains filtered or unexported fields
}
func NewInMemoryProvider ¶
func NewInMemoryProvider(from map[string]InMemoryFlag) InMemoryProvider
func (InMemoryProvider) BooleanEvaluation ¶
func (i InMemoryProvider) BooleanEvaluation(ctx context.Context, flag string, defaultValue bool, flatCtx openfeature.FlattenedContext) openfeature.BoolResolutionDetail
func (InMemoryProvider) FloatEvaluation ¶
func (i InMemoryProvider) FloatEvaluation(ctx context.Context, flag string, defaultValue float64, flatCtx openfeature.FlattenedContext) openfeature.FloatResolutionDetail
func (InMemoryProvider) Hooks ¶
func (i InMemoryProvider) Hooks() []openfeature.Hook
func (InMemoryProvider) IntEvaluation ¶
func (i InMemoryProvider) IntEvaluation(ctx context.Context, flag string, defaultValue int64, flatCtx openfeature.FlattenedContext) openfeature.IntResolutionDetail
func (InMemoryProvider) Metadata ¶
func (i InMemoryProvider) Metadata() openfeature.Metadata
func (InMemoryProvider) ObjectEvaluation ¶
func (i InMemoryProvider) ObjectEvaluation(ctx context.Context, flag string, defaultValue any, flatCtx openfeature.FlattenedContext) openfeature.InterfaceResolutionDetail
func (InMemoryProvider) StringEvaluation ¶
func (i InMemoryProvider) StringEvaluation(ctx context.Context, flag string, defaultValue string, flatCtx openfeature.FlattenedContext) openfeature.StringResolutionDetail
func (InMemoryProvider) Track ¶ added in v1.14.0
func (i InMemoryProvider) Track(ctx context.Context, trackingEventName string, evalCtx openfeature.EvaluationContext, details openfeature.TrackingEventDetails)
Click to show internal directories.
Click to hide internal directories.