middleware

package
v0.30.2-dev Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() func(context.Context) context.Context

Logger injects a logger with connectionID and traceID into the context. This ensures all log statements within WebSocket callbacks automatically include both IDs for proper correlation.

Returns a WebSocketMiddleware function that can be used with websocket.WithMiddleware().

func TraceID

func TraceID() func(context.Context) context.Context

TraceID generates a fresh trace ID for each WebSocket callback invocation. This allows each message, connection event, and disconnect to be traced independently while maintaining the same connectionID throughout the connection lifecycle.

Returns a WebSocketMiddleware function that can be used with websocket.WithMiddleware().

Types

This section is empty.

Jump to

Keyboard shortcuts

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