2014-07-09 05:42:57 +08:00
|
|
|
package libcontainer
|
|
|
|
|
|
|
|
type Factory interface {
|
2014-09-01 15:32:01 +08:00
|
|
|
|
|
|
|
// Creates a new container with the given id and starts the initial process inside it.
|
|
|
|
// id must be a string containing only letters, digits and underscores and must contain
|
|
|
|
// between 1 and 1024 characters, inclusive.
|
|
|
|
//
|
|
|
|
// The id must not already be in use by an existing container. Containers created using
|
|
|
|
// a factory with the same path (and file system) must have distinct ids.
|
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:
|
2014-09-04 07:03:41 +08:00
|
|
|
// IdInUse - id is already in use by a container
|
|
|
|
// InvalidIdFormat - id has incorrect format
|
|
|
|
// ConfigInvalid - config is invalid
|
|
|
|
// SystemError - 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-09-04 07:03:41 +08:00
|
|
|
Create(id string, config *Config) (Container, Error)
|
2014-07-10 07:58:59 +08:00
|
|
|
|
2014-08-26 23:18:13 +08:00
|
|
|
// Load takes an ID for an existing container and reconstructs the container
|
2014-07-10 07:58:59 +08:00
|
|
|
// from the state.
|
|
|
|
//
|
|
|
|
// Errors:
|
|
|
|
// Path does not exist
|
|
|
|
// Container is stopped
|
|
|
|
// System error
|
2014-09-04 07:03:41 +08:00
|
|
|
// TODO: fix description
|
|
|
|
Load(id string) (Container, Error)
|
2014-07-09 05:42:57 +08:00
|
|
|
}
|