middleware

package
v0.0.0-...-55f5305 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(ctx *fiber.Ctx, err error) error

func KeyAuth

func KeyAuth(config *config.Config) fiber.Handler

func Logger

func Logger(logger *zap.Logger) fiber.Handler

func RequestId

func RequestId() fiber.Handler

Types

type HttpError

type HttpError struct {
	// status_code return a http status code depending on the error
	StatusCode int `json:"status_code" example:"404"`
	/*
		message is a human-readable displayable safe to use error
		message on what the error is reason for the error and how to resolve the error
	*/
	Message string `json:"message" example:"bucket not found"`
	//	path the error happened on means the http endpoint where the error happened
	Path string `json:"path" example:"/api/v1/buckets"`
	/*
			request_id is an id used to track the request from start to response return.
		 	this can be used for finding out the starting point of the error how it happened in the system
	*/
	RequestId string `json:"request_id" example:"01HPG4GN5JY2Z6S0638ERSG375"`
}

Jump to

Keyboard shortcuts

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