Documentation ¶
Index ¶
- Variables
- func RunGroup(config RunGroupConfig) error
- type Controller
- type Dash
- type FacebookMessenger
- type Group
- type HTTPHeaderFieldManipulation
- type HTTPInvalidRequestLine
- type NDT
- type Nettest
- type Psiphon
- type RiseupVPN
- type RunGroupConfig
- type Telegram
- type Tor
- type WebConnectivity
- type WhatsApp
Constants ¶
This section is empty.
Variables ¶
var All = map[string]Group{ "websites": { Label: "Websites", Nettests: []Nettest{ WebConnectivity{}, }, UnattendedOK: true, }, "performance": { Label: "Performance", Nettests: []Nettest{ Dash{}, NDT{}, }, }, "middlebox": { Label: "Middleboxes", Nettests: []Nettest{ HTTPInvalidRequestLine{}, HTTPHeaderFieldManipulation{}, }, UnattendedOK: true, }, "im": { Label: "Instant Messaging", Nettests: []Nettest{ FacebookMessenger{}, Telegram{}, WhatsApp{}, }, UnattendedOK: true, }, "circumvention": { Label: "Circumvention Tools", Nettests: []Nettest{ Psiphon{}, RiseupVPN{}, Tor{}, }, UnattendedOK: true, }, }
All contains all the nettests that can be run by the user
Functions ¶
func RunGroup ¶
func RunGroup(config RunGroupConfig) error
RunGroup runs a group of nettests according to the specified config.
Types ¶
type Controller ¶
type Controller struct { Probe *ooni.Probe Session *engine.Session // InputFiles optionally contains the names of the input // files to read inputs from (only for nettests that take // inputs, of course) InputFiles []string // Inputs contains inputs to be tested. These are specified // using the command line using the --input flag. Inputs []string // contains filtered or unexported fields }
Controller is passed to the run method of every Nettest each nettest instance has one controller
func NewController ¶
func NewController( nt Nettest, probe *ooni.Probe, res *database.Result, sess *engine.Session) *Controller
NewController creates a nettest controller
func (*Controller) OnProgress ¶
func (c *Controller) OnProgress(perc float64, msg string)
OnProgress should be called when a new progress event is available.
func (*Controller) Run ¶
func (c *Controller) Run(builder *engine.ExperimentBuilder, inputs []string) error
Run runs the selected nettest using the related experiment with the specified inputs.
This function will continue to run in most cases but will immediately halt if something's wrong with the file system.
func (*Controller) SetInputIdxMap ¶
func (c *Controller) SetInputIdxMap(inputIdxMap map[int64]int64) error
SetInputIdxMap is used to set the mapping of index into input. This mapping is used to reference, for example, a particular URL based on the index inside of the input list and the index of it in the database.
func (*Controller) SetNettestIndex ¶
func (c *Controller) SetNettestIndex(i, n int)
SetNettestIndex is used to set the current nettest index and total nettest count to compute a different progress percentage.
type FacebookMessenger ¶
type FacebookMessenger struct { }
FacebookMessenger test implementation
func (FacebookMessenger) Run ¶
func (h FacebookMessenger) Run(ctl *Controller) error
Run starts the test
type HTTPHeaderFieldManipulation ¶
type HTTPHeaderFieldManipulation struct { }
HTTPHeaderFieldManipulation test implementation
func (HTTPHeaderFieldManipulation) Run ¶
func (h HTTPHeaderFieldManipulation) Run(ctl *Controller) error
Run starts the test
type HTTPInvalidRequestLine ¶
type HTTPInvalidRequestLine struct { }
HTTPInvalidRequestLine test implementation
func (HTTPInvalidRequestLine) Run ¶
func (h HTTPInvalidRequestLine) Run(ctl *Controller) error
Run starts the test
type Nettest ¶
type Nettest interface {
Run(*Controller) error
}
Nettest interface. Every Nettest should implement this.
type RunGroupConfig ¶
type RunGroupConfig struct { GroupName string Probe *ooni.Probe InputFiles []string Inputs []string }
RunGroupConfig contains the settings for running a nettest group.
type WebConnectivity ¶
type WebConnectivity struct { }
WebConnectivity test implementation
func (WebConnectivity) Run ¶
func (n WebConnectivity) Run(ctl *Controller) error
Run starts the test