initial commit
This commit is contained in:
43
pkg/containers/lxc/lxc.go
Normal file
43
pkg/containers/lxc/lxc.go
Normal file
@@ -0,0 +1,43 @@
|
||||
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.
|
||||
Reference in New Issue
Block a user