Documentation
¶
Index ¶
- type Bridge
- type HV
- func (hv *HV) CreateVM(ctx context.Context, vm *util.VMCreateRequest, hvid uuid.UUID) (uuid.UUID, error)
- func (hv *HV) DeleteVM(ctx context.Context, vmid string) error
- func (hv *HV) GetVMState(vm *VM) (models.VMState, error)
- func (hv *HV) Init() error
- func (hv *HV) InitVMs() error
- func (hv *HV) Refresh() error
- func (hv *HV) SetVMState(vm *VM, state string) (models.VMState, error)
- type HVList
- type Storage
- type VM
- type VMNic
- type VMStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HV ¶
type HV struct { ID uuid.UUID `json:"id"` Hostname string `json:"hostname"` AutoUrl string `json:"auto_url" db:"auto_url"` AutoSerial string `json:"auto_serial" db:"auto_serial"` Site string `json:"site"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Remarks string `json:"remarks"` Mutex sync.Mutex `json:"-" db:"-"` VMs map[uuid.UUID]*VM `json:"-" db:"-"` Storages map[uuid.UUID]*Storage `json:"-" db:"-"` // storage places for VM disks, isos, backups Bridges map[uuid.UUID]*Bridge `json:"-" db:"-"` // bridges for VMs Auto *auto.Auto `json:"-" db:"-"` // auto conn details Specs *models.HV `json:"-" db:"-"` // specs fetched from auto }
This is the HV struct that will be stored in the DB.
type Storage ¶
type Storage struct { Mutex sync.Mutex `json:"-" db:"-"` ID uuid.UUID `json:"id"` HV uuid.UUID `json:"hv" db:"hv_id"` Enabeld bool `json:"enabled" db:"enabled"` Type string `json:"type" db:"type"` Path string `json:"path" db:"path"` Iso bool `json:"iso" db:"iso"` Disk bool `json:"disk" db:"disk"` CloudImage bool `json:"cloud_image" db:"cloud_image"` Remarks string `json:"remarks" db:"remarks"` }
type VM ¶
type VM struct { Mutex sync.Mutex `json:"-" db:"-"` ID uuid.UUID `json:"id"` HV uuid.UUID `json:"hv" db:"hv_id"` Hostname string `json:"hostname"` UserID uuid.UUID `json:"user" db:"profile_id"` CPU int `json:"cpu"` Memory int64 `json:"memory"` Nics map[string]VMNic `json:"nics" db:"-"` Storages map[string]VMStorage `json:"storages" db:"-"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Remarks string `json:"remarks"` Domain models.VM `json:"-" db:"-"` // data from libvirt }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.