experiments

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Name

type Name string
const (

	// LocalSecretsOverride is an experiment to allow for secrets
	// to be overridden with values from a ".secrets.local" file.
	LocalSecretsOverride Name = "local-secrets-override"

	// Metrics is an experiment to enable metrics.
	Metrics Name = "metrics"

	// V2 enables the new parser and compiler.
	V2 Name = "v2"

	// BetaRuntime enables the beta runtime.
	BetaRuntime Name = "beta-runtime"
)

func (Name) Enabled

func (x Name) Enabled(set *Set) bool

Enabled returns true if this experiment enabled in the given set

func (Name) Valid

func (x Name) Valid() bool

Valid reports whether the given name is a known experiment.

type Set

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

func NewSet

func NewSet(fromAppFile []Name, environ []string) (*Set, error)

NewSet creates an experiment set which represents the enabled experiments within a particular run of Encore.

All errors reported by NewSet are due to unknown experiment names. The error type is of type *UnknownExperimentError.

func (*Set) List

func (s *Set) List() []Name

func (*Set) StringList added in v1.14.5

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

type UnknownExperimentError

type UnknownExperimentError struct {
	Name Name
}

UnknownExperimentError is an error returned when an app tries to use an experiment that is not known to the current version of Encore.

func (*UnknownExperimentError) Error

func (e *UnknownExperimentError) Error() string

Jump to

Keyboard shortcuts

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