ooni-probe-cli/internal/engine/experiment/run/urlgetter.go

28 lines
713 B
Go

package run
import (
"context"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/urlgetter"
"github.com/ooni/probe-cli/v3/internal/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)
args := &model.ExperimentArgs{
Callbacks: callbacks,
Measurement: measurement,
Session: sess,
}
return exp.Run(ctx, args)
}