ooni-probe-cli/internal/cmd/miniooni
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
..
.gitignore refactor: merge libminiooni into cmd/miniooni (#268) 2021-03-29 19:03:53 +02:00
libminiooni_test.go refactor: merge libminiooni into cmd/miniooni (#268) 2021-03-29 19:03:53 +02:00
libminiooni.go refactor(engine): set options from any value (#837) 2022-07-08 11:51:59 +02:00
main.go fix(engine): break circular dep betwen session and tunnel (#295) 2021-04-05 12:02:35 +02:00
README.md refactor: merge libminiooni into cmd/miniooni (#268) 2021-03-29 19:03:53 +02:00

miniooni

This directory contains the source code of a simple CLI client that we use for research as well as for running QA scripts. We designed this tool to have a CLI similar to MK and OONI Probe v2.x to ease running Jafar scripts that check whether these tools behave similarly. Perfect backwards compatibility was not a design goal for miniooni. Rather, we aimed to have as little conflict as possible, such that we can run side-by-side QA checks.