httptest

package
v0.0.0-...-d96fe47 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

func WithContext

func WithContext(ctx context.Context) Option

func WithHeader

func WithHeader(key, value string) Option

func WithHeaderMap

func WithHeaderMap(headers map[string]string) Option

func WithHttpMethod

func WithHttpMethod(method string) Option

func WithLocals

func WithLocals(key string, value any) Option

func WithPath

func WithPath(path string) Option

func WithPathParams

func WithPathParams(key, value string) Option

func WithPathParamsMap

func WithPathParamsMap(params map[string]string) Option

func WithQuery

func WithQuery(key, value string) Option

func WithQueryMap

func WithQueryMap(query map[string]string) Option

func WithRequest

func WithRequest[Req any](req Req) Option

type TestHttpContext

type TestHttpContext[Req any, Resp any] struct {
	lambdahttp.Context[Req, Resp]
}

func Run

func Run[Req any, Resp any](handler lambdahttp.Handler[Req, Resp], opts ...Option) (*TestHttpContext[Req, Resp], error)

func (*TestHttpContext[Req, Resp]) ResponseBody

func (t *TestHttpContext[Req, Resp]) ResponseBody() (Resp, error)

Jump to

Keyboard shortcuts

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