middleware

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLoggerConfig = LoggerConfig{
	MaxOutputRequestBodyLen:  1024 * 1024,
	MaxOutputResponseBodyLen: 1024 * 1024,
}
View Source
var DefaultRecoveryConfig = RecoveryConfig{
	Skip: 3,
}
View Source
var DefaultTraceConfig = TraceConfig{
	RequestHeaderKey: "X-Request-Id",
	ResponseTraceKey: "X-Trace-Id",
}

Functions

func AllowedPathPrefixes

func AllowedPathPrefixes(c *gin.Context, prefixes ...string) bool

func AuthWithConfig

func AuthWithConfig(config AuthConfig) gin.HandlerFunc

func Empty

func Empty() gin.HandlerFunc

func Logger

func Logger() gin.HandlerFunc

func LoggerWithConfig

func LoggerWithConfig(config LoggerConfig) gin.HandlerFunc

func Recovery

func Recovery() gin.HandlerFunc

func RecoveryWithConfig

func RecoveryWithConfig(config RecoveryConfig) gin.HandlerFunc

func SkippedPathPrefixes

func SkippedPathPrefixes(c *gin.Context, prefixes ...string) bool

func Trace

func Trace() gin.HandlerFunc

func TraceWithConfig

func TraceWithConfig(config TraceConfig) gin.HandlerFunc

Types

type AuthConfig

type AuthConfig struct {
	AllowedPathPrefixes []string
	SkippedPathPrefixes []string
	Skipper             func(*gin.Context) bool
	ParseUser           func(*gin.Context) (string, error)
}

type LoggerConfig

type LoggerConfig struct {
	SkippedPathPrefixes      []string
	AllowedPathPrefixes      []string
	MaxOutputRequestBodyLen  int
	MaxOutputResponseBodyLen int
}

type RecoveryConfig

type RecoveryConfig struct {
	Skip int
}

type TraceConfig

type TraceConfig struct {
	SkippedPathPrefixes []string
	AllowedPathPrefixes []string
	RequestHeaderKey    string
	ResponseTraceKey    string
}

Jump to

Keyboard shortcuts

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