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 Frontend struct {
cr *chunkreader.ChunkReader
cr ChunkReader
w io.Writer
// Backend message flyweights
@@ -42,8 +41,7 @@ type Frontend struct {
partialMsg bool
}
func NewFrontend(r io.Reader, w io.Writer) (*Frontend, error) {
cr := chunkreader.NewChunkReader(r)
func NewFrontend(cr ChunkReader, w io.Writer) (*Frontend, error) {
return &Frontend{cr: cr, w: w}, nil
}