Documentation ¶
Overview ¶
Package explore scopes types that are used for the Sparta `explore` command line option.
Index ¶
- func NewAPIGatewayRequest(lambdaName string, httpMethod string, whitelistParamValues map[string]string, ...) (*http.Response, error)
- func NewLambdaRequest(lambdaName string, eventData interface{}, testingURL string) (*http.Response, error)
- func NewRawRequest(lambdaName string, context interface{}, eventData interface{}, ...) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIGatewayRequest ¶
func NewAPIGatewayRequest(lambdaName string, httpMethod string, whitelistParamValues map[string]string, eventData interface{}, testingURL string) (*http.Response, error)
NewAPIGatewayRequest sends a mock request to a localhost server that was created by httptest.NewServer(NewLambdaHTTPHandler(lambdaFunctions, logger)). lambdaName is the lambdaFnName to be called, eventData is optional event-specific data, and the testingURL is the URL returned by httptest.NewServer(). The optional event data is embedded in the Sparta input mapping templates.
func NewLambdaRequest ¶
func NewLambdaRequest(lambdaName string, eventData interface{}, testingURL string) (*http.Response, error)
NewLambdaRequest sends a mock request to a localhost server that was created by httptest.NewServer(NewLambdaHTTPHandler(lambdaFunctions, logger)). lambdaName is the lambdaFnName to be called, eventData is optional event-specific data, and the testingURL is the URL returned by httptest.NewServer().
func NewRawRequest ¶
func NewRawRequest(lambdaName string, context interface{}, eventData interface{}, testingURL string) (*http.Response, error)
NewRawRequest mocks the NodeJS proxying tier by creating a JSON request that is POST'd to the golang lambda handler running on localhost. Most clients should use NewLambdaRequest or NewAPIGatewayRequest to create mock data. This function is available for advanced test cases who need more control over the mock request.
Types ¶
This section is empty.