Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultLoggerConfig is the default Logger middleware config. DefaultLoggerConfig = LoggerConfig{ Skipper: echomw.DefaultSkipper, Output: os.Stdout, } )
Functions ¶
func CheckSignin ¶
func CheckSignin(next echo.HandlerFunc) echo.HandlerFunc
CheckSignin 检查用户是否登录的middleware
func ContextExtend ¶
func ContextExtend(h echo.HandlerFunc) echo.HandlerFunc
ContextExtend 扩展context中间件
func Logrus ¶
func Logrus() echo.MiddlewareFunc
Logrus returns a middleware that logs HTTP requests.
func LogrusDefaultConfig ¶
func LogrusDefaultConfig(config LoggerConfig) echo.MiddlewareFunc
LogrusDefaultConfig returns a Logrus middleware with default config.
Types ¶
type LoggerConfig ¶
type LoggerConfig struct { // Skipper defines a function to skip middleware. Skipper echomw.Skipper // Output is a writer where logs in JSON format are written. // Optional. Default value os.Stdout. Output io.Writer // contains filtered or unexported fields }
LoggerConfig defines the config for Logger middleware.
Click to show internal directories.
Click to hide internal directories.