From dd84a3eb4483f34d87ccb9ea88e6fcd264030935 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Tue, 21 Oct 2014 16:15:06 -0700 Subject: [PATCH] commands: Got rid of Response#Stream() in favor of setting value to a io.Reader --- commands/command.go | 6 ++---- commands/response.go | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/commands/command.go b/commands/command.go index d1c07dc0118..beeade91526 100644 --- a/commands/command.go +++ b/commands/command.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "strings" - "io" u "github.com/jbenet/go-ipfs/util" ) @@ -48,9 +47,8 @@ func (c *Command) Register(id string, sub *Command) error { } // Call invokes the command for the given Request -// Streaming output is written to `out` -func (c *Command) Call(req Request, out io.Writer) Response { - res := NewResponse(req, out) +func (c *Command) Call(req Request) Response { + res := NewResponse(req) cmds, err := c.Resolve(req.Path()) if err != nil { diff --git a/commands/response.go b/commands/response.go index 336134812bc..f695427099e 100644 --- a/commands/response.go +++ b/commands/response.go @@ -60,9 +60,6 @@ type Response interface { SetValue(interface{}) Value() interface{} - // Returns the output stream Writer - Stream() io.Writer - // Marshal marshals out the response into a buffer. It uses the EncodingType // on the Request to chose a Marshaller (Codec). Marshal() ([]byte, error) @@ -125,6 +122,6 @@ func (r *response) Marshal() ([]byte, error) { } // NewResponse returns a response to match given Request -func NewResponse(req Request, out io.Writer) Response { - return &response{req: req, out: out} +func NewResponse(req Request) Response { + return &response{req: req} }