Documentation ¶
Index ¶
- Variables
- func RunGroup(config RunGroupConfig) error
- type Controller
- type DNSCheck
- type Dash
- type ECHCheck
- type FacebookMessenger
- type Group
- type HTTPHeaderFieldManipulation
- type HTTPInvalidRequestLine
- type NDT
- type Nettest
- type Psiphon
- type RiseupVPN
- type RunGroupConfig
- type STUNReachability
- type Signal
- type Telegram
- type Tor
- type TorSf
- type VanillaTor
- 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{}, }, UnattendedOK: false, }, "middlebox": { Label: "Middleboxes", Nettests: []Nettest{ HTTPInvalidRequestLine{}, HTTPHeaderFieldManipulation{}, }, UnattendedOK: true, }, "im": { Label: "Instant Messaging", Nettests: []Nettest{ FacebookMessenger{}, Telegram{}, WhatsApp{}, Signal{}, }, UnattendedOK: true, }, "circumvention": { Label: "Circumvention Tools", Nettests: []Nettest{ Psiphon{}, Tor{}, }, UnattendedOK: true, }, "experimental": { Label: "Experimental Nettests", Nettests: []Nettest{ DNSCheck{}, ECHCheck{}, STUNReachability{}, RiseupVPN{}, TorSf{}, VanillaTor{}, }, 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 // RunType contains the run_type hint for the CheckIn API. If // not set, the underlying code defaults to model.RunTypeTimed. RunType model.RunType // 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 *model.DatabaseResult, sess *engine.Session) *Controller
NewController creates a nettest controller
func (*Controller) BuildAndSetInputIdxMap ¶ added in v3.13.0
func (c *Controller) BuildAndSetInputIdxMap(testlist []model.OOAPIURLInfo) ([]string, error)
BuildAndSetInputIdxMap takes in input a list of URLs in the format returned by the check-in API (i.e., model.URLInfo) and performs the following actions:
1. inserts each URL into the database;
2. builds a list of bare URLs to be tested;
3. registers a mapping between each URL and an index and stores it into the controller.
Arguments:
- sess is the database in which to register the URL;
- testlist is the result from the check-in API (or possibly a manually constructed list when applicable, e.g., for dnscheck until we have an API for serving its input).
Results:
- on success, a list of strings containing URLs to test;
- on failure, an error.
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 model.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) 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 DNSCheck ¶ added in v3.7.0
type DNSCheck struct{}
DNSCheck nettest implementation.
func (DNSCheck) Run ¶ added in v3.7.0
func (n DNSCheck) Run(ctl *Controller) error
Run starts the nettest.
type ECHCheck ¶ added in v3.19.0
type ECHCheck struct{}
ECHCheck nettest implementation.
func (ECHCheck) Run ¶ added in v3.19.0
func (n ECHCheck) Run(ctl *Controller) error
Run starts the nettest.
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 InputFiles []string Inputs []string Probe *ooni.Probe RunType model.RunType // hint for check-in API }
RunGroupConfig contains the settings for running a nettest group.
type STUNReachability ¶ added in v3.7.0
type STUNReachability struct{}
STUNReachability nettest implementation.
func (STUNReachability) Run ¶ added in v3.7.0
func (n STUNReachability) Run(ctl *Controller) error
Run starts the nettest.
type Signal ¶ added in v3.6.0
type Signal struct{}
Signal nettest implementation.
func (Signal) Run ¶ added in v3.6.0
func (h Signal) Run(ctl *Controller) error
Run starts the nettest.
type VanillaTor ¶ added in v3.15.0
type VanillaTor struct { }
VanillaTor test implementation
func (VanillaTor) Run ¶ added in v3.15.0
func (h VanillaTor) Run(ctl *Controller) error
Run starts the test
type WebConnectivity ¶
type WebConnectivity struct{}
WebConnectivity test implementation
func (WebConnectivity) Run ¶
func (n WebConnectivity) Run(ctl *Controller) error
Run starts the test