Help us shape the future of Go! Take the 2026 Go Developer Survey

netstats

package
v5.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConn

func NewConn(c net.Conn) net.Conn

NewConn returns a net.Conn object that wraps c and produces metrics on the default engine.

func NewConnWith

func NewConnWith(eng *stats.Engine, c net.Conn) net.Conn

NewConnWith returns a net.Conn object that wraps c and produces metrics on eng.

func NewListener

func NewListener(lstn net.Listener) net.Listener

NewListener returns a new net.Listener which uses the stats.DefaultEngine.

func NewListenerWith

func NewListenerWith(eng *stats.Engine, lstn net.Listener) net.Listener

NewListenerWith returns a new net.Listener with the provided *stats.Engine.

Types

type Handler

type Handler interface {
	ServeConn(ctx context.Context, conn net.Conn)
}

Handler is an interface that can be implemented by types that serve network connections.

func NewHandler

func NewHandler(hdl Handler) Handler

NewHandler returns a Handler object that warps hdl and produces metrics on the default engine.

func NewHandlerWith

func NewHandlerWith(eng *stats.Engine, hdl Handler) Handler

NewHandlerWith returns a Handler object that warps hdl and produces metrics on eng.

Jump to

Keyboard shortcuts

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