Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIErrorHandler ¶
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.