requestid

package
v0.35.21 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Unlicense Imports: 5 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package requestid contains utilities for working with request ids.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithRequestID

func ContextWithRequestID(parent context.Context, id ID) (ctx context.Context)

ContextWithRequestID returns a new context with the given ID.

Types

type ID

type ID string

ID is the ID of a request. It is an opaque, randomly generated string.

func IDFromContext

func IDFromContext(ctx context.Context) (id ID, ok bool)

IDFromContext returns ID for this request, if any.

func MustIDFromContext

func MustIDFromContext(ctx context.Context) (id ID)

MustIDFromContext returns ID for this request and panics if there is no ID.

func New

func New() (id ID)

New generates new request ID.

Jump to

Keyboard shortcuts

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