iohelpers

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncCloser

func FuncCloser(r io.Reader, closer func() error) io.ReadCloser

FuncCloser turns an io.Reader into an io.ReadCloser by calling a supplied function on Close.

func NewTracedConnection

func NewTracedConnection(conn net.Conn) net.Conn

NewTracedConnection wraps an existing connection to trace calls to methods on it.

Types

type LoggedConnection

type LoggedConnection struct {
	net.Conn
	// contains filtered or unexported fields
}

LoggedConnection is a net.Conn helper which logs all call activity. It is useful for debugging packages with opaque connection handling paths, as poller_exporter leans heavily on incremental construction of net.Conn sessions.

func (LoggedConnection) Close

func (conn LoggedConnection) Close() error

func (LoggedConnection) Read

func (conn LoggedConnection) Read(b []byte) (n int, err error)

func (LoggedConnection) SetDeadline

func (conn LoggedConnection) SetDeadline(t time.Time) error

func (LoggedConnection) SetReadDeadline

func (conn LoggedConnection) SetReadDeadline(t time.Time) error

func (LoggedConnection) SetWriteDeadline

func (conn LoggedConnection) SetWriteDeadline(t time.Time) error

func (LoggedConnection) Write

func (conn LoggedConnection) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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