refactor(engine): allow scripts to register experiments (#860)
See https://github.com/ooni/probe/issues/2216
This commit is contained in:
@@ -16,7 +16,7 @@ func (n DNSCheck) lookupURLs(ctl *Controller) ([]string, error) {
|
||||
// not needed because we have default static input in the engine
|
||||
},
|
||||
ExperimentName: "dnscheck",
|
||||
InputPolicy: engine.InputOrStaticDefault,
|
||||
InputPolicy: model.InputOrStaticDefault,
|
||||
Session: ctl.Session,
|
||||
SourceFiles: ctl.InputFiles,
|
||||
StaticInputs: ctl.Inputs,
|
||||
|
||||
@@ -123,7 +123,7 @@ func (c *Controller) SetNettestIndex(i, n int) {
|
||||
//
|
||||
// This function will continue to run in most cases but will
|
||||
// immediately halt if something's wrong with the file system.
|
||||
func (c *Controller) Run(builder engine.ExperimentBuilder, inputs []string) error {
|
||||
func (c *Controller) Run(builder model.ExperimentBuilder, inputs []string) error {
|
||||
// This will configure the controller as handler for the callbacks
|
||||
// called by ooni/probe-engine/experiment.Experiment.
|
||||
builder.SetCallbacks(model.ExperimentCallbacks(c))
|
||||
|
||||
@@ -16,7 +16,7 @@ func (n STUNReachability) lookupURLs(ctl *Controller) ([]string, error) {
|
||||
// not needed because we have default static input in the engine
|
||||
},
|
||||
ExperimentName: "stunreachability",
|
||||
InputPolicy: engine.InputOrStaticDefault,
|
||||
InputPolicy: model.InputOrStaticDefault,
|
||||
Session: ctl.Session,
|
||||
SourceFiles: ctl.InputFiles,
|
||||
StaticInputs: ctl.Inputs,
|
||||
|
||||
@@ -22,7 +22,7 @@ func (n WebConnectivity) lookupURLs(ctl *Controller, categories []string) ([]str
|
||||
},
|
||||
},
|
||||
ExperimentName: "web_connectivity",
|
||||
InputPolicy: engine.InputOrQueryBackend,
|
||||
InputPolicy: model.InputOrQueryBackend,
|
||||
Session: ctl.Session,
|
||||
SourceFiles: ctl.InputFiles,
|
||||
StaticInputs: ctl.Inputs,
|
||||
|
||||
Reference in New Issue
Block a user