2014-02-24 18:38:24 -08:00
|
|
|
package nsinit
|
|
|
|
|
2014-04-30 15:24:18 -07:00
|
|
|
import "github.com/dotcloud/docker/pkg/libcontainer"
|
2014-02-24 18:38:24 -08:00
|
|
|
|
2014-02-24 21:11:52 -08:00
|
|
|
// NsInit is an interface with the public facing methods to provide high level
|
|
|
|
// exec operations on a container
|
2014-02-24 18:38:24 -08:00
|
|
|
type NsInit interface {
|
2014-04-30 15:52:40 -07:00
|
|
|
Exec(container *libcontainer.Container, term Terminal, pidRoot string, args []string, startCallback func()) (int, error)
|
2014-02-24 18:38:24 -08:00
|
|
|
ExecIn(container *libcontainer.Container, nspid int, args []string) (int, error)
|
|
|
|
Init(container *libcontainer.Container, uncleanRootfs, console string, syncPipe *SyncPipe, args []string) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type linuxNs struct {
|
|
|
|
root string
|
|
|
|
commandFactory CommandFactory
|
|
|
|
}
|
|
|
|
|
2014-04-30 15:52:40 -07:00
|
|
|
func NewNsInit(command CommandFactory) NsInit {
|
2014-02-24 18:38:24 -08:00
|
|
|
return &linuxNs{
|
|
|
|
commandFactory: command,
|
|
|
|
}
|
|
|
|
}
|