Versions in this module Expand all Collapse all v0 v0.1.1 Oct 22, 2024 Changes in this version + func ConvertAPIGatewayProxyRequest(ctx context.Context, e events.APIGatewayProxyRequest) (*http.Request, error) + func ConvertAPIGatewayV2HTTPRequest(ctx context.Context, e events.APIGatewayV2HTTPRequest) (*http.Request, error) + func ConvertResponseV1(data ResponseData) (events.APIGatewayProxyResponse, error) + func ConvertResponseV2(data ResponseData) (events.APIGatewayV2HTTPResponse, error) + func ListenAndServe[T any, R any](addr string, handler http.Handler, requestConverter RequestConverter[T], ...) error + func NewContext[T any](ctx context.Context, e T) context.Context + func RequestContext[T any](ctx context.Context) (T, bool) + type Gateway struct + func NewGateway[T any, R any](handler http.Handler, requestConverter RequestConverter[T], ...) *Gateway[T, R] + func (gw *Gateway[T, R]) Invoke(ctx context.Context, payload []byte) ([]byte, error) + type Key int + func GetRequestContextKey() Key + type RequestConverter func(context.Context, T) (*http.Request, error) + type ResponseConverter func(ResponseData) (R, error) + type ResponseData struct + Body []byte + Headers http.Header + StatusCode int + type ResponseWriter struct + func NewResponse() *ResponseWriter + func (w *ResponseWriter) CloseNotify() <-chan bool + func (w *ResponseWriter) Header() http.Header + func (w *ResponseWriter) Write(b []byte) (int, error) + func (w *ResponseWriter) WriteHeader(statusCode int)