Documentation ¶
Overview ¶
Package registry contains a registry of all the available experiments.
Index ¶
- Constants
- Variables
- 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) NewTargetLoader(config *model.ExperimentTargetLoaderConfig) model.ExperimentTargetLoader
- 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
- func (b *Factory) SetOptionsJSON(value json.RawMessage) error
- type Session
Constants ¶
const OONI_FORCE_ENABLE_EXPERIMENT = "OONI_FORCE_ENABLE_EXPERIMENT"
OONI_FORCE_ENABLE_EXPERIMENT is the name of the environment variable you should set to "1" to bypass the algorithm preventing disabled by default experiments to be instantiated.
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]func() *Factory{}
Where we register all the available experiments.
var ErrNoSuchExperiment = errors.New("no such experiment")
ErrNoSuchExperiment indicates a given experiment does not exist.
var ErrRequiresForceEnable = errors.New("experiment not enabled by check-in API")
ErrRequiresForceEnable is returned for experiments that are not enabled by default and are also not enabled by the most recent check-in API call.
Functions ¶
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 a new model.ExperimentMeasurer instance.
func (*Factory) NewTargetLoader ¶ added in v0.30.0
func (b *Factory) NewTargetLoader(config *model.ExperimentTargetLoaderConfig) model.ExperimentTargetLoader
NewTargetLoader creates a new model.ExperimentTargetLoader instance.
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.
func (*Factory) SetOptionsAny ¶
SetOptionsAny calls SetOptionAny for each entry inside [options].
func (*Factory) SetOptionsJSON ¶ added in v0.30.0
func (b *Factory) SetOptionsJSON(value json.RawMessage) error
SetOptionsJSON unmarshals the given json.RawMessage inside the experiment specific configuration.
type Session ¶ added in v0.30.0
type Session = model.ExperimentTargetLoaderSession
Session is the session definition according to this package.
Source Files ¶
- allexperiments.go
- dash.go
- dnscheck.go
- dnsping.go
- doc.go
- dslxtutorial.go
- echcheck.go
- example.go
- factory.go
- fbmessenger.go
- hhfm.go
- hirl.go
- httphostheader.go
- ndt.go
- openvpn.go
- portfiltering.go
- psiphon.go
- quicping.go
- riseupvpn.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