refactor(engine): allow scripts to register experiments (#860)
See https://github.com/ooni/probe/issues/2216
This commit is contained in:
parent
69602abe8a
commit
6a0ae5c70b
53 changed files with 1438 additions and 1200 deletions
22
internal/registry/httphostheader.go
Normal file
22
internal/registry/httphostheader.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package registry
|
||||
|
||||
//
|
||||
// Registers the `httphostheader' experiment.
|
||||
//
|
||||
|
||||
import (
|
||||
"github.com/ooni/probe-cli/v3/internal/engine/experiment/httphostheader"
|
||||
"github.com/ooni/probe-cli/v3/internal/model"
|
||||
)
|
||||
|
||||
func init() {
|
||||
allexperiments["http_host_header"] = &Factory{
|
||||
build: func(config interface{}) model.ExperimentMeasurer {
|
||||
return httphostheader.NewExperimentMeasurer(
|
||||
*config.(*httphostheader.Config),
|
||||
)
|
||||
},
|
||||
config: &httphostheader.Config{},
|
||||
inputPolicy: model.InputOrQueryBackend,
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue