mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Extract stream output handling to a new type.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
b1dfefc4bb
commit
a0ab33124a
15 changed files with 113 additions and 78 deletions
|
|
@ -219,3 +219,14 @@ func DisplayJSONMessagesStream(in io.Reader, out io.Writer, terminalFd uintptr,
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type stream interface {
|
||||
io.Writer
|
||||
FD() uintptr
|
||||
IsTerminal() bool
|
||||
}
|
||||
|
||||
// DisplayJSONMessagesToStream prints json messages to the output stream
|
||||
func DisplayJSONMessagesToStream(in io.Reader, stream stream, auxCallback func(*json.RawMessage)) error {
|
||||
return DisplayJSONMessagesStream(in, stream, stream.FD(), stream.IsTerminal(), auxCallback)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue