func NewLimitReader(reader io.Reader, props ReadLimitProps) LimitReader {
	readerLimit := props.Limit
	if props.FailOnExceed {
		readerLimit += 1
	}
	return LimitReader{
		errOnEOF:     props.ErrOnEOF,
		failOnExceed: props.FailOnExceed,
		count:        0,
		limit:        props.Limit,
		reader:       io.LimitReader(reader, readerLimit),
	}
}
NewLimitReader returns a new LimitReader
package rw
import (
	"errors"
	"io"
)
type UniRead interface {
	Read(io.Writer, io.Reader) (int, error)
}
type UniWrite interface {
	Write(io.Writer, io.Reader) (int, error)
}
type UniReadFunc func(io.Writer, io.Reader) (int, error)
func (f UniReadFunc) Read(w io.Writer, r io.Reader) (int, error) {
	return f(w, r)
}
type UniWriteFunc func(io.Writer, io.Reader) (int, error)
func (f UniWriteFunc) Write(w io.Writer, r io.Reader) (int, error) {
	return f(w, r)
}
type BiReadWriter interface {
	UniRead
	UniWrite
}
var ErrLimitExceeded = errors.New("Read limit exceeded")
type ReadLimitProps struct {
	FailOnExceed bool
	Limit int64
	ErrOnEOF bool
}