gin

package
v0.0.0-...-d7d4aa8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggerHandler

func LoggerHandler() gin.HandlerFunc

LoggerHandler record log

Example
router.Use(LoggerHandler())
Output:

func RecoverHandler

func RecoverHandler() gin.HandlerFunc

RecoverHandler recover from panic

Example
router.Use(RecoverHandler())
Output:

func WithTrace

func WithTrace(c *gin.Context, birth time.Time) *gin.Context

WithTrace add trace log context

Types

type HttpMetaData

type HttpMetaData consts.MetaData
const (
	HTTPStatusCode  HttpMetaData = "statusCode"
	HTTPContentType HttpMetaData = "contentType"
	HTTPMethod      HttpMetaData = "httpMethod"
	HTTPPath        HttpMetaData = "httpPath"
	HTTPQuery       HttpMetaData = "httpQuery"
	HTTPClientIp    HttpMetaData = "httpClientIp"
	HTTPUserAgent   HttpMetaData = "httpUserAgent"
)

Jump to

Keyboard shortcuts

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