reconn

package module
v0.0.0-...-7053d01 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2016 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package reconn provides an implementation of net.Conn that allows replaying a limited amount of the data that was read from the underlying conn. This can be used to implement look aheads on top of other net.Conns.

Index

Constants

This section is empty.

Variables

View Source
var ErrOverflowed = errors.New("replay buffer overflowed")

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, limit int) *Conn

Wrap wraps the supplied conn, allowing replay from the current point up to the given limit.

func (*Conn) Read

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

Read implements the method from net.Conn with added support for replaying.

func (*Conn) Rereader

func (conn *Conn) Rereader() (io.Reader, error)

Rereader returns an io.Reader that reads from the last marked point. If the connection has overflowed, this returns an error.

Jump to

Keyboard shortcuts

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