lambda

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequest

func GetRequest(event *LambdaRequest) *http.Request

func Handler

func Handler(router *server.Router) func(event *LambdaRequest) (*LambdaResponse, error)

Types

type LambdaRequest added in v0.8.1

type LambdaRequest struct {
	Body                  string            `json:"body"`
	IsBase64Encoded       bool              `json:"isBase64Encoded"`
	QueryStringParameters map[string]string `json:"queryStringParameters"`
	RawPath               string            `json:"rawPath"`
	RawQueryString        string            `json:"rawQueryString"`
	Headers               map[string]string `json:"headers"`
	Cookies               []string          `json:"cookies"`
	RequestContext        struct {
		DomainName string `json:"domainName"`
		Http       struct {
			Method string `json:"method"`
		} `json:"http"`
	} `json:"requestContext"`
}

type LambdaResponse added in v0.8.1

type LambdaResponse struct {
	StatusCode      int               `json:"statusCode"`
	Headers         map[string]string `json:"headers"`
	Body            string            `json:"body"`
	Cookies         []string          `json:"cookies"`
	IsBase64Encoded bool              `json:"isBase64Encoded"`
}

type LambdaResponseWriter

type LambdaResponseWriter struct {
	// contains filtered or unexported fields
}

func NewLambdaResponseWriter

func NewLambdaResponseWriter() *LambdaResponseWriter

func (LambdaResponseWriter) GetLambdaResponse

func (lrw LambdaResponseWriter) GetLambdaResponse() *LambdaResponse

func (*LambdaResponseWriter) Header

func (lrw *LambdaResponseWriter) Header() http.Header

func (*LambdaResponseWriter) Write

func (lrw *LambdaResponseWriter) Write(part []byte) (int, error)

func (*LambdaResponseWriter) WriteHeader

func (lrw *LambdaResponseWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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