refactor(engine): allow scripts to register experiments (#860)

See https://github.com/ooni/probe/issues/2216
This commit is contained in:
Simone Basso 2022-08-17 10:57:03 +02:00 committed by GitHub
commit 6a0ae5c70b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 1438 additions and 1200 deletions

View file

@ -0,0 +1,23 @@
package registry
//
// Registers the `web_connectivity' experiment.
//
import (
"github.com/ooni/probe-cli/v3/internal/engine/experiment/webconnectivity"
"github.com/ooni/probe-cli/v3/internal/model"
)
func init() {
allexperiments["web_connectivity"] = &Factory{
build: func(config any) model.ExperimentMeasurer {
return webconnectivity.NewExperimentMeasurer(
config.(webconnectivity.Config),
)
},
config: &webconnectivity.Config{},
interruptible: false,
inputPolicy: model.InputOrQueryBackend,
}
}