reqctx

package
v2.0.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

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.

func GetLocal

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.

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

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

SetLocal stores a value in the fiber context under key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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