memhttptest

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(tb testing.TB, handler http.Handler, opts ...memhttp.Option) *memhttp.Server

NewServer constructs a memhttp.Server with defaults suitable for tests: it logs runtime errors to the provided testing.TB, and it automatically shuts down the server when the test completes. Startup and shutdown errors fail the test.

To customize the server, use any memhttp.Option. In particular, it may be necessary to customize the shutdown timeout with memhttp.WithCleanupTimeout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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