Help us shape the future of Go! Take the 2026 Go Developer Survey

http

package
v1.17.17 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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