26d807c50f
See https://github.com/ooni/probe-engine/issues/1181 While there, run `go fmt ./...`
23 lines
634 B
Go
23 lines
634 B
Go
package run
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter"
|
|
"github.com/ooni/probe-cli/v3/internal/engine/model"
|
|
)
|
|
|
|
type urlGetterMain struct{}
|
|
|
|
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)
|
|
}
|