Documentation
¶
Index ¶
- type Manager
- func (m *Manager) Dir(id string) string
- func (m *Manager) ExecSocketPath(id string) string
- func (m *Manager) Get(id string) (VMState, error)
- func (m *Manager) Kill(id string) error
- func (m *Manager) List() ([]VMState, error)
- func (m *Manager) LogPath(id string) string
- func (m *Manager) Prune() ([]string, error)
- func (m *Manager) Register(id string, config interface{}) error
- func (m *Manager) Remove(id string) error
- func (m *Manager) SocketPath(id string) string
- func (m *Manager) Unregister(id string) error
- type SubnetAllocator
- type SubnetInfo
- type VMState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func NewManagerWithDir ¶
func (*Manager) ExecSocketPath ¶
func (*Manager) SocketPath ¶
func (*Manager) Unregister ¶
type SubnetAllocator ¶
type SubnetAllocator struct {
// contains filtered or unexported fields
}
SubnetAllocator manages unique /24 subnet allocation for VMs Uses 192.168.X.0/24 where X ranges from 100-254
func NewSubnetAllocator ¶
func NewSubnetAllocator() *SubnetAllocator
func (*SubnetAllocator) Allocate ¶
func (a *SubnetAllocator) Allocate(vmID string) (*SubnetInfo, error)
Allocate assigns a unique subnet to a VM
func (*SubnetAllocator) Cleanup ¶
func (a *SubnetAllocator) Cleanup(mgr *Manager) error
Cleanup removes all stale subnet allocations (VMs that no longer exist)
func (*SubnetAllocator) Get ¶
func (a *SubnetAllocator) Get(vmID string) (*SubnetInfo, error)
Get retrieves subnet info for a VM
func (*SubnetAllocator) Release ¶
func (a *SubnetAllocator) Release(vmID string) error
Release frees a subnet allocation
type SubnetInfo ¶
type SubnetInfo struct {
Octet int `json:"octet"` // Third octet (e.g., 100 for 192.168.100.0/24)
GatewayIP string `json:"gateway_ip"` // Host TAP IP (e.g., 192.168.100.1)
GuestIP string `json:"guest_ip"` // Guest IP (e.g., 192.168.100.2)
Subnet string `json:"subnet"` // CIDR notation (e.g., 192.168.100.0/24)
VMID string `json:"vm_id"`
}
Click to show internal directories.
Click to hide internal directories.