Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhyanio/lambda-function-go
AWS Lambda Func with Beautifull Golang.
https://github.com/dhyanio/lambda-function-go
Last synced: 20 days ago
JSON representation
AWS Lambda Func with Beautifull Golang.
- Host: GitHub
- URL: https://github.com/dhyanio/lambda-function-go
- Owner: dhyanio
- License: mit
- Created: 2021-03-24T15:07:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-24T15:15:00.000Z (almost 4 years ago)
- Last Synced: 2024-06-19T04:27:28.989Z (6 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lambda-function-go
AWS Lambda Func with Beautifull Golang.## Events
Best way to provide the responses that the AWS API Gateway needs is to install the github.com/aws/aws-lambda-go/events package
This is a AWS Native API Gateway evernts handler for Golang requests. Two important types (APIGatewayProxyRequest and APIGatewayProxyResponse) which contain information about incoming HTTP requests and allow us to construct responses that the API Gateway understands.
```golang
type APIGatewayProxyRequest struct {
Resource string `json:"resource"` // The resource path defined in API Gateway
Path string `json:"path"` // The url path for the caller
HTTPMethod string `json:"httpMethod"`
Headers map[string]string `json:"headers"`
QueryStringParameters map[string]string `json:"queryStringParameters"`
PathParameters map[string]string `json:"pathParameters"`
StageVariables map[string]string `json:"stageVariables"`
RequestContext APIGatewayProxyRequestContext `json:"requestContext"`
Body string `json:"body"`
IsBase64Encoded bool `json:"isBase64Encoded,omitempty"`
}
``````golang
type APIGatewayProxyResponse struct {
StatusCode int `json:"statusCode"`
Headers map[string]string `json:"headers"`
Body string `json:"body"`
IsBase64Encoded bool `json:"isBase64Encoded,omitempty"`
}
```