diff --git a/container.go b/container.go index 232f42c4..e5376902 100644 --- a/container.go +++ b/container.go @@ -3,7 +3,12 @@ NOTE: The API is in flux and mainly not implemented. Proceed with caution until */ package libcontainer -type ContainerInfo interface { +// A libcontainer container object. +// +// Each container is thread-safe within the same process. Since a container can +// be destroyed by a separate process, any function may return that the container +// was not found. +type Container interface { // Returns the ID of the container ID() string @@ -33,15 +38,6 @@ type ContainerInfo interface { // ContainerDestroyed - Container no longer exists, // Systemerror - System error. Stats() (*ContainerStats, error) -} - -// A libcontainer container object. -// -// Each container is thread-safe within the same process. Since a container can -// be destroyed by a separate process, any function may return that the container -// was not found. -type Container interface { - ContainerInfo // Start a process inside the container. Returns the PID of the new process (in the caller process's namespace) and a channel that will return the exit status of the process whenever it dies. // diff --git a/factory.go b/factory.go index c14832e7..389c138a 100644 --- a/factory.go +++ b/factory.go @@ -26,5 +26,5 @@ type Factory interface { // Path does not exist // Container is stopped // System error - Load(id string) (ContainerInfo, error) + Load(id string) (Container, error) } diff --git a/linux_container.go b/linux_container.go index 1f5e090d..938250ca 100644 --- a/linux_container.go +++ b/linux_container.go @@ -46,3 +46,31 @@ func (c *linuxContainer) Stats() (*ContainerStats, error) { } return stats, nil } + +func (c *linuxContainer) StartProcess(config *ProcessConfig) (int, error) { + panic("not implemented") +} + +func (c *linuxContainer) Destroy() error { + panic("not implemented") +} + +func (c *linuxContainer) Pause() error { + panic("not implemented") +} + +func (c *linuxContainer) Resume() error { + panic("not implemented") +} + +func (c *linuxContainer) Signal(pid, signal int) error { + panic("not implemented") +} + +func (c *linuxContainer) Wait() (int, error) { + panic("not implemented") +} + +func (c *linuxContainer) WaitProcess(pid int) (int, error) { + panic("not implemented") +} diff --git a/linux_factory.go b/linux_factory.go index 989c5528..3299dc8f 100644 --- a/linux_factory.go +++ b/linux_factory.go @@ -34,7 +34,7 @@ func (l *linuxFactory) Create(id string, config *Config) (Container, error) { panic("not implemented") } -func (l *linuxFactory) Load(id string) (ContainerInfo, error) { +func (l *linuxFactory) Load(id string) (Container, error) { containerRoot := filepath.Join(l.root, id) config, err := l.loadContainerConfig(containerRoot) if err != nil {