experiment

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusExperimental = "experimental"
	StatusPromoted     = "promoted"
	StatusDeprecated   = "deprecated"
)

Experiment status lifecycle constants.

Variables

This section is empty.

Functions

func DefaultEnabled

func DefaultEnabled() []string

DefaultEnabled returns the names of experiments whose Status is "promoted". These are merged into the active set before user flags unless explicitly disabled via -experiment-off=name.

func Enabled

func Enabled(name string) bool

func IsDeprecated

func IsDeprecated(name string) bool

IsDeprecated reports whether the named experiment's Status is "deprecated".

func IsPromoted

func IsPromoted(name string) bool

IsPromoted reports whether the named experiment's Status is "promoted".

func MergeEnabled

func MergeEnabled(base []string, extra []string, disabled []string) []string

func NamesForIntent

func NamesForIntent(intent string) []string

func ParseCSV

func ParseCSV(input string) []string

func SetCurrent

func SetCurrent(names []string)

Types

type Definition

type Definition struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Intent      string   `json:"intent,omitempty"`
	TargetRules []string `json:"targetRules,omitempty"`
	// Status is the lifecycle state of the experiment:
	//   "" or "experimental" — flag-gated, off by default (default behavior).
	//   "promoted"           — enabled by default; opt-out via -experiment-off=name.
	//   "deprecated"         — superseded/removed; kept for documentation. Warns
	//                          and is ignored if a user tries to enable it.
	Status string `json:"status,omitempty"`
}

func Definitions

func Definitions() []Definition

func Lookup

func Lookup(name string) (Definition, bool)

Lookup returns the Definition for name and whether it exists.

type MatrixCase

type MatrixCase struct {
	Name    string   `json:"name"`
	Enabled []string `json:"enabled"`
}

func BuildMatrix

func BuildMatrix(spec string, candidates []string) ([]MatrixCase, error)

type Set

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

func Current

func Current() Set

func NewSet

func NewSet(names []string) Set

func (Set) Enabled

func (s Set) Enabled(name string) bool

func (Set) Names

func (s Set) Names() []string

Jump to

Keyboard shortcuts

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