featureflags

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configured

func Configured(client Client, cfg commoncfg.FeatureFlags) bool

Configured reports whether feature flags are active for this deployment: a non-nil client is present AND the deployment enabled feature flags. It mirrors the guard in Init.

This matters because NewClient always returns a non-nil client, even when no provider is registered. Callers must check the config flag too before trusting flag lookups; otherwise every lookup resolves to its default value.

func Init

func Init(cfg commoncfg.FeatureFlags) error

Init registers the EmbeddedProvider as the global OpenFeature provider when cfg.Enabled is true. It is a no-op when feature flags are disabled.

Types

type Client

type Client interface {
	BooleanValue(
		ctx context.Context, flag string, defaultValue bool, evalCtx openfeature.EvaluationContext,
	) (bool, error)
}

Client abstracts OpenFeature boolean flag evaluation.

func NewClient

func NewClient() Client

NewClient returns a Client backed by the global OpenFeature provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL