events

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIGatewayContext

type APIGatewayContext struct {
	AppID        string             `json:"appId"`
	Method       string             `json:"method"`
	RequestID    string             `json:"requestId"`
	ResourceID   string             `json:"resourceId"`
	ResourcePath string             `json:"resourcePath"`
	Stage        string             `json:"stage"`
	Identity     APIGatewayIdentity `json:"identity"`
}

APIGatewayContext is the API-Gateway context information

type APIGatewayEnvelope

type APIGatewayEnvelope struct {
	Method      string                 `json:"method"`
	Headers     map[string]string      `json:"headers"`
	QueryParams map[string]string      `json:"queryParams"`
	PathParams  map[string]string      `json:"pathParams"`
	Context     APIGatewayContext      `json:"context"`
	Authorizer  map[string]interface{} `json:"authorizer"`
}

APIGatewayEnvelope is the type that maps to the VTL properties

type APIGatewayIdentity

type APIGatewayIdentity struct {
	AccountID                     string `json:"accountId"`
	APIKey                        string `json:"apiKey"`
	Caller                        string `json:"caller"`
	CognitoAuthenticationProvider string `json:"cognitoAuthenticationProvider"`
	CognitoAuthenticationType     string `json:"cognitoAuthenticationType"`
	CognitoIdentityID             string `json:"cognitoIdentityId"`
	CognitoIdentityPoolID         string `json:"cognitoIdentityPoolId"`
	SourceIP                      string `json:"sourceIp"`
	User                          string `json:"user"`
	UserAgent                     string `json:"userAgent"`
	UserArn                       string `json:"userArn"`
}

APIGatewayIdentity is the API Gateway identity information

type APIGatewayRequest

type APIGatewayRequest struct {
	APIGatewayEnvelope
	Body interface{} `json:"body"`
}

APIGatewayRequest represents the API Gateway request that is submitted to a Lambda function. This format matches the inputmapping_default.VTL templates

func NewAPIGatewayMockRequest

func NewAPIGatewayMockRequest(lambdaName string,
	httpMethod string,
	whitelistParamValues map[string]string,
	eventData interface{}) (*APIGatewayRequest, error)

NewAPIGatewayMockRequest creates a mock API Gateway request. This request format mirrors the VTL templates in github.com/mweagle/Sparta/resources/provision/apigateway

Jump to

Keyboard shortcuts

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