Remove ContainerInfo interface

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2014-10-28 00:51:14 +00:00 committed by Victor Marmol
parent ccb83a1e83
commit d5b8418f75
4 changed files with 36 additions and 12 deletions

View File

@ -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.
//

View File

@ -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)
}

View File

@ -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")
}

View File

@ -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 {