File: chunkreader.go

package info (click to toggle)
golang-github-jackc-pgproto3 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 364 kB
  • sloc: makefile: 3
file content (19 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package pgproto3

import (
	"io"

	"github.com/jackc/chunkreader/v2"
)

// 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 (including a partial read) occurs,
	// buf must be nil. Next must preserve any partially read data. Next must not reuse buf.
	Next(n int) (buf []byte, err error)
}

// NewChunkReader creates and returns a new default ChunkReader.
func NewChunkReader(r io.Reader) ChunkReader {
	return chunkreader.New(r)
}