Documentation
¶
Index ¶
- func ClientIPFrom(ctx context.Context) string
- func LoggerFrom(ctx context.Context) any
- func RequestIDFrom(ctx context.Context) string
- func WithClientIP(ctx context.Context, ip string) context.Context
- func WithLogger(ctx context.Context, logger any) context.Context
- func WithRequestID(ctx context.Context, id string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientIPFrom ¶
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 RequestIDFrom ¶
func WithClientIP ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.