Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson) Upstream-commit: 359b7df5d2af5733b8a1ea6746d062053053b23e Component: engine
24 lines
381 B
Go
24 lines
381 B
Go
package execdriver
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// Pipes is a wrapper around a containers output for
|
|
// stdin, stdout, stderr
|
|
type Pipes struct {
|
|
Stdin io.ReadCloser
|
|
Stdout, Stderr io.Writer
|
|
}
|
|
|
|
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
|
|
}
|