testutil

package
v0.0.0-...-7983b3b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPServer

func HTTPServer(t *testing.T, addr string, options Options) func()

HTTPServer spins up a HTTP test server that returns the status code included in the URL Example: * GET /200/foo returns a 200 status code; * PUT /404/bar returns a 404 status code; Optional TLS support using a self-signed certificate can be enabled trough the `enableTLS` argument nolint

func StatusFromPath

func StatusFromPath(path string) (status int)

StatusFromPath returns the status code present in the first segment of the request path

Types

type Options

type Options struct {
	EnableTLS        bool
	EnableKeepAlives bool
}

Options wraps all configurable params for the HTTPServer

Jump to

Keyboard shortcuts

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