containerd/execution/process.go
Michael Crosby 32bf0f69fd Start work on Container and Process model
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-12-02 15:37:16 -08:00

41 lines
711 B
Go

package execution
import (
"io"
"os"
specs "github.com/opencontainers/runtime-spec/specs-go"
)
type ProcessController interface {
Start(*Process) error
Status(*Process) (Status, error)
Wait(*Process) (uint32, error)
Signal(*Process, os.Signal) error
}
type Process struct {
Pid int
Spec *specs.Process
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
controller ProcessController
}
func (p *Process) Status() (Status, error) {
return p.controller.Status(p)
}
func (p *Process) Wait() (uint32, error) {
return p.controller.Wait(p)
}
func (p *Process) Signal(s os.Signal) error {
return p.controller.Signal(p, s)
}
func (p *Process) Start() error {
return p.controller.Start(p)
}