testlambdaz

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPSimulator

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

HTTPSimulator provides a simplified implementation of an API Gateway v2 API for local testing purposes. Note that it has a lot of limitations: - Only AWS_PROXY integrations are supported. - Authorizers, transforms, etc. are not supported. - The ANY method, $default route, and {proxy+} routes are not supported. - Cookies are not handled.

func NewHTTPSimulator

func NewHTTPSimulator(cfg *HTTPSimulatorConfig, injector injectz.Injector) *HTTPSimulator

NewHTTPSimulator initializes a new HTTPSimulator.

func (*HTTPSimulator) GetEchoForTest

func (s *HTTPSimulator) GetEchoForTest() *echo.Echo

GetEchoForTest returns the underlying Echo.

func (*HTTPSimulator) Run

func (s *HTTPSimulator) Run(addr string)

Run the simulator.

type HTTPSimulatorConfig

type HTTPSimulatorConfig struct {
	Routes               map[string]*HTTPSimulatorConfigRoute               `json:"routes"`
	AWSProxyIntegrations map[string]*HTTPSimulatorConfigAWSProxyIntegration `json:"awsProxyIntegrations"`
}

HTTPSimulatorConfig describes the HTTP simulator config.

func (*HTTPSimulatorConfig) MustValidate

func (c *HTTPSimulatorConfig) MustValidate()

MustValidate validates the HTTPSimulatorConfig, panics on error.

type HTTPSimulatorConfigAWSProxyIntegration

type HTTPSimulatorConfigAWSProxyIntegration struct {
	URL string `json:"url" validate:"required,url"`
}

HTTPSimulatorConfigAWSProxyIntegration describes part of the HTTP simulator config.

type HTTPSimulatorConfigRoute

type HTTPSimulatorConfigRoute struct {
	IntegrationName string `json:"integrationName"`
}

HTTPSimulatorConfigRoute describes part of the HTTP simulator config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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