pipes.go 381 B

1234567891011121314151617181920212223
  1. package execdriver
  2. import (
  3. "io"
  4. )
  5. // Pipes is a wrapper around a containers output for
  6. // stdin, stdout, stderr
  7. type Pipes struct {
  8. Stdin io.ReadCloser
  9. Stdout, Stderr io.Writer
  10. }
  11. func NewPipes(stdin io.ReadCloser, stdout, stderr io.Writer, useStdin bool) *Pipes {
  12. p := &Pipes{
  13. Stdout: stdout,
  14. Stderr: stderr,
  15. }
  16. if useStdin {
  17. p.Stdin = stdin
  18. }
  19. return p
  20. }