Tizen_4.0 base
[platform/upstream/docker-engine.git] / vendor / github.com / opencontainers / runc / libcontainer / factory.go
1 package libcontainer
2
3 import (
4         "github.com/opencontainers/runc/libcontainer/configs"
5 )
6
7 type Factory interface {
8         // Creates a new container with the given id and starts the initial process inside it.
9         // id must be a string containing only letters, digits and underscores and must contain
10         // between 1 and 1024 characters, inclusive.
11         //
12         // The id must not already be in use by an existing container. Containers created using
13         // a factory with the same path (and filesystem) must have distinct ids.
14         //
15         // Returns the new container with a running process.
16         //
17         // errors:
18         // IdInUse - id is already in use by a container
19         // InvalidIdFormat - id has incorrect format
20         // ConfigInvalid - config is invalid
21         // Systemerror - System error
22         //
23         // On error, any partially created container parts are cleaned up (the operation is atomic).
24         Create(id string, config *configs.Config) (Container, error)
25
26         // Load takes an ID for an existing container and returns the container information
27         // from the state.  This presents a read only view of the container.
28         //
29         // errors:
30         // Path does not exist
31         // System error
32         Load(id string) (Container, error)
33
34         // StartInitialization is an internal API to libcontainer used during the reexec of the
35         // container.
36         //
37         // Errors:
38         // Pipe connection error
39         // System error
40         StartInitialization() error
41
42         // Type returns info string about factory type (e.g. lxc, libcontainer...)
43         Type() string
44 }