Documentation
¶
Overview ¶
Package serverless adapts a Nimbus application (any http.Handler, such as app.Router) to serverless invocation models — starting with AWS Lambda.
It has no AWS SDK dependency: it converts the Lambda proxy event JSON to a standard *http.Request, runs it through your handler, and converts the recorded response back to the Lambda proxy response shape. Your Lambda entry point wires it to the AWS runtime:
// cmd/lambda/main.go
package main
import (
"github.com/aws/aws-lambda-go/lambda"
"github.com/CodeSyncr/nimbus/serverless"
"yourapp/bin"
)
func main() {
app := bin.Boot() // build the app (routes + middleware)
_ = app.Boot() // run providers/plugins (no HTTP listener)
lambda.Start(serverless.Lambda(app.Router))
}
Supports both API Gateway / Lambda Function URL payload formats: v2.0 (HTTP API, Function URLs) and v1.0 (REST API, ALB).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct {
StatusCode int `json:"statusCode"`
Headers map[string]string `json:"headers,omitempty"`
MultiValueHeaders map[string][]string `json:"multiValueHeaders,omitempty"`
Cookies []string `json:"cookies,omitempty"` // v2 only
Body string `json:"body"`
IsBase64Encoded bool `json:"isBase64Encoded"`
}
Response is the Lambda proxy response shape shared by API Gateway v1/v2, Function URLs, and ALB. The AWS runtime marshals this to JSON.