oohelperd

package
v3.19.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const MaxAcceptableBodySize = 1 << 24

MaxAcceptableBodySize is the maximum acceptable body size for incoming API requests as well as when we're measuring webpages.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// BaseLogger is the MANDATORY logger to use.
	BaseLogger model.Logger

	// Indexer is the MANDATORY atomic integer used to assign an index to requests.
	Indexer *atomic.Int64

	// MaxAcceptableBody is the MANDATORY maximum acceptable response body.
	MaxAcceptableBody int64

	// Measure is the MANDATORY function that the handler should call
	// for producing a response for a valid incoming request.
	Measure func(ctx context.Context, config *Handler, creq *model.THRequest) (*model.THResponse, error)

	// NewDialer is the MANDATORY factory to create a new Dialer.
	NewDialer func(model.Logger) model.Dialer

	// NewHTTPClient is the MANDATORY factory to create a new HTTPClient.
	NewHTTPClient func(model.Logger) model.HTTPClient

	// NewHTTP3Client is the MANDATORY factory to create a new HTTP3Client.
	NewHTTP3Client func(model.Logger) model.HTTPClient

	// NewQUICDialer is the MANDATORY factory to create a new QUICDialer.
	NewQUICDialer func(model.Logger) model.QUICDialer

	// NewResolver is the MANDATORY factory for creating a new resolver.
	NewResolver func(model.Logger) model.Resolver

	// NewTLSHandshaker is the MANDATORY factory for creating a new TLS handshaker.
	NewTLSHandshaker func(model.Logger) model.TLSHandshaker
}

Handler is an http.Handler implementing the Web Connectivity test helper HTTP API.

func NewHandler

func NewHandler() *Handler

NewHandler constructs the [handler].

func (*Handler) ServeHTTP

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

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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