wrapper

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapConn

func WrapConn(service string, c net.Conn) net.Conn

WrapConn wraps a net.Conn with metrics tracking. Bytes read/written are counted as service transfer input/output. If c is nil, nil is returned.

func WrapListener

func WrapListener(service string, ln net.Listener) net.Listener

WrapListener wraps a net.Listener so that all accepted connections are automatically wrapped with WrapConn for metrics tracking. If metrics are not enabled, ln is returned unchanged to allow splice(2) optimization on bare *net.TCPConn. If ln is nil, nil is returned.

func WrapPacketConn

func WrapPacketConn(service string, pc net.PacketConn) net.PacketConn

WrapPacketConn wraps a net.PacketConn with metrics tracking. Bytes read/written are counted as service transfer input/output. If pc is nil, nil is returned.

func WrapUDPConn

func WrapUDPConn(service string, pc net.PacketConn) udp.Conn

WrapUDPConn wraps a net.PacketConn as a udp.Conn with metrics tracking. Bytes read/written are counted as service transfer input/output. If pc is nil, nil is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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