Documentation
¶
Index ¶
- type EvalFlagRequest
- type EvaluationContextRequest
- type GenericResolutionDetail
- type JsonType
- type Provider
- func (p *Provider) BooleanEvaluation(_ context.Context, flag string, defaultValue bool, evalCtx of.FlattenedContext) of.BoolResolutionDetail
- func (p *Provider) FloatEvaluation(_ context.Context, flag string, defaultValue float64, ...) of.FloatResolutionDetail
- func (p *Provider) Hooks() []of.Hook
- func (p *Provider) Init(_ of.EvaluationContext) error
- func (p *Provider) IntEvaluation(_ context.Context, flag string, defaultValue int64, ...) of.IntResolutionDetail
- func (p *Provider) Metadata() of.Metadata
- func (p *Provider) ObjectEvaluation(_ context.Context, flag string, defaultValue interface{}, ...) of.InterfaceResolutionDetail
- func (p *Provider) Shutdown()
- func (p *Provider) StringEvaluation(_ context.Context, flag string, defaultValue string, ...) of.StringResolutionDetail
- type ProviderOptions
- type UserRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvalFlagRequest ¶
type EvalFlagRequest struct { // User The representation of a user for your feature flag system. // Deprecated: User please use EvaluationContext instead User *UserRequest `json:"user" xml:"user" form:"user" query:"user"` // EvaluationContext the context to evaluate the flag. EvaluationContext *EvaluationContextRequest `` /* 139-byte string literal not displayed */ // The value will we use if we are not able to get the variation of the flag. DefaultValue interface{} `json:"defaultValue" xml:"defaultValue" form:"defaultValue" query:"defaultValue"` }
func NewEvalFlagRequest ¶
func NewEvalFlagRequest[T JsonType](flatCtx of.FlattenedContext, defaultValue T) (EvalFlagRequest, *of.ResolutionError)
type EvaluationContextRequest ¶
type EvaluationContextRequest struct { // Key is the identifier of the UserRequest. Key string `json:"key" xml:"key" form:"key" query:"key" example:"08b5ffb7-7109-42f4-a6f2-b85560fbd20f"` // Custom is a map containing all extra information for this user. Custom map[string]interface{} `` // nolint: lll /* 178-byte string literal not displayed */ }
EvaluationContextRequest The representation of the evaluation context.
type GenericResolutionDetail ¶
type GenericResolutionDetail[T JsonType] struct { Value T of.ProviderResolutionDetail }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the OpenFeature provider for GO Feature Flag.
func NewProvider ¶
func NewProvider(options ProviderOptions) (*Provider, error)
NewProvider allows you to create a GO Feature Flag provider without any context. We recommend using the function NewProviderWithContext and provide your context when creating the provider.
func NewProviderWithContext ¶
func NewProviderWithContext(ctx context.Context, options ProviderOptions) (*Provider, error)
NewProviderWithContext is the easiest way of creating a new GO Feature Flag provider.
func (*Provider) BooleanEvaluation ¶
func (p *Provider) BooleanEvaluation(_ context.Context, flag string, defaultValue bool, evalCtx of.FlattenedContext) of.BoolResolutionDetail
func (*Provider) FloatEvaluation ¶
func (p *Provider) FloatEvaluation(_ context.Context, flag string, defaultValue float64, evalCtx of.FlattenedContext) of.FloatResolutionDetail
func (*Provider) Hooks ¶
Hooks is returning an empty array because GO Feature Flag does not use any hooks.
func (*Provider) IntEvaluation ¶
func (p *Provider) IntEvaluation(_ context.Context, flag string, defaultValue int64, evalCtx of.FlattenedContext) of.IntResolutionDetail
func (*Provider) ObjectEvaluation ¶
func (p *Provider) ObjectEvaluation(_ context.Context, flag string, defaultValue interface{}, evalCtx of.FlattenedContext) of.InterfaceResolutionDetail
func (*Provider) StringEvaluation ¶
func (p *Provider) StringEvaluation(_ context.Context, flag string, defaultValue string, evalCtx of.FlattenedContext) of.StringResolutionDetail
type ProviderOptions ¶
type ProviderOptions struct { // GOFeatureFlagConfig is the configuration struct for the GO Feature Flag module. // If not nil we will launch the provider using the GO Feature Flag module. GOFeatureFlagConfig *ffclient.Config }
ProviderOptions is the struct containing the provider options you can use while initializing GO Feature Flag. To have a valid configuration you need to have an Endpoint or GOFeatureFlagConfig set.
type UserRequest ¶
type UserRequest struct { // Key is the identifier of the UserRequest. Key string `json:"key" xml:"key" form:"key" query:"key" example:"08b5ffb7-7109-42f4-a6f2-b85560fbd20f"` // Anonymous set if this is a logged-in user or not. Anonymous bool `json:"anonymous" xml:"anonymous" form:"anonymous" query:"anonymous" example:"false"` // Custom is a map containing all extra information for this user. Custom map[string]interface{} `` // nolint: lll /* 178-byte string literal not displayed */ }
UserRequest The representation of a user for your feature flag system.