initial commit

This commit is contained in:
2025-11-23 11:29:12 +07:00
commit 382b57ed83
33 changed files with 2360 additions and 0 deletions

43
pkg/containers/lxc/lxc.go Normal file
View 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.