Documentation ¶
Index ¶
- Constants
- Variables
- type Driver
- func (d *Driver) Clean(id string) error
- func (d *Driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessConfig, ...) (int, error)
- func (d *Driver) GetPidsForContainer(id string) ([]int, error)
- func (d *Driver) Info(id string) execdriver.Info
- func (d *Driver) Kill(c *execdriver.Command, sig int) error
- func (d *Driver) Name() string
- func (d *Driver) Pause(c *execdriver.Command) error
- func (d *Driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, hooks execdriver.Hooks) (execdriver.ExitStatus, error)
- func (d *Driver) Stats(id string) (*execdriver.ResourceStats, error)
- func (d *Driver) SupportsHooks() bool
- func (d *Driver) Terminate(c *execdriver.Command) error
- func (d *Driver) Unpause(c *execdriver.Command) error
- type InitArgs
- type TtyConsole
Constants ¶
const DriverName = "lxc"
DriverName for lxc driver
const LxcTemplate = `` /* 4319-byte string literal not displayed */
LxcTemplate is the template for lxc driver, it's used to configure LXC.
Variables ¶
var (
ErrCannotParse = errors.New("cannot parse raw input")
)
Define error messages
var ErrExec = errors.New("Unsupported: Exec is not supported by the lxc driver")
ErrExec defines unsupported error message
Functions ¶
This section is empty.
Types ¶
type Driver ¶
Driver contains all information for lxc driver, it implements execdriver.Driver
func (*Driver) Clean ¶
Clean implements the exec driver Driver interface, it's not implemented by lxc.
func (*Driver) Exec ¶
func (d *Driver) Exec(c *execdriver.Command, processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes, hooks execdriver.Hooks) (int, error)
Exec implements the exec driver Driver interface, it is not implemented by lxc.
func (*Driver) GetPidsForContainer ¶
GetPidsForContainer implements the exec driver Driver interface.
func (*Driver) Info ¶
func (d *Driver) Info(id string) execdriver.Info
Info implements the exec driver Driver interface.
func (*Driver) Kill ¶
func (d *Driver) Kill(c *execdriver.Command, sig int) error
Kill implements the exec driver Driver interface.
func (*Driver) Pause ¶
func (d *Driver) Pause(c *execdriver.Command) error
Pause implements the exec driver Driver interface, it executes lxc-freeze to pause a container.
func (*Driver) Run ¶
func (d *Driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, hooks execdriver.Hooks) (execdriver.ExitStatus, error)
Run implements the exec driver Driver interface, it calls 'exec.Cmd' to launch lxc commands to run a container.
func (*Driver) Stats ¶
func (d *Driver) Stats(id string) (*execdriver.ResourceStats, error)
Stats implements the exec driver Driver interface. Lxc doesn't implement it's own Stats, it does some trick by implementing execdriver.Stats to get stats info by libcontainer APIs.
func (*Driver) SupportsHooks ¶
SupportsHooks implements the execdriver Driver interface. The LXC execdriver does not support the hook mechanism, which is currently unique to runC/libcontainer.
type InitArgs ¶
type InitArgs struct { User string Gateway string IP string WorkDir string Privileged bool Env []string Args []string Mtu int Console string Pipe int Root string CapAdd string CapDrop string }
InitArgs contains args provided to the init function for a driver
type TtyConsole ¶
TtyConsole implements the exec driver Terminal interface, it stores the master and slave ends of the container's pty.
func NewTtyConsole ¶
func NewTtyConsole(processConfig *execdriver.ProcessConfig, pipes *execdriver.Pipes) (*TtyConsole, error)
NewTtyConsole returns a new TtyConsole struct. Wired up to the provided process config and stdin/stdout/stderr pipes.
func (*TtyConsole) AttachPipes ¶
func (t *TtyConsole) AttachPipes(command *exec.Cmd, pipes *execdriver.Pipes) error
AttachPipes attaches given pipes to exec.Cmd
func (*TtyConsole) Close ¶
func (t *TtyConsole) Close() error
Close implements Close method of Terminal interface
func (*TtyConsole) Resize ¶
func (t *TtyConsole) Resize(h, w int) error
Resize implements Resize method of Terminal interface