Documentation ¶
Index ¶
- Constants
- func CSRFMiddleware(tk *utils.CryptToken, sm *utils.SessionManager) mux.MiddlewareFunc
- func CreateMetricsMiddleware(metric *metrics.HTTPMetrics) mux.MiddlewareFunc
- func GetLogger(ctx context.Context) *zap.Logger
- func GetRequestID(ctx context.Context) string
- func LoggerMiddleware(next http.Handler) http.Handler
- func RequestIDMiddleware(next http.Handler) http.Handler
- func WithLogger(ctx context.Context, logger *zap.Logger) context.Context
- type AuthMiddleware
- type LokiMiddleware
Constants ¶
View Source
const ( RequestIDKey contextKey = "request_id" LoggerKey contextKey = "logger" )
Variables ¶
This section is empty.
Functions ¶
func CSRFMiddleware ¶
func CSRFMiddleware(tk *utils.CryptToken, sm *utils.SessionManager) mux.MiddlewareFunc
func CreateMetricsMiddleware ¶
func CreateMetricsMiddleware(metric *metrics.HTTPMetrics) mux.MiddlewareFunc
func GetRequestID ¶
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
Click to show internal directories.
Click to hide internal directories.