middleware

package
v0.0.0-...-5a72114 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestIDKey contextKey = "request_id"
	LoggerKey    contextKey = "logger"
)

Variables

This section is empty.

Functions

func CreateMetricsMiddleware

func CreateMetricsMiddleware(metric *metrics.HTTPMetrics) mux.MiddlewareFunc

func GetLogger

func GetLogger(ctx context.Context) *zap.Logger

func GetRequestID

func GetRequestID(ctx context.Context) string

func LoggerMiddleware

func LoggerMiddleware(next http.Handler) http.Handler

func RequestIDMiddleware

func RequestIDMiddleware(next http.Handler) http.Handler

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

Types

type AuthMiddleware

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

func NewAuthMiddleware

func NewAuthMiddleware(sm *utils.SessionManager) *AuthMiddleware

func (*AuthMiddleware) AuthMiddleware

func (m *AuthMiddleware) AuthMiddleware(next http.Handler) http.Handler

func (*AuthMiddleware) SessionMiddleware

func (m *AuthMiddleware) SessionMiddleware(next http.Handler) http.Handler

type LokiMiddleware

type LokiMiddleware struct {
	// contains filtered or unexported fields
}

func NewLokiMiddleware

func NewLokiMiddleware(lokiClient *loki.Client, logger *zap.Logger) *LokiMiddleware

func (*LokiMiddleware) Handler

func (m *LokiMiddleware) Handler(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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