echo

package
v2.4.39 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const IdempotencyKey = "Idempotency-Key"

Variables

This section is empty.

Functions

func BasicAuthUsersValidator added in v2.4.38

func BasicAuthUsersValidator(users map[string]string) middleware.BasicAuthValidator

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)

type RestUsers added in v2.4.38

type RestUsers struct {
	RestUser map[string]string `long:"http-rest-user" description:"Usernames for REST API access."`
}

Jump to

Keyboard shortcuts

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