middleware

package
v0.0.0-...-ea3a45e Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package middleware contains middlewares for lambda.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRecovery

func WithRecovery(h alexa.Handler, log *logger.Logger) alexa.Handler

WithRecovery recovers from panics and log the error.

func WithRequestStats

func WithRequestStats(h alexa.Handler, stat *statter.Statter) alexa.Handler

WithRequestStats adds counter and timing stats to intent requests.

Types

type Recovery

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

Recovery is a middleware that will recover from panics and logs the error.

func (Recovery) Serve

func (m Recovery) Serve(b *alexa.ResponseBuilder, r *alexa.RequestEnvelope)

Serve serves the request.

func (Recovery) ServeHTTP

func (m Recovery) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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