feat(webconnectivity): long-term-evolution prototype (#882)

See https://github.com/ooni/probe/issues/2237
This commit is contained in:
Simone Basso
2022-08-26 16:42:48 +02:00
committed by GitHub
parent 9ba6f8dcbb
commit 1a1d3126ae
20 changed files with 3067 additions and 1 deletions
+2 -1
View File
@@ -215,7 +215,8 @@ func CanonicalizeExperimentName(name string) string {
// NewFactory creates a new Factory instance.
func NewFactory(name string) (*Factory, error) {
factory := allexperiments[CanonicalizeExperimentName(name)]
name = CanonicalizeExperimentName(name)
factory := allexperiments[name]
if factory == nil {
return nil, fmt.Errorf("no such experiment: %s", name)
}
+27
View File
@@ -0,0 +1,27 @@
package registry
//
// Registers the `web_connectivity@v0.5' experiment.
//
// See https://github.com/ooni/probe/issues/2237
//
import (
"github.com/ooni/probe-cli/v3/internal/experiment/webconnectivity"
"github.com/ooni/probe-cli/v3/internal/model"
)
func init() {
// Note: the name inserted into the table is the canonicalized experiment
// name though we advertise using `web_connectivity@v0.5`.
allexperiments["web_connectivity@v_0_5"] = &Factory{
build: func(config any) model.ExperimentMeasurer {
return webconnectivity.NewExperimentMeasurer(
config.(*webconnectivity.Config),
)
},
config: &webconnectivity.Config{},
interruptible: false,
inputPolicy: model.InputOrQueryBackend,
}
}