44 lines
721 B
Go
44 lines
721 B
Go
package lxc
|
|
|
|
// Manager abstracts LXC lifecycle operations.
|
|
type Manager interface {
|
|
List() ([]Container, error)
|
|
Create(spec Spec) (Container, error)
|
|
Start(id string) error
|
|
Stop(id string) error
|
|
Delete(id string) error
|
|
}
|
|
|
|
type Spec struct {
|
|
ID string
|
|
Name string
|
|
Template string
|
|
RootfsPool string
|
|
RootfsSizeG int
|
|
NICs []NICSpec
|
|
Limits Limits
|
|
Unprivileged bool
|
|
}
|
|
|
|
type NICSpec struct {
|
|
Bridge string
|
|
VLAN int
|
|
HWAddr string
|
|
MTU int
|
|
Name string
|
|
}
|
|
|
|
type Limits struct {
|
|
CPU int
|
|
MemoryMB int
|
|
}
|
|
|
|
type Container struct {
|
|
ID string
|
|
Name string
|
|
Status string
|
|
Unpriv bool
|
|
}
|
|
|
|
// TODO: shell out to lxc-* binaries with generated config under cfg path.
|