factory.go 1.1 KB

123456789101112131415161718192021222324252627282930
  1. package libcontainer
  2. import (
  3. "github.com/opencontainers/runc/libcontainer/configs"
  4. )
  5. type Factory interface {
  6. // Creates a new container with the given id and starts the initial process inside it.
  7. // id must be a string containing only letters, digits and underscores and must contain
  8. // between 1 and 1024 characters, inclusive.
  9. //
  10. // The id must not already be in use by an existing container. Containers created using
  11. // a factory with the same path (and filesystem) must have distinct ids.
  12. //
  13. // Returns the new container with a running process.
  14. //
  15. // On error, any partially created container parts are cleaned up (the operation is atomic).
  16. Create(id string, config *configs.Config) (Container, error)
  17. // Load takes an ID for an existing container and returns the container information
  18. // from the state. This presents a read only view of the container.
  19. Load(id string) (Container, error)
  20. // StartInitialization is an internal API to libcontainer used during the reexec of the
  21. // container.
  22. StartInitialization() error
  23. // Type returns info string about factory type (e.g. lxc, libcontainer...)
  24. Type() string
  25. }