nettests

package
v0.3.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Ctx *ooni.Context
	// 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, ctx *ooni.Context, res *database.Result) *Controller

NewController creates a nettest controller

func (*Controller) OnDataUsage

func (c *Controller) OnDataUsage(dloadKiB, uploadKiB float64)

OnDataUsage should be called when we have a data usage update.

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 Nettest

type Nettest interface {
	Run(*Controller) error
	GetTestKeys(map[string]interface{}) (interface{}, error)
	LogSummary(string) error
}

Nettest interface. Every Nettest should implement this.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL