Skip to content

Commit

Permalink
Add Load method to factory
Browse files Browse the repository at this point in the history
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.
26 changes: 17 additions & 9 deletions factory.go
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)
}

0 comments on commit 5001b7e

Please sign in to comment.