requestid

package
v0.35.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Unlicense Imports: 5 Imported by: 0

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