Documentation ¶
Overview ¶
Package hirl contains the HTTP Invalid Request Line network experiment.
See https://github.com/ooni/spec/blob/master/nettests/ts-007-http-invalid-request-line.md
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoAvailableTestHelpers is emitted when there are no available test helpers. ErrNoAvailableTestHelpers = errors.New("no available helpers") // ErrInvalidHelperType is emitted when the helper type is invalid. ErrInvalidHelperType = errors.New("invalid helper type") // ErrNoMeasurementMethod is emitted when Measurer.Methods is empty. ErrNoMeasurementMethod = errors.New("no configured measurement method") )
Functions ¶
func NewExperimentMeasurer ¶
func NewExperimentMeasurer(config Config) model.ExperimentMeasurer
NewExperimentMeasurer creates a new ExperimentMeasurer.
func RunMethod ¶
func RunMethod(ctx context.Context, config RunMethodConfig)
RunMethod runs the specific method using the given config and context
Types ¶
type Measurer ¶
Measurer performs the measurement.
func (Measurer) ExperimentName ¶
ExperimentName implements ExperimentMeasurer.ExperiExperimentName.
func (Measurer) ExperimentVersion ¶
ExperimentVersion implements ExperimentMeasurer.ExperimentVersion.
func (Measurer) GetSummaryKeys ¶
func (m Measurer) GetSummaryKeys(measurement *model.Measurement) (interface{}, error)
GetSummaryKeys implements model.ExperimentMeasurer.GetSummaryKeys.
func (Measurer) Run ¶
func (m Measurer) Run( ctx context.Context, sess model.ExperimentSession, measurement *model.Measurement, callbacks model.ExperimentCallbacks, ) error
Run implements ExperimentMeasurer.Run.
type Method ¶
type Method interface { Name() string Run(ctx context.Context, config MethodConfig) }
Method is one of the methods implemented by this experiment.
type MethodConfig ¶
type MethodConfig struct { Address string Logger model.Logger Out chan<- MethodResult }
MethodConfig contains the settings for a specific measuring method.
type MethodResult ¶
type MethodResult struct { Err error Name string Received tracex.MaybeBinaryValue Sent string Tampering bool }
MethodResult is the result of one of the methods implemented by this experiment.
type RunMethodConfig ¶
type RunMethodConfig struct { MethodConfig Name string NewDialer func(config netx.Config) model.Dialer RequestLine string }
RunMethodConfig contains the config for RunMethod
type SummaryKeys ¶
type SummaryKeys struct {
IsAnomaly bool `json:"-"`
}
SummaryKeys contains summary keys for this experiment.
Note that this structure is part of the ABI contract with ooniprobe therefore we should be careful when changing it.