2021-02-02 12:05:47 +01:00
|
|
|
package run
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter"
|
|
|
|
"github.com/ooni/probe-cli/v3/internal/engine/model"
|
|
|
|
)
|
|
|
|
|
2021-02-04 11:00:27 +01:00
|
|
|
type urlGetterMain struct{}
|
2021-02-02 12:05:47 +01:00
|
|
|
|
|
|
|
func (m *urlGetterMain) do(ctx context.Context, input StructuredInput,
|
|
|
|
sess model.ExperimentSession, measurement *model.Measurement,
|
|
|
|
callbacks model.ExperimentCallbacks) error {
|
|
|
|
exp := urlgetter.Measurer{
|
|
|
|
Config: input.URLGetter,
|
|
|
|
}
|
|
|
|
measurement.TestName = exp.ExperimentName()
|
|
|
|
measurement.TestVersion = exp.ExperimentVersion()
|
|
|
|
measurement.Input = model.MeasurementTarget(input.Input)
|
|
|
|
return exp.Run(ctx, sess, measurement, callbacks)
|
|
|
|
}
|