package experiment
import "golang.org/x/pkgsite/internal/experiment"
Package experiment provides functionality for experiments.
Index ¶
- func IsActive(ctx context.Context, experiment string) bool
- func NewContext(ctx context.Context, experimentNames ...string) context.Context
- type Set
Functions ¶
func IsActive ¶
IsActive reports whether an experiment is active for this set.
func NewContext ¶
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 ¶
FromContext returns the set of experiments enabled for the context.
func NewSet ¶
NewSet creates a new experiment.Set with the data provided.
func (*Set) Active ¶
Active returns a list of all the active experiments in s.
func (*Set) IsActive ¶
IsActive reports whether an experiment is active for this set.
Source Files ¶
experiment.go
- Version
- v0.0.0-20250218150137-224a1368cf02 (latest)
- Published
- Feb 18, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 2 months ago –
Tools for package owners.