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
+2 -4
View File
@@ -4,12 +4,11 @@ import (
"encoding/binary"
"io"
"github.com/jackc/chunkreader"
"github.com/pkg/errors"
)
type Backend struct {
cr *chunkreader.ChunkReader
cr ChunkReader
w io.Writer
// Frontend message flyweights
@@ -31,8 +30,7 @@ type Backend struct {
partialMsg bool
}
func NewBackend(r io.Reader, w io.Writer) (*Backend, error) {
cr := chunkreader.NewChunkReader(r)
func NewBackend(cr ChunkReader, w io.Writer) (*Backend, error) {
return &Backend{cr: cr, w: w}, nil
}