feat: start sketching out the oonirun package (#842)
This diff refactors the ./internal/cmd/miniooni pkg and moves the code for running experiments inside of the ./internal/oonirun pkg. It's the first concrete step towards https://github.com/ooni/probe/issues/2184.
This commit is contained in:
parent
e5697e641e
commit
0b4a49190a
6 changed files with 377 additions and 134 deletions
33
internal/oonirun/session.go
Normal file
33
internal/oonirun/session.go
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package oonirun
|
||||
|
||||
//
|
||||
// Definition of session.
|
||||
//
|
||||
// TODO(bassosimone): we should eventually have a common definition
|
||||
// of session (which probably means a few distinct definitions?) inside
|
||||
// the model package as an interface. Until we do that, which seems an
|
||||
// heavy refactoring right now, this local definition will do.
|
||||
//
|
||||
|
||||
import (
|
||||
"github.com/ooni/probe-cli/v3/internal/engine"
|
||||
"github.com/ooni/probe-cli/v3/internal/model"
|
||||
)
|
||||
|
||||
// Session is the definition of Session used by this package.
|
||||
type Session interface {
|
||||
// A Session is also an InputLoaderSession.
|
||||
engine.InputLoaderSession
|
||||
|
||||
// A Session is also a SubmitterSession.
|
||||
engine.SubmitterSession
|
||||
|
||||
// DefaultHTTPClient returns the session's default HTTPClient.
|
||||
DefaultHTTPClient() model.HTTPClient
|
||||
|
||||
// Logger returns the logger used by this Session.
|
||||
Logger() model.Logger
|
||||
|
||||
// NewExperimentBuilder creates a new engine.ExperimentBuilder.
|
||||
NewExperimentBuilder(name string) (engine.ExperimentBuilder, error)
|
||||
}
|
||||
Loading…
Reference in a new issue