reqctx

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package reqctx provides request-scoped helpers: context access, request IDs, and type-safe locals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContext deprecated

func GetContext(c fiber.Ctx) context.Context

GetContext retrieves the context stored by ContextMiddleware from the Fiber request locals. It falls back to context.Background if no context was set.

Deprecated: use c.Context(), which returns the same context under ContextMiddleware.

func GetLocal deprecated

func GetLocal[T any](c fiber.Ctx, key string) T

GetLocal retrieves a value of type T from the fiber context. It returns the zero value of T if the key is absent or the type does not match.

Deprecated: use fiber.Locals[T](c, key).

func GetRequestID

func GetRequestID(c fiber.Ctx) string

GetRequestID retrieves the request ID stored by ContextMiddleware from the Fiber request locals. It returns an empty string if no request ID was set.

func SetLocal deprecated

func SetLocal(c fiber.Ctx, key string, value any)

SetLocal stores a value in the fiber context under key.

Deprecated: use fiber.Locals(c, key, value).

Types

This section is empty.

Jump to

Keyboard shortcuts

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