internal

package
v0.0.0-...-bd88772 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DNSDo

func DNSDo(ctx context.Context, config *DNSConfig)

DNSDo performs the DNS check.

func HTTPDo

func HTTPDo(ctx context.Context, config *HTTPConfig)

HTTPDo performs the HTTP check.

func TCPDo

func TCPDo(ctx context.Context, config *TCPConfig)

TCPDo performs the TCP check.

Types

type CtrlDNSResult

type CtrlDNSResult = webconnectivity.ControlDNSResult

CtrlDNSResult is the result of the DNS check performed by the Web Connectivity test helper.

type CtrlHTTPResponse

type CtrlHTTPResponse = webconnectivity.ControlHTTPRequestResult

CtrlHTTPResponse is the result of the HTTP check performed by the Web Connectivity test helper.

type CtrlRequest

type CtrlRequest = webconnectivity.ControlRequest

CtrlRequest is the request sent to the test helper

type CtrlResponse

type CtrlResponse = webconnectivity.ControlResponse

CtrlResponse is the response from the test helper

func Measure

func Measure(ctx context.Context, config MeasureConfig, creq *CtrlRequest) (*CtrlResponse, error)

Measure performs the measurement described by the request and returns the corresponding response or an error.

type CtrlTCPResult

CtrlTCPResult is the result of the TCP check performed by the test helper.

type DNSConfig

type DNSConfig struct {
	Domain   string
	Out      chan CtrlDNSResult
	Resolver netx.Resolver
	Wg       *sync.WaitGroup
}

DNSConfig configures the DNS check.

type HTTPConfig

type HTTPConfig struct {
	Client            *http.Client
	Headers           map[string][]string
	MaxAcceptableBody int64
	Out               chan CtrlHTTPResponse
	URL               string
	Wg                *sync.WaitGroup
}

HTTPConfig configures the HTTP check.

type Handler

type Handler struct {
	Client            *http.Client
	Dialer            netx.Dialer
	MaxAcceptableBody int64
	Resolver          netx.Resolver
}

Handler implements the Web Connectivity test helper HTTP API.

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type MeasureConfig

type MeasureConfig struct {
	Client            *http.Client
	Dialer            netx.Dialer
	MaxAcceptableBody int64
	Resolver          netx.Resolver
}

MeasureConfig contains configuration for Measure.

type TCPConfig

type TCPConfig struct {
	Dialer   netx.Dialer
	Endpoint string
	Out      chan TCPResultPair
	Wg       *sync.WaitGroup
}

TCPConfig configures the TCP connect check.

type TCPResultPair

type TCPResultPair struct {
	Endpoint string
	Result   CtrlTCPResult
}

TCPResultPair contains the endpoint and the corresponding result.

Jump to

Keyboard shortcuts

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