testutils

package
v0.0.0-...-cc0898a Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPTestServer

type HTTPTestServer struct {
	ReceivedRequests []Request
	// contains filtered or unexported fields
}

func NewHTTPTestHandler

func NewHTTPTestHandler(t testing.TB) *HTTPTestServer

func (*HTTPTestServer) LastRequest

func (s *HTTPTestServer) LastRequest() Request

func (*HTTPTestServer) Reset

func (s *HTTPTestServer) Reset()

func (*HTTPTestServer) RespondWith

func (s *HTTPTestServer) RespondWith(statusCode int, body string)

func (*HTTPTestServer) ServeHTTP

func (s *HTTPTestServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Request

type Request struct {
	Req  *http.Request
	Body string
}

Jump to

Keyboard shortcuts

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