testutils

package
v0.0.0-...-f06801b Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() *http.Client

Client returns a http client compatible with the http2 test server

func Handler

func Handler(t *testing.T, in interface{}, out interface{}) http.HandlerFunc

Handler returns a http handler which decodes and matches JSON request bodies with the in interface{}, and writes the out interface{} as JSON to the response writer

func Server

func Server(pattern string, mock http.HandlerFunc) *httptest.Server

Server starts an insecure http2 enabled server for testing a route

func StreamingHandler

func StreamingHandler(t *testing.T, in interface{}, outs ...interface{}) http.HandlerFunc

StreamingHandler matches an initial JSON request body with the given in param, then writes each of the given outs params to the response waiting 100ms inbetween each

Types

This section is empty.

Jump to

Keyboard shortcuts

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