2
0

Decouple github.com/jackc/chunkreader

This commit is contained in:
Jack Christensen
2019-03-30 12:46:56 -05:00
parent 127e997696
commit bb06e6b3ff
5 changed files with 24 additions and 10 deletions
+18
View File
@@ -0,0 +1,18 @@
package pgproto3
import (
"io"
"github.com/jackc/chunkreader"
)
// ChunkReader is an interface to decouple github.com/jackc/chunkreader from this package.
type ChunkReader interface {
// Next returns buf filled with the next n bytes. If an error occurs, buf will be nil. Next must
// not reuse buf. In case of error, Next must preserve partially read data.
Next(n int) (buf []byte, err error)
}
func NewChunkReader(r io.Reader) ChunkReader {
return chunkreader.NewChunkReader(r)
}