ooni-probe-cli/internal/registry/example.go
Simone Basso 0bc6aae601
feat(miniooni): make CLI much more user friendly (#913)
Part of https://github.com/ooni/probe/issues/2184, because I wanted
to allow swapping commands and options more freely.

As a side effect, this PR closes https://github.com/ooni/probe/issues/2248.

AFAICT, every usage that was legal before is still legal. What has
changed seems the freedom to swap commands and options and a much
better help that lists the available options.
2022-08-31 12:44:46 +02:00

29 lines
589 B
Go

package registry
//
// Registers the `example' experiment.
//
import (
"time"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/example"
"github.com/ooni/probe-cli/v3/internal/model"
)
func init() {
AllExperiments["example"] = &Factory{
build: func(config interface{}) model.ExperimentMeasurer {
return example.NewExperimentMeasurer(
*config.(*example.Config), "example",
)
},
config: &example.Config{
Message: "Good day from the example experiment!",
SleepTime: int64(time.Second),
},
interruptible: true,
inputPolicy: model.InputNone,
}
}