nsinit.go 704 B

12345678910111213141516171819202122
  1. package nsinit
  2. import "github.com/dotcloud/docker/pkg/libcontainer"
  3. // NsInit is an interface with the public facing methods to provide high level
  4. // exec operations on a container
  5. type NsInit interface {
  6. Exec(container *libcontainer.Container, term Terminal, pidRoot string, args []string, startCallback func()) (int, error)
  7. ExecIn(container *libcontainer.Container, nspid int, args []string) (int, error)
  8. Init(container *libcontainer.Container, uncleanRootfs, console string, syncPipe *SyncPipe, args []string) error
  9. }
  10. type linuxNs struct {
  11. root string
  12. commandFactory CommandFactory
  13. }
  14. func NewNsInit(command CommandFactory) NsInit {
  15. return &linuxNs{
  16. commandFactory: command,
  17. }
  18. }