Documentation
¶
Index ¶
- func From(ec echo.Context) context.Context
- func Logger(ctx context.Context) *zap.Logger
- func Middleware(logger *zap.Logger, tracer trace.Tracer) echo.MiddlewareFunc
- func MustLogger(ctx context.Context) *zap.Logger
- func RequestID(ctx context.Context) string
- func Tracer(ctx context.Context) trace.Tracer
- func WithLogger(ctx context.Context, l *zap.Logger) context.Context
- func WithRequestID(ctx context.Context, id string) context.Context
- func WithTracer(ctx context.Context, t trace.Tracer) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func From ¶
From returns the request-scoped context.Context from an echo.Context.
Call this once at the handler boundary; downstream code should accept context.Context, not echo.Context.
func Logger ¶
Logger returns the request-scoped *zap.Logger from ctx. Returns a no-op logger if none was registered.
func Middleware ¶
Middleware injects logger, tracer, and request ID into the request's context.Context, making them available via Logger, Tracer, and RequestID.
tracer may be nil (tracing disabled). Tracer returns a no-op fallback.
func MustLogger ¶
MustLogger returns the request-scoped *zap.Logger from ctx. Panics if no logger is present. Use in code that must fail fast when context is misconfigured.
func Tracer ¶
Tracer returns the OTel tracer from ctx. Returns a no-op tracer if none was registered, no spans are produced.
func WithLogger ¶
WithLogger stores the logger in ctx.
func WithRequestID ¶
WithRequestID stores the request ID in ctx.
Types ¶
This section is empty.