middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package middleware provides HTTP middleware components for the Service Layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler() gin.HandlerFunc

ErrorHandler is a middleware that handles errors and standardizes the error response format. It captures errors from gin's error chain, converts them to ServiceError types, adds request IDs, logs errors, and sends standardized error responses to clients.

func RequestLogger

func RequestLogger() gin.HandlerFunc

RequestLogger is a middleware that logs all incoming requests.

func ValidationErrorHandler

func ValidationErrorHandler() gin.HandlerFunc

ValidationErrorHandler is a middleware that handles validation errors. It should be used with validators like go-playground/validator.

Types

This section is empty.

Jump to

Keyboard shortcuts

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