http

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	StatusCode   int
	ResponseData interface{}
}

Handler is a custom http handler useful in testing. Usage:

s := httptest.NewServer(handler{statusCode: http.StatusOK, responseData: someStruct})

Then:

s.URL

must be configured in the client.

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(writer http.ResponseWriter, req *http.Request)

type StubEchoServer

type StubEchoServer struct {
	BoundAddress string
}

func (StubEchoServer) Add

func (s StubEchoServer) Add(method, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route

func (StubEchoServer) Shutdown

func (s StubEchoServer) Shutdown(ctx context.Context) error

func (*StubEchoServer) Start

func (s *StubEchoServer) Start(address string) error

Jump to

Keyboard shortcuts

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