Documentation
¶
Index ¶
- type TestFramework
- type TestProvider
- func (tp TestProvider) BooleanEvaluation(ctx context.Context, flag string, defaultValue bool, ...) openfeature.BoolResolutionDetail
- func (tp TestProvider) Cleanup()
- func (tp TestProvider) FloatEvaluation(ctx context.Context, flag string, defaultValue float64, ...) openfeature.FloatResolutionDetail
- func (tp TestProvider) Hooks() []openfeature.Hook
- func (tp TestProvider) IntEvaluation(ctx context.Context, flag string, defaultValue int64, ...) openfeature.IntResolutionDetail
- func (tp TestProvider) Metadata() openfeature.Metadata
- func (tp TestProvider) ObjectEvaluation(ctx context.Context, flag string, defaultValue any, ...) openfeature.InterfaceResolutionDetail
- func (tp TestProvider) StringEvaluation(ctx context.Context, flag string, defaultValue string, ...) openfeature.StringResolutionDetail
- func (tp TestProvider) UsingFlags(test TestFramework, flags map[string]memprovider.InMemoryFlag)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestFramework ¶ added in v1.15.0
type TestFramework = interface{ Name() string }
UsingFlags sets flags for the scope of a test
type TestProvider ¶
type TestProvider struct {
openfeature.NoopProvider
// contains filtered or unexported fields
}
TestProvider is the recommended way to defined flags within the scope of a test. It uses the InMemoryProvider, with flags scoped per test. Before executing a test, specify the flag values to be used for the specific test using the UsingFlags function
func NewTestProvider ¶
func NewTestProvider() TestProvider
NewTestProvider creates a new `TestAwareProvider`
func (TestProvider) BooleanEvaluation ¶
func (tp TestProvider) BooleanEvaluation(ctx context.Context, flag string, defaultValue bool, flCtx openfeature.FlattenedContext) openfeature.BoolResolutionDetail
func (TestProvider) Cleanup ¶
func (tp TestProvider) Cleanup()
Cleanup deletes the flags provider bound to the current test and should be executed after each test execution e.g. using a defer statement.
func (TestProvider) FloatEvaluation ¶
func (tp TestProvider) FloatEvaluation(ctx context.Context, flag string, defaultValue float64, flCtx openfeature.FlattenedContext) openfeature.FloatResolutionDetail
func (TestProvider) Hooks ¶
func (tp TestProvider) Hooks() []openfeature.Hook
func (TestProvider) IntEvaluation ¶
func (tp TestProvider) IntEvaluation(ctx context.Context, flag string, defaultValue int64, flCtx openfeature.FlattenedContext) openfeature.IntResolutionDetail
func (TestProvider) Metadata ¶
func (tp TestProvider) Metadata() openfeature.Metadata
func (TestProvider) ObjectEvaluation ¶
func (tp TestProvider) ObjectEvaluation(ctx context.Context, flag string, defaultValue any, flCtx openfeature.FlattenedContext) openfeature.InterfaceResolutionDetail
func (TestProvider) StringEvaluation ¶
func (tp TestProvider) StringEvaluation(ctx context.Context, flag string, defaultValue string, flCtx openfeature.FlattenedContext) openfeature.StringResolutionDetail
func (TestProvider) UsingFlags ¶
func (tp TestProvider) UsingFlags(test TestFramework, flags map[string]memprovider.InMemoryFlag)
Click to show internal directories.
Click to hide internal directories.