compat

package
v0.0.0-...-fd00b2c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrainBuffer

func DrainBuffer(rw *bufio.ReadWriter, conn net.Conn) net.Conn

func IsSingleReader

func IsSingleReader(r io.Reader) bool

func Listen

func Listen(logger *zerolog.Logger, network, address string) (net.Listener, error)

Listen returns a *compat.Listener wrapping the listener returned by a call to net.Listen(network, address)

func MultiReader

func MultiReader(r1, r2 io.Reader) io.Reader

func StripBuffer

func StripBuffer(r *bufio.Reader) io.Reader

StripBuffer returns an io.Reader that returns io.EOF after all buffered content in r is read.

func UnwrapReader

func UnwrapReader(r io.Reader) io.Reader

Types

type Conn

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

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

type Listener

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

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept accepts the next connection but returns a net.Conn that has been wrapped to scan for ICE/1.0 in the HTTP request line and replaces it with a HTTP/1.0 instance.

func (*Listener) File

func (l *Listener) File() (*os.File, error)

Jump to

Keyboard shortcuts

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