testserver

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleFunc

type HandleFunc func(requests []*HttpRequest, http http.ResponseWriter, r *http.Request)

type HttpHandler

type HttpHandler struct {
	// contains filtered or unexported fields
}

func (*HttpHandler) ServeHTTP

func (h *HttpHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type HttpRequest

type HttpRequest struct {
	*http.Request
	// contains filtered or unexported fields
}

func (*HttpRequest) GetTime

func (r *HttpRequest) GetTime() time.Time

type TestServer

type TestServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(h HandleFunc) *TestServer

func NewServerWithStaticResponse

func NewServerWithStaticResponse(response string) *TestServer

func (*TestServer) Requests

func (f *TestServer) Requests() []*HttpRequest

Jump to

Keyboard shortcuts

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