forked from openshift/geard
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also update Initialize to take a path to the container Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
- Loading branch information
Michael Crosby
committed
Jul 9, 2014
1 parent
32221d5
commit 5001b7e
Showing
1 changed file
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
package libcontainer | ||
|
||
type Factory interface { | ||
// Initializes a new container with the specified ID and config. The ID is a user-provided | ||
// opaque identifier. Starts an init process with the initialProcess config inside the new | ||
// container. | ||
// Initializes a new container in the given path. A unique ID is generated for the container and | ||
// starts the initial process inside the container. | ||
// | ||
// Returns the new container and the PID of the new init inside the container. | ||
// The caller must reap this PID. | ||
// Returns the new container with a running process. | ||
// | ||
// Errors: ID already exists, | ||
// config or initialConfig is invalid, | ||
// system error. | ||
// Errors: | ||
// Path already exists | ||
// Config or initialConfig is invalid | ||
// System error | ||
// | ||
// On error, any partially created container parts are cleaned up (the operation is atomic). | ||
Initialize(id string, config *Config, initialProcess *ProcessConfig) (*Container, int, error) | ||
Initialize(path string, config *Config) (Container, error) | ||
|
||
// 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) | ||
} |