Documentation ¶
Overview ¶
Package registry contains a registry of all the available experiments.
Index ¶
- Variables
- func CanonicalizeExperimentName(name string) string
- func ExperimentNames() (names []string)
- type Factory
- func (b *Factory) InputPolicy() model.InputPolicy
- func (b *Factory) Interruptible() bool
- func (b *Factory) NewExperimentMeasurer() model.ExperimentMeasurer
- func (b *Factory) Options() (map[string]model.ExperimentOptionInfo, error)
- func (b *Factory) SetOptionAny(key string, value any) error
- func (b *Factory) SetOptionsAny(options map[string]any) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrConfigIsNotAStructPointer indicates we expected a pointer to struct. ErrConfigIsNotAStructPointer = errors.New("config is not a struct pointer") // ErrNoSuchField indicates there's no field with the given name. ErrNoSuchField = errors.New("no such field") // ErrCannotSetIntegerOption means SetOptionAny couldn't set an integer option. ErrCannotSetIntegerOption = errors.New("cannot set integer option") // ErrInvalidStringRepresentationOfBool indicates the string you passed // to SetOptionaAny is not a valid string representation of a bool. ErrInvalidStringRepresentationOfBool = errors.New("invalid string representation of bool") // ErrCannotSetBoolOption means SetOptionAny couldn't set a bool option. ErrCannotSetBoolOption = errors.New("cannot set bool option") // ErrCannotSetStringOption means SetOptionAny couldn't set a string option. ErrCannotSetStringOption = errors.New("cannot set string option") // ErrUnsupportedOptionType means we don't support the type passed to // the SetOptionAny method as an opaque any type. ErrUnsupportedOptionType = errors.New("unsupported option type") )
var AllExperiments = map[string]*Factory{}
Where we register all the available experiments.
var ErrNoSuchExperiment = errors.New("no such experiment")
ErrNoSuchExperiment indicates a given experiment does not exist.
Functions ¶
func CanonicalizeExperimentName ¶
CanonicalizeExperimentName allows code to provide experiment names in a more flexible way, where we have aliases.
Because we allow for uppercase experiment names for backwards compatibility with MK, we need to add some exceptions here when mapping (e.g., DNSCheck => dnscheck).
func ExperimentNames ¶
func ExperimentNames() (names []string)
ExperimentNames returns the name of all experiments
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory allows to construct an experiment measurer.
func NewFactory ¶
NewFactory creates a new Factory instance.
func (*Factory) InputPolicy ¶
func (b *Factory) InputPolicy() model.InputPolicy
InputPolicy returns the experiment's InputPolicy.
func (*Factory) Interruptible ¶
Interruptible returns whether the experiment is interruptible.
func (*Factory) NewExperimentMeasurer ¶
func (b *Factory) NewExperimentMeasurer() model.ExperimentMeasurer
NewExperimentMeasurer creates the experiment
func (*Factory) Options ¶
func (b *Factory) Options() (map[string]model.ExperimentOptionInfo, error)
Options returns the options exposed by this experiment.
func (*Factory) SetOptionAny ¶
SetOptionAny sets an option given any value.
Source Files ¶
- allexperiments.go
- dash.go
- dnscheck.go
- dnsping.go
- doc.go
- echcheck.go
- example.go
- factory.go
- fbmessenger.go
- hhfm.go
- hirl.go
- httphostheader.go
- ndt.go
- portfiltering.go
- psiphon.go
- quicping.go
- riseupvpn.go
- run.go
- signal.go
- simplequicping.go
- sniblocking.go
- stunreachability.go
- tcpping.go
- telegram.go
- tlsmiddlebox.go
- tlsping.go
- tlstool.go
- tor.go
- torsf.go
- urlgetter.go
- vanillator.go
- webconnectivity.go
- webconnectivityv05.go
- whatsapp.go