Documentation
¶
Overview ¶
Author: Daniel TAN Date: 2021-10-02 23:57:42 LastEditors: Daniel TAN LastEditTime: 2021-10-03 00:19:49 FilePath: /trinity-micro/middleware/jwt.go Description:
Author: Daniel TAN Date: 2021-10-02 23:44:42 LastEditors: Daniel TAN LastEditTime: 2021-10-18 01:15:02 FilePath: /trinity-micro/middleware/logger.go Description:
Author: Daniel TAN Date: 2021-10-04 01:30:26 LastEditors: Daniel TAN LastEditTime: 2021-10-04 01:35:04 FilePath: /trinity-micro/middleware/recovery.go Description:
Index ¶
- Constants
- func ChiLoggerRequest(next http.Handler) http.Handler
- func InitLogger(logger logrus.FieldLogger) func(next http.Handler) http.Handler
- func Jwt()
- func LoggerFromCtx(ctx context.Context) logrus.FieldLogger
- func Recovery(logger logrus.FieldLogger) func(next http.Handler) http.Handler
- func SetLoggerCtx(ctx context.Context, logger logrus.FieldLogger) context.Context
- type ContextKey
Constants ¶
View Source
const ( ContextLogger ContextKey = "trinity-context-logger" UrlPath string = "url.path" UrlMethod string = "url.method" UrlPattern string = "url.pattern" )
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func LoggerFromCtx ¶
func LoggerFromCtx(ctx context.Context) logrus.FieldLogger
LoggerFromCtx if not exist will panic
func SetLoggerCtx ¶ added in v0.1.6
Types ¶
type ContextKey ¶
type ContextKey string
Click to show internal directories.
Click to hide internal directories.