common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 7 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonMiddleware

type CommonMiddleware struct {
	// contains filtered or unexported fields
}

CommonMiddleware provides common middleware functionality

func NewCommonMiddleware

func NewCommonMiddleware(logger logger.Logger) *CommonMiddleware

NewCommonMiddleware creates a new common middleware instance

func (*CommonMiddleware) Correlation

func (m *CommonMiddleware) Correlation() gin.HandlerFunc

Correlation middleware handles correlation ID for distributed tracing

func (*CommonMiddleware) GZIP

func (m *CommonMiddleware) GZIP() gin.HandlerFunc

GZIP middleware enables gzip compression

func (*CommonMiddleware) NoCache

func (m *CommonMiddleware) NoCache() gin.HandlerFunc

NoCache middleware sets headers to prevent caching

func (*CommonMiddleware) Recovery

func (m *CommonMiddleware) Recovery() gin.HandlerFunc

Recovery middleware handles panics and converts them to errors

func (*CommonMiddleware) RequestID

func (m *CommonMiddleware) RequestID() gin.HandlerFunc

RequestID middleware adds a unique request ID to each request

func (*CommonMiddleware) TenantID

func (m *CommonMiddleware) TenantID() gin.HandlerFunc

TenantID middleware handles multi-tenant context

func (*CommonMiddleware) Timeout

func (m *CommonMiddleware) Timeout(duration time.Duration) gin.HandlerFunc

Timeout middleware adds timeout to requests

func (*CommonMiddleware) UserID

func (m *CommonMiddleware) UserID() gin.HandlerFunc

UserID middleware extracts user ID from JWT or headers

type PanicError

type PanicError struct {
	Message interface{}
}

PanicError wraps panic recovery

func (*PanicError) Error

func (e *PanicError) Error() string

Jump to

Keyboard shortcuts

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