ctxutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package ctxutil provides small, domain-agnostic helpers for threading values through context.Context. It currently carries an HTTP request id so a single id can be propagated across handler, service, and worker boundaries without callers threading it explicitly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestIDFrom

func RequestIDFrom(ctx context.Context) string

RequestIDFrom returns the request id stamped on ctx, or "" when none is present. Services and workers use this to read the id without taking a dependency on the HTTP layer that originally set it.

func WithRequestID

func WithRequestID(ctx context.Context, id string) context.Context

WithRequestID returns ctx tagged with id. An empty id is a no-op so callers can pass the value through without branching.

Types

This section is empty.

Jump to

Keyboard shortcuts

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