Documentation ¶
Index ¶
- func GetLambdaEvent(ctx context.Context) (*events.APIGatewayProxyRequest, error)
- func GetLambdaEventV2(ctx context.Context) (*events.APIGatewayV2HTTPRequest, error)
- func NewHandler(h http.Handler, opts ...Options) lambda.Handler
- func ServeOrStartLambda(addr string, h http.Handler, opts ...Options) error
- func SetBase64Encoding(w http.ResponseWriter, enabled bool) error
- func Start(h http.Handler, opts ...Options)
- type Handler
- type Options
- type ResponseWriter
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLambdaEvent ¶
func GetLambdaEvent(ctx context.Context) (*events.APIGatewayProxyRequest, error)
GetLambdaEvent from context
func GetLambdaEventV2 ¶
func GetLambdaEventV2(ctx context.Context) (*events.APIGatewayV2HTTPRequest, error)
GetLambdaEventV2 from context
func ServeOrStartLambda ¶
ServeOrStartLambda will start http server if it's not in lambda environment, otherwise it starts handling lambda
func SetBase64Encoding ¶
func SetBase64Encoding(w http.ResponseWriter, enabled bool) error
SetBase64Encoding overrides base64 encoding for this response see Configuration.SetBase64Encoding
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
type Options ¶
type Options func(*config)
func WithAPIGatewayV1 ¶
func WithAPIGatewayV1() Options
func WithAPIGatewayV2 ¶
func WithAPIGatewayV2() Options
func WithEncodeResponse ¶
func WithEncodeResponse() Options
func WithLambdaURL ¶
func WithLambdaURL() Options
func WithTransformer ¶
func WithTransformer(t Transformer) Options
type ResponseWriter ¶
type ResponseWriter struct {
// contains filtered or unexported fields
}
ResponseWriter implements http.ResponseWriter used for buffering response
func NewResponseWriter ¶
func NewResponseWriter() *ResponseWriter
NewResponseWriter creates new empty ResponseWriter
func (*ResponseWriter) Header ¶
func (r *ResponseWriter) Header() http.Header
Header returns http.Header. You can modify it to send response header
func (*ResponseWriter) Write ¶
func (r *ResponseWriter) Write(chunk []byte) (int, error)
Write appends chunk to response body
func (*ResponseWriter) WriteHeader ¶
func (r *ResponseWriter) WriteHeader(statusCode int)
WriteHeader set status code of current request
Click to show internal directories.
Click to hide internal directories.