http

package
v0.0.0-...-b87209e Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 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 TestGetRequest

func TestGetRequest(t testing.TB, addr string, reqT ReqType) error

TestGetRequest makes a GET request to the echo endpoint.

func TestPostRequestJSON

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

TestPostRequestJSON makes a POST request to the echo endpoint.

func TestPostRequestProto

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

TestPostRequestProto makes a POST request to the echo endpoint.

func TestTLSProto

func TestTLSProto(t 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