openfeature

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DivergeHook

type DivergeHook struct {
	of.UnimplementedHook
	// contains filtered or unexported fields
}

DivergeHook is an OpenFeature hook that enriches the EvaluationContext with Diverge preview environment metadata.

func NewDivergeHook

func NewDivergeHook(opts ...Option) *DivergeHook

NewDivergeHook creates a new DivergeHook with optional configuration.

func (*DivergeHook) Before

func (h *DivergeHook) Before(ctx context.Context, hookCtx of.HookContext, hints of.HookHints) (*of.EvaluationContext, error)

Before executes prior to flag evaluation, injecting diverge.environment and diverge.is_preview into EvaluationContext.

type Option

type Option func(*DivergeHook)

Option is a functional option for configuring DivergeHook.

func WithFallbackEnvironment

func WithFallbackEnvironment(fallback string) Option

WithFallbackEnvironment sets a default environment if none is found in the context or process env.

Jump to

Keyboard shortcuts

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