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 // On error, any partially created container parts are cleaned up (the operation is atomic). 18 Create(id string, config *configs.Config) (Container, error) 19 20 // Load takes an ID for an existing container and returns the container information 21 // from the state. This presents a read only view of the container. 22 Load(id string) (Container, error) 23 24 // StartInitialization is an internal API to libcontainer used during the reexec of the 25 // container. 26 StartInitialization() error 27 28 // Type returns info string about factory type (e.g. lxc, libcontainer...) 29 Type() string 30 } 31