http

package
v1.17.20 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

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

HTTP is a HTTP server that can be used in integration tests.

func New

func New(t *testing.T, fopts ...Option) *HTTP

func (*HTTP) Cleanup

func (h *HTTP) Cleanup(t *testing.T)

func (*HTTP) Port

func (h *HTTP) Port() int

func (*HTTP) Run

func (h *HTTP) Run(t *testing.T, ctx context.Context)

type Option

type Option func(*options)

Option is a function that configures the process.

func WithHandler

func WithHandler(handler http.Handler) Option

func WithHandlerFunc added in v1.13.0

func WithHandlerFunc(path string, fn http.HandlerFunc) Option

func WithMTLS added in v1.13.0

func WithMTLS(t *testing.T, ca, cert, key []byte) Option

func WithPort added in v1.15.10

func WithPort(port int) Option

func WithTLS

func WithTLS(t *testing.T, cert, key []byte) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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