Documentation
¶
Overview ¶
Package catalog loads and validates the target lists (targets/*.yaml).
Index ¶
Constants ¶
const ( TestDNS = "dns" TestTCP = "tcp" TestTLS = "tls" TestTLSNoSNI = "tls_nosni" TestHTTP = "http" TestQUIC = "quic" TestECH = "ech" )
Test names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
Categories []*Category
DNS *DNSConfig
Whitelist *WhitelistConfig
}
Catalog is the full set of loaded lists.
func LoadWithOverrides ¶
LoadWithOverrides loads the embedded lists and then the *.yaml files of dir; a file in dir replaces the embedded file of the same name.
func (*Catalog) Select ¶
Select returns the targets matching sel. Without explicit categories or targets, every default category is used. Baseline targets are always included so throttling can be judged.
type Category ¶
type Category struct {
Version int `yaml:"version"`
Kind string `yaml:"kind"`
ID string `yaml:"category"`
Title Text `yaml:"title"`
Default bool `yaml:"default"`
Order int `yaml:"order"`
Consent Text `yaml:"consent"`
Refs []string `yaml:"refs"`
Targets []Target `yaml:"targets"`
File string `yaml:"-"`
}
Category is one targets/*.yaml file with `targets:`.
type DNSConfig ¶
type DNSConfig struct {
Version int `yaml:"version"`
Kind string `yaml:"kind"`
ID string `yaml:"category"`
Title Text `yaml:"title"`
Default bool `yaml:"default"`
Resolvers []Resolver `yaml:"resolvers"`
ReferenceDoH []string `yaml:"doh_reference_order"`
ProbeDomains []ProbeDomain `yaml:"probe_domains"`
Interceptions []Interception `yaml:"interception"`
}
DNSConfig is dns.yaml.
type Endpoint ¶
type Endpoint struct {
Host string `yaml:"host"`
Addr string `yaml:"addr"`
Port int `yaml:"port"`
Path string `yaml:"path"`
QUIC bool `yaml:"quic"`
HTTP80 bool `yaml:"http80"`
Tests []string `yaml:"tests"`
QUICVersions []int `yaml:"quic_versions"`
Note string `yaml:"note"`
}
Endpoint is one host or address of a target.
func (Endpoint) EffectivePath ¶
EffectivePath returns the HTTP path ("/" by default).
func (Endpoint) EffectivePort ¶
EffectivePort returns the configured port (443 by default).
func (Endpoint) EffectiveQUICVersions ¶
EffectiveQUICVersions returns the QUIC versions to probe ([1] by default).
func (Endpoint) EffectiveTests ¶
EffectiveTests returns the tests that run for this endpoint.
type Interception ¶
type Interception struct {
ID string `yaml:"id"`
Resolver string `yaml:"resolver"`
QName string `yaml:"qname"`
QClass string `yaml:"qclass"`
QType string `yaml:"qtype"`
Expect string `yaml:"expect"`
}
Interception is a transparent DNS proxy probe.
type ProbeDomain ¶
type ProbeDomain struct {
Name string `yaml:"name"`
Role string `yaml:"role"`
Note string `yaml:"note"`
}
ProbeDomain is a domain compared across resolvers.
type Resolver ¶
type Resolver struct {
ID string `yaml:"id"`
Name Text `yaml:"name"`
Type string `yaml:"type"`
Role string `yaml:"role"`
Refs []string `yaml:"refs"`
UDP []string `yaml:"udp"`
DoT *struct {
Host string `yaml:"host"`
Addr string `yaml:"addr"`
} `yaml:"dot"`
DoH string `yaml:"doh"`
}
Resolver is a DNS resolver definition from dns.yaml.
type Selection ¶
type Selection struct {
Categories []string
Targets []string
All bool // include opt-in categories
}
Selection describes which targets to scan.
type Target ¶
type Target struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Role string `yaml:"role"`
Expect string `yaml:"expect"`
Since string `yaml:"since"`
Refs []string `yaml:"refs"`
Notes Text `yaml:"notes"`
ThrottleURL string `yaml:"throttle_url"`
Verified *bool `yaml:"verified"`
Endpoints []Endpoint `yaml:"endpoints"`
// Category is filled in by the loader.
Category string `yaml:"-"`
}
Target is one service.
func (Target) IsBaseline ¶
IsBaseline reports whether the target is a domestic speed reference.
type Text ¶
Text is a localised string map ({ru: ..., en: ...}).
type WhitelistConfig ¶
type WhitelistConfig struct {
Version int `yaml:"version"`
Kind string `yaml:"kind"`
ID string `yaml:"category"`
Title Text `yaml:"title"`
Default bool `yaml:"default"`
Refs []string `yaml:"refs"`
Thresholds struct {
DomesticOK float64 `yaml:"domestic_ok"`
ForeignMax float64 `yaml:"foreign_max"`
Dead float64 `yaml:"dead"`
Normal float64 `yaml:"normal"`
} `yaml:"thresholds"`
Domestic []WhitelistHost `yaml:"domestic"`
Foreign []WhitelistHost `yaml:"foreign"`
}
WhitelistConfig is whitelist.yaml.
type WhitelistHost ¶
type WhitelistHost struct {
Host string `yaml:"host"`
Org string `yaml:"org"`
CA string `yaml:"ca"`
}
WhitelistHost is one host of whitelist.yaml.