middleware

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const TraceIdHeader = "X-Request-Id"

Variables

This section is empty.

Functions

func AddRequestIdToContextAndResponse

func AddRequestIdToContextAndResponse(next http.Handler) http.Handler

func CorsHandling

func CorsHandling(next http.Handler) http.Handler

func ErrorHandler

func ErrorHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, msg string, status int, details url.Values)

func PanicRecoverer

func PanicRecoverer(next http.Handler) http.Handler

func RequestLogger

func RequestLogger(next http.Handler) http.Handler

func TokenValidator

func TokenValidator(next http.Handler) http.Handler

func UnauthenticatedError

func UnauthenticatedError(ctx context.Context, w http.ResponseWriter, r *http.Request, details string, logMessage string)

func WriteJson

func WriteJson(ctx context.Context, w http.ResponseWriter, v interface{})

Types

type AllClaims

type AllClaims struct {
	jwt.RegisteredClaims
	CustomClaims
}

type CustomClaims

type CustomClaims struct {
	Email         string   `json:"email"`
	EmailVerified bool     `json:"email_verified"`
	Groups        []string `json:"groups,omitempty"`
	Name          string   `json:"name"`
}

Jump to

Keyboard shortcuts

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