refactor: pass experiment arguments using a struct (#983)

Closes https://github.com/ooni/probe/issues/2358.
This commit is contained in:
Simone Basso 2022-11-22 10:43:47 +01:00 committed by GitHub
commit a0dc65641d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 824 additions and 481 deletions

View file

@ -124,10 +124,10 @@ const maxRuntime = 600 * time.Second
// set the relevant OONI error inside of the measurement and
// return nil. This is important because the caller may not submit
// the measurement if this method returns an error.
func (m *Measurer) Run(
ctx context.Context, sess model.ExperimentSession,
measurement *model.Measurement, callbacks model.ExperimentCallbacks,
) error {
func (m *Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error {
callbacks := args.Callbacks
measurement := args.Measurement
sess := args.Session
ptl, sfdialer, err := m.setup(ctx, sess.Logger())
if err != nil {
// we cannot setup the experiment