requestid

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 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.ServerInterceptor

NewInterceptor creates a Connect RPC server interceptor that propagates or generates request IDs. It extracts the request ID from the configured header, or generates a new UUID v4 if the header is missing or is not 1-128 bytes of ASCII letters, digits or ".", "_", ":", "-". 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