commands: Got rid of Response#Stream() in favor of setting value to a io.Reader
Matt Bell committed
Oct 21, 2014 at 16:15 UTC
dd84a3eb4483f34d87ccb9ea88e6fcd264030935
2 files changed
+4
-9
commands/command.go
+2
-4
@@ -4,7 +4,6 @@ import (
4
"errors"
5
"fmt"
6
"strings"
7
- "io"
7
8
u "github.com/jbenet/go-ipfs/util"
9
)
@@ -48,9 +47,8 @@ func (c *Command) Register(id string, sub *Command) error {
47
}
48
49
// Call invokes the command for the given Request
51
-// Streaming output is written to `out`
52
-func (c *Command) Call(req Request, out io.Writer) Response {
53
- res := NewResponse(req, out)
50
+func (c *Command) Call(req Request) Response {
51
+ res := NewResponse(req)
52
53
cmds, err := c.Resolve(req.Path())
54
if err != nil {
commands/response.go
+2
-5
@@ -60,9 +60,6 @@ type Response interface {
60
SetValue(interface{})
61
Value() interface{}
62
63
- // Returns the output stream Writer
64
- Stream() io.Writer
65
-
63
// Marshal marshals out the response into a buffer. It uses the EncodingType
64
// on the Request to chose a Marshaller (Codec).
65
Marshal() ([]byte, error)
@@ -125,6 +122,6 @@ func (r *response) Marshal() ([]byte, error) {
122
}
123
124
// NewResponse returns a response to match given Request
128
-func NewResponse(req Request, out io.Writer) Response {
129
- return &response{req: req, out: out}
125
+func NewResponse(req Request) Response {
126
+ return &response{req: req}
127
}