echo

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIErrorHandler

func APIErrorHandler(err error, c echo.Context)

APIErrorHandler handles errors occurring in the API classes

Based on echo.DefaultHTTPErrorHandler but always logging errors and returning "problem" response with content-type "application/problem+json". By default the handler will setup a http status code 500 unless the error is either a types.Problem or echo.HTTPError then the status code from the error will be used.

func RequestLogger

func RequestLogger() echo.MiddlewareFunc

RequestLogger is a middleware function to log requests in echo using slog. It will try to retrieve a logger from the context.Context but will fall back to the default logger.

func SlogContext

func SlogContext(logger *slog.Logger) echo.MiddlewareFunc

SlogContext is a middleware function to add the given logger is to the request context. The logger may then be retrieved from the context using log.FromContext

Types

This section is empty.

Jump to

Keyboard shortcuts

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