middleware

package
v0.0.0-...-7def0e2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestID

func GetRequestID(ctx context.Context) string

func SetRequestId

func SetRequestId(ctx context.Context, value string) context.Context

Types

type LoggingMiddleware

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

func NewLoggingMiddleware

func NewLoggingMiddleware(next http.Handler, logger *slog.Logger) *LoggingMiddleware

func (*LoggingMiddleware) ServeHTTP

func (m *LoggingMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RequestIdHandler

type RequestIdHandler struct {
	slog.Handler
}

func NewRequestIdHandler

func NewRequestIdHandler(handler slog.Handler) *RequestIdHandler

func (*RequestIdHandler) Handle

func (h *RequestIdHandler) Handle(ctx context.Context, record slog.Record) error

func (*RequestIdHandler) WithAttrs

func (h *RequestIdHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*RequestIdHandler) WithGroup

func (h *RequestIdHandler) WithGroup(name string) slog.Handler

type RequestIdMiddleware

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

func NewRequestIdMiddleware

func NewRequestIdMiddleware(next http.Handler, allowRemote bool) *RequestIdMiddleware

func (*RequestIdMiddleware) ServeHTTP

func (m *RequestIdMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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