experiment

package
v0.0.0-...-642d756 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package experiment provides functionality for experiments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsActive

func IsActive(ctx context.Context, experiment string) bool

IsActive reports whether an experiment is active for this set.

func NewContext

func NewContext(ctx context.Context, experimentNames ...string) context.Context

NewContext stores a set constructed from the provided experiment names in the context.

Types

type Set

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

Set is the set of experiments that are enabled for a request.

func FromContext

func FromContext(ctx context.Context) *Set

FromContext returns the set of experiments enabled for the context.

func NewSet

func NewSet(experimentNames ...string) *Set

NewSet creates a new experiment.Set with the data provided.

func (*Set) Active

func (s *Set) Active() []string

Active returns a list of all the active experiments in s.

func (*Set) IsActive

func (s *Set) IsActive(experiment string) bool

IsActive reports whether an experiment is active for this set.

Jump to

Keyboard shortcuts

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