2014-07-09 05:42:57 +08:00
|
|
|
package libcontainer
|
|
|
|
|
|
|
|
type Factory interface {
|
2014-07-10 18:50:51 +08:00
|
|
|
// Creates a new container in the given path. A unique ID is generated for the container and
|
2014-07-10 07:58:59 +08:00
|
|
|
// starts the initial process inside the container.
|
2014-07-09 05:42:57 +08:00
|
|
|
//
|
2014-07-10 07:58:59 +08:00
|
|
|
// Returns the new container with a running process.
|
2014-07-09 05:42:57 +08:00
|
|
|
//
|
2014-07-10 07:58:59 +08:00
|
|
|
// Errors:
|
|
|
|
// Path already exists
|
|
|
|
// Config or initialConfig is invalid
|
|
|
|
// System error
|
2014-07-09 05:42:57 +08:00
|
|
|
//
|
|
|
|
// On error, any partially created container parts are cleaned up (the operation is atomic).
|
2014-07-10 18:50:51 +08:00
|
|
|
Create(path string, config *Config) (Container, error)
|
2014-07-10 07:58:59 +08:00
|
|
|
|
|
|
|
// Load takes the path for an existing container and reconstructs the container
|
|
|
|
// from the state.
|
|
|
|
//
|
|
|
|
// Errors:
|
|
|
|
// Path does not exist
|
|
|
|
// Container is stopped
|
|
|
|
// System error
|
|
|
|
Load(path string) (Container, error)
|
2014-07-09 05:42:57 +08:00
|
|
|
}
|