ooni-probe-cli/internal/engine
Simone Basso 086ae43b15
refactor(engine): set options from any value (#837)
This diff refactors how we set options for experiments to accept
in input an any value or a map[string]any, depending on which method
we choose to actually set options.

There should be no functional change, except that now we're not
guessing the type and then attempting to set the value of the selected
field: now, instead, we match the provided type and the field's type
as part of the same function (i.e., SetOptionAny).

This diff is functional to https://github.com/ooni/probe/issues/2184,
because it will allow us to load options from a map[string]any,
which will be part of the OONI Run v2 JSON descriptor.

If we didn't apply this change, we would only have been to set options
from a map[string]string, which is good enough as a solution for the
CLI but is definitely clumsy when you have to write stuff like:

```JSON
{
  "options": {
    "HTTP3Enabled": "true"
  }
}
```

when you could instead more naturally write:

```JSON
{
  "options": {
    "HTTP3Enabled": true
  }
}
```
2022-07-08 11:51:59 +02:00
..
experiment feat: tlsping and tcpping using step-by-step (#815) 2022-07-01 12:22:22 +02:00
geolocate cleanup: use NewHTTPTransportWithResolver more often (#808) 2022-06-08 15:13:01 +02:00
internal/sessionresolver refactor(sessionresolver): replace dnsclientmaker with function (#811) 2022-06-08 22:29:01 +02:00
mockable refactor(engine): *http.Client -> model.HTTPClient (#836) 2022-07-08 11:08:10 +02:00
netx feat: tlsping and tcpping using step-by-step (#815) 2022-07-01 12:22:22 +02:00
probeservices refactor(engine): *http.Client -> model.HTTPClient (#836) 2022-07-08 11:08:10 +02:00
testdata fix: add missing files causing tests to fail (#202) 2021-02-02 14:18:22 +01:00
.gitignore feat: support embedding encrypted psiphon config (#285) 2021-04-02 17:36:06 +02:00
allexperiments.go Spring cleanup: remove unused/unneded code (#761) 2022-05-25 13:21:39 +02:00
doc.go feat(engine): allow runner to return many measurements (#527) 2021-09-30 00:54:52 +02:00
experiment_integration_test.go refactor(engine): set options from any value (#837) 2022-07-08 11:51:59 +02:00
experiment_internal_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
experiment_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
experiment.go refactor(netx): move construction logic outside package (#798) 2022-06-05 21:22:27 +02:00
experimentbuilder_test.go refactor(engine): set options from any value (#837) 2022-07-08 11:51:59 +02:00
experimentbuilder.go refactor(engine): set options from any value (#837) 2022-07-08 11:51:59 +02:00
inputloader_network_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
inputloader_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
inputloader.go [forwardport] fix(dnscheck): remove apparently-broken static input (#804) 2022-06-06 16:08:09 +02:00
inputprocessor_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
inputprocessor.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
saver_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
saver.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
session_integration_test.go refactor(engine): *http.Client -> model.HTTPClient (#836) 2022-07-08 11:08:10 +02:00
session_internal_test.go fix(ooniprobe): use ooniprobe-cli-unattended for unattended runs (#714) 2022-04-29 13:41:09 +02:00
session_nopsiphon_test.go refactor: only use shaping dialer for ndt7 and dash (#754) 2022-05-24 18:23:42 +02:00
session_nopsiphon.go refactor: only use shaping dialer for ndt7 and dash (#754) 2022-05-24 18:23:42 +02:00
session_psiphon_test.go refactor: only use shaping dialer for ndt7 and dash (#754) 2022-05-24 18:23:42 +02:00
session_psiphon.go refactor: only use shaping dialer for ndt7 and dash (#754) 2022-05-24 18:23:42 +02:00
session.go refactor(engine): *http.Client -> model.HTTPClient (#836) 2022-07-08 11:08:10 +02:00
submitter_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
submitter.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00