webconnectivityalgo

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: 10 Imported by: 0

Documentation

Overview

Package webconnectivityalgo contains Web Connectivity algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallWebConnectivityTestHelper added in v3.22.0

func CallWebConnectivityTestHelper(ctx context.Context, creq *model.THRequest,
	testhelpers []model.OOAPIService, sess model.ExperimentSession) (*model.THResponse, int, error)

CallWebConnectivityTestHelper invokes the Web Connectivity test helper with the given request object, the given list of available test helpers, and the given session.

If the list of test helpers is empty this function immediately returns nil, zero, and the model.ErrNoAvailableTestHelpers error to the caller.

In case of any other failure, this function returns nil, zero, and an error.

On success, it returns the response, the used TH index, and nil.

Note that the returned error won't be wrapped, so you need to wrap it yourself.

func RandomDNSOverUDPResolverEndpointIPv4

func RandomDNSOverUDPResolverEndpointIPv4() string

RandomDNSOverUDPResolverEndpointIPv4 returns a random DNS-over-UDP resolver endpoint using IPv4.

Types

type DNSWhoamiInfoEntry

type DNSWhoamiInfoEntry struct {
	// Address is the IP address used by the resolver.
	Address string `json:"address"`
}

DNSWhoamiInfoEntry contains an entry for DNSWhoamiInfo.

type DNSWhoamiService

type DNSWhoamiService struct {
	// contains filtered or unexported fields
}

DNSWhoamiService is a service that performs DNS whoami lookups.

The zero value of this struct is invalid. Please, construct using the NewDNSWhoamiService factory function.

func NewDNSWhoamiService

func NewDNSWhoamiService(logger model.Logger) *DNSWhoamiService

NewDNSWhoamiService constructs a new *DNSWhoamiService.

func (*DNSWhoamiService) SystemV4

func (svc *DNSWhoamiService) SystemV4(ctx context.Context) ([]DNSWhoamiInfoEntry, bool)

SystemV4 returns the results of querying using the system resolver and IPv4.

func (*DNSWhoamiService) UDPv4

func (svc *DNSWhoamiService) UDPv4(ctx context.Context, address string) ([]DNSWhoamiInfoEntry, bool)

UDPv4 returns the results of querying a given UDP resolver and IPv4.

type OpportunisticDNSOverHTTPSURLProvider

type OpportunisticDNSOverHTTPSURLProvider struct {
	// contains filtered or unexported fields
}

OpportunisticDNSOverHTTPSURLProvider allows to perform opportunistic DNS-over-HTTPS measurements as part of Web Connectivity LTE. The zero value of this struct is not valid, please use NewOpportunisticDNSOverHTTPSURLProvider to construct.

Implementation note: this code uses memory to keep track of the resolvers and know when to perform the next opportunistic check. It seems pointless to use the disk since invocations of Web Connectivity typically consist of multiple URLs and therefore run for a few minutes. Hence, storing state on disk seems a bit overkill here.

func NewOpportunisticDNSOverHTTPSURLProvider

func NewOpportunisticDNSOverHTTPSURLProvider(urls ...string) *OpportunisticDNSOverHTTPSURLProvider

NewOpportunisticDNSOverHTTPSURLProvider creates a new *OpportunisticDNSOverHTTPSURLProvider.

func (*OpportunisticDNSOverHTTPSURLProvider) MaybeNextURL

func (o *OpportunisticDNSOverHTTPSURLProvider) MaybeNextURL() (string, bool)

MaybeNextURL returns the next URL to measure, if any. Our aim is to perform periodic, opportunistic DoH measurements as part of Web Connectivity.

Jump to

Keyboard shortcuts

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