requestid

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package requestid provides request ID propagation for Connect RPC handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterceptor

func NewInterceptor(cfg Config) connect.Interceptor

NewInterceptor creates a Connect RPC interceptor that propagates or generates request IDs. It extracts the request ID from the configured header, or generates a new UUID v4 if missing. The request ID is stored in the context via ctxutil.WithRequestID.

Types

type Config

type Config struct {
	// HeaderName is the HTTP header to read request IDs from.
	HeaderName string `koanf:"header_name"`
}

Config holds configuration for the request ID interceptor.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible default values.

Jump to

Keyboard shortcuts

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