middleware

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 13 Imported by: 0

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-03 23:43:22 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

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 ChiLoggerRequest

func ChiLoggerRequest(next http.Handler) http.Handler

func InitLogger

func InitLogger(logger logrus.FieldLogger) func(next http.Handler) http.Handler

func Jwt

func Jwt()

func LoggerFromCtx

func LoggerFromCtx(ctx context.Context) logrus.FieldLogger

LoggerFromCtx if not exist will panic

func Recovery

func Recovery(logger logrus.FieldLogger) func(next http.Handler) http.Handler

Types

type ContextKey

type ContextKey string

Jump to

Keyboard shortcuts

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