testutil

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 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, enableTLS bool) 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

This section is empty.

Jump to

Keyboard shortcuts

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