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 ( // 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.
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 legacymodel.ArchivalMaybeBinaryData 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.
func (*SummaryKeys) Anomaly ¶ added in v0.28.0
func (sk *SummaryKeys) Anomaly() bool
Anomaly implements model.MeasurementSummaryKeys.
type TestKeys ¶
type TestKeys struct { FailureList []*string `json:"failure_list"` Received []legacymodel.ArchivalMaybeBinaryData `json:"received"` Sent []string `json:"sent"` TamperingList []bool `json:"tampering_list"` Tampering bool `json:"tampering"` }
TestKeys contains the experiment test keys.
func (*TestKeys) MeasurementSummaryKeys ¶ added in v0.28.0
func (tk *TestKeys) MeasurementSummaryKeys() model.MeasurementSummaryKeys
MeasurementSummaryKeys implements model.MeasurementSummaryKeysProvider.