echo

package
v2.4.34 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const IdempotencyKey = "Idempotency-Key"

Variables

This section is empty.

Functions

func BasicAuthValidator

func BasicAuthValidator(basicAuthUser string, basicAuthPassword string) middleware.BasicAuthValidator

func CustomErrorHandler

func CustomErrorHandler[E ApiError](errorHandler ErrorHandler[E]) func(error, echo.Context)

func IdempotencyMiddlewareEcho

func IdempotencyMiddlewareEcho(store idempotency.IdempotencyStore) echo.MiddlewareFunc

IdempotencyMiddlewareEcho provides idempotency for Echo handlers.

func LogHttpError

func LogHttpError(logger *logrus.Entry, path string, code int, err error)

LogHttpError logs errors with a different log level depending on the http status code.

Types

type ApiError

type ApiError interface {
	error
	ToErrorResponse() api.ErrorResponse
}

type ErrorHandler

type ErrorHandler[E ApiError] struct {
	UnknownError   func(msg string) error
	TimeoutError   func(msg string) ApiError
	HttpStatusFrom func(ctx context.Context, err error) int
	ToApiError     func(err error) E
}

func (*ErrorHandler[E]) HandleError

func (eh *ErrorHandler[E]) HandleError(ctx context.Context, c echo.Context, err error)

Jump to

Keyboard shortcuts

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