Decouple github.com/jackc/chunkreader
This commit is contained in:
+2
-4
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user