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.
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.