mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
3d17c3bb66
Addresses: #14756 Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
24 lines
440 B
Go
24 lines
440 B
Go
package execdriver
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// Pipes is a wrapper around a container's output for
|
|
// stdin, stdout, stderr
|
|
type Pipes struct {
|
|
Stdin io.ReadCloser
|
|
Stdout, Stderr io.Writer
|
|
}
|
|
|
|
// NewPipes returns a wrapper around a container's output
|
|
func NewPipes(stdin io.ReadCloser, stdout, stderr io.Writer, useStdin bool) *Pipes {
|
|
p := &Pipes{
|
|
Stdout: stdout,
|
|
Stderr: stderr,
|
|
}
|
|
if useStdin {
|
|
p.Stdin = stdin
|
|
}
|
|
return p
|
|
}
|