preconn

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package preconn provides an implementation of net.Conn that allows insertion of data before the beginning of the underlying connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn is a net.Conn that supports replaying.

func Wrap

func Wrap(conn net.Conn, head []byte) *Conn

Wrap wraps the supplied conn and inserting the given bytes at the head of the stream.

func WrapReader

func WrapReader(conn net.Conn, head io.Reader) *Conn

WrapReader wraps the supplied conn, reading from 'head' first.

func (*Conn) Read

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

Read implements the method from net.Conn and first consumes the head before using the underlying connection.

Jump to

Keyboard shortcuts

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