hooks

package
v7.14.5 Latest Latest
Warning

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

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

Documentation

Overview

Package hooks is an internal package containing implementations to run hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationExecution

type EvaluationExecution struct {
	// contains filtered or unexported fields
}

EvaluationExecution represents the state of a running series of evaluation stages.

func (*EvaluationExecution) AfterEvaluation

func (e *EvaluationExecution) AfterEvaluation(
	ctx gocontext.Context,
	detail ldreason.EvaluationDetail,
)

AfterEvaluation executes the AfterEvaluation stage of registered hooks.

func (*EvaluationExecution) BeforeEvaluation

func (e *EvaluationExecution) BeforeEvaluation(ctx gocontext.Context)

BeforeEvaluation executes the BeforeEvaluation stage of registered hooks.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner manages the registration and execution of hooks.

func NewRunner

func NewRunner(
	loggers ldlog.Loggers,
	hooks []ldhooks.Hook,
	environmentIDProvider internal.EnvironmentIDProvider,
) *Runner

NewRunner creates a new hook runner.

func (*Runner) RunEvaluation

func (h *Runner) RunEvaluation(
	ctx gocontext.Context,
	flagKey string,
	evalContext ldcontext.Context,
	defaultVal ldvalue.Value,
	method string,
	fn func() (ldreason.EvaluationDetail, *ldmodel.FeatureFlag, error),
) (ldreason.EvaluationDetail, *ldmodel.FeatureFlag, error)

RunEvaluation runs the evaluation series surrounding the given evaluation function.

func (*Runner) RunTrack added in v7.12.0

func (h *Runner) RunTrack(
	ctx gocontext.Context,
	key string,
	trackContext ldcontext.Context,
	metricValue *float64,
	data ldvalue.Value,
	fn func(),
)

RunTrack runs the track series after the given track function.

type TrackExecution added in v7.12.0

type TrackExecution struct {
	// contains filtered or unexported fields
}

TrackExecution represents the state of a running series of track stages.

func (*TrackExecution) AfterTrack added in v7.12.0

func (t *TrackExecution) AfterTrack(ctx gocontext.Context)

AfterTrack executes the AfterTrack stage of registered hooks.

Jump to

Keyboard shortcuts

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