http

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package http provides testing utilities.

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTP2Client *http.Client
)

HTTP Clients for reuse, to pool connections during tests.

Functions

func RefreshClients

func RefreshClients()

RefreshClients creates new clients for the HTTP requests to tetst with.

func TestPostRequestJSON

func TestPostRequestJSON(tb testing.TB, addr string, reqT ReqType) error

TestPostRequestJSON makes a POST request to the echo endpoint.

func TestPostRequestProto

func TestPostRequestProto(tb testing.TB, addr, ct string, reqT ReqType) error

TestPostRequestProto makes a POST request to the echo endpoint.

func TestTLSProto

func TestTLSProto(tb testing.TB, addr string) error

TestTLSProto temporary test stuff.

Types

type ReqFunc

type ReqFunc func(testing.TB, string, string, []byte, *http.Client) ([]byte, error)

ReqFunc sets thd request function to test.

type ReqType

type ReqType int

ReqType set the HTTP request type to make.

const (
	TypeInsecure ReqType = iota + 1
	TypeHTTP1
	TypeHTTP2
	TypeHTTP3
	TypeH2C
)

Request types.

Jump to

Keyboard shortcuts

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