Files
jagacloud/pkg/containers/lxc/lxc.go
2025-11-23 11:29:12 +07:00

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.