ctxval

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIPFrom

func ClientIPFrom(ctx context.Context) string

ClientIPFrom retrieves the client IP stored by WithClientIP. Returns "" when absent; callers should skip IP-based rate limiting in that case rather than keying on the empty string (which would be a global bucket).

func LoggerFrom

func LoggerFrom(ctx context.Context) any

func RequestIDFrom

func RequestIDFrom(ctx context.Context) string

func WithClientIP

func WithClientIP(ctx context.Context, ip string) context.Context

WithClientIP stores the resolved client IP in ctx. Called by HTTP middleware so handlers can key rate limiters on source address in addition to user-supplied identifiers.

func WithLogger

func WithLogger(ctx context.Context, logger any) context.Context

func WithRequestID

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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