dnscheck

package
v3.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package dnscheck contains the DNS check experiment.

See https://github.com/ooni/spec/blob/master/nettests/ts-028-dnscheck.md.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInputRequired        = targetloading.ErrInputRequired
	ErrInvalidInputType     = targetloading.ErrInvalidInputType
	ErrInvalidURL           = errors.New("the input URL is invalid")
	ErrUnsupportedURLScheme = errors.New("unsupported URL scheme")
)

The following errors may be returned by this experiment. Of course these errors are in addition to any other errors returned by the low level packages that are used by this experiment to implement its functionality.

Functions

func Collect

func Collect(ctx context.Context, multi urlgetter.Multi, inputs []urlgetter.MultiInput,
	logger model.Logger) <-chan urlgetter.MultiOutput

Collect prints on the output channel the result of running dnscheck on every provided input. It closes the output channel when done.

func NewExperimentMeasurer

func NewExperimentMeasurer() model.ExperimentMeasurer

NewExperimentMeasurer creates a new ExperimentMeasurer.

func NewLoader added in v3.23.0

func NewLoader(loader *targetloading.Loader, gopts any) model.ExperimentTargetLoader

NewLoader constructs a new model.ExperimentTargerLoader instance.

This function PANICS if options is not an instance of *dnscheck.Config.

Types

type Config

type Config struct {
	DefaultAddrs  string `json:"default_addrs" ooni:"default addresses for domain"`
	Domain        string `json:"domain" ooni:"domain to resolve using the specified resolver"`
	HTTP3Enabled  bool   `json:"http3_enabled" ooni:"use http3 instead of http/1.1 or http2"`
	HTTPHost      string `json:"http_host" ooni:"force using specific HTTP Host header"`
	TLSServerName string `json:"tls_server_name" ooni:"force TLS to using a specific SNI in Client Hello"`
	TLSVersion    string `json:"tls_version" ooni:"Force specific TLS version (e.g. 'TLSv1.3')"`
}

Config contains the experiment's configuration.

type Endpoints

type Endpoints struct {
	WaitTime time.Duration
	// contains filtered or unexported fields
}

Endpoints keeps track of repeatedly measured endpoints.

type Measurer

type Measurer struct {
	Endpoints *Endpoints
}

Measurer performs the measurement.

func (*Measurer) ExperimentName

func (m *Measurer) ExperimentName() string

ExperimentName implements model.ExperimentSession.ExperimentName

func (*Measurer) ExperimentVersion

func (m *Measurer) ExperimentVersion() string

ExperimentVersion implements model.ExperimentSession.ExperimentVersion

func (*Measurer) Run

func (m *Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error

Run implements model.ExperimentSession.Run

type Target added in v3.23.0

type Target struct {
	// Config contains the configuration.
	Config *Config

	// URL is the input URL.
	URL string
}

Target is a richer-input target that this experiment should measure.

func (*Target) Category added in v3.23.0

func (t *Target) Category() string

Category implements model.ExperimentTarget.

func (*Target) Country added in v3.23.0

func (t *Target) Country() string

Country implements model.ExperimentTarget.

func (*Target) Input added in v3.23.0

func (t *Target) Input() string

Input implements model.ExperimentTarget.

func (*Target) Options added in v3.23.0

func (t *Target) Options() []string

Options implements model.ExperimentTarget.

func (*Target) String added in v3.23.0

func (t *Target) String() string

String implements model.ExperimentTarget.

type TestKeys

type TestKeys struct {
	DefaultAddrs     string                        `json:"x_default_addrs"`
	Domain           string                        `json:"domain"`
	HTTP3Enabled     bool                          `json:"x_http3_enabled,omitempty"`
	HTTPHost         string                        `json:"x_http_host,omitempty"`
	TLSServerName    string                        `json:"x_tls_server_name,omitempty"`
	TLSVersion       string                        `json:"x_tls_version,omitempty"`
	Residual         bool                          `json:"x_residual"`
	Bootstrap        *urlgetter.TestKeys           `json:"bootstrap"`
	BootstrapFailure *string                       `json:"bootstrap_failure"`
	Lookups          map[string]urlgetter.TestKeys `json:"lookups"`
}

TestKeys contains the results of the dnscheck experiment.

Jump to

Keyboard shortcuts

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