models

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Run(name string, args []string) error
}

type Disk

type Disk interface {
	Create(pool string, id uuid.UUID) error
	Delete(pool string, id uuid.UUID) error
}

Disk of VM

type HostStatAccess

type HostStatAccess interface {
	GetCpu() (entity.Cpu, error)
	GetMem() (entity.Memory, error)
	GetStoragePools() ([]entity.StoragePool, error)
}

type HostUseCase

type HostUseCase interface {
	Get() (entity.Host, error)
}

type ID

type ID interface {
	GenID() (uuid.UUID, error)
}

type Socket

type Socket interface {
	Create(id uuid.UUID) (any, error)
	List() ([]string, error)
	SearchFor(id uuid.UUID) bool
	Connect() error
	Send(data []byte) error
	Delete(id uuid.UUID) error
}

type State

type State string
const (
	RUNNING  State = "RUNNING"
	SHUTDOWN State = "SHUTDOWN"
	UNKNOWN  State = "UNKNOWN"
)

State of VM power

type Storage

type Storage struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type StorageAccess

type StorageAccess interface {
	Browse() ([]Storage, error)
	Read(name string) (Storage, error)
}

type VmDataAccess

type VmDataAccess interface {
	Browse() ([]entity.Vm, error)
	Read(id uuid.UUID) (entity.Vm, error)
	Edit(id uuid.UUID, vm entity.VmCore) (entity.Vm, error)
	Add(vm entity.Vm) error
	Delete(id uuid.UUID) error
}

VmDataAccess provides access to VM's structure files

type VmUseCase

type VmUseCase interface {
	Create(req entity.VmCore) (entity.Vm, error)
	ReadAll() ([]entity.Vm, error)
	ReadById(id uuid.UUID) (entity.Vm, error)
	Update(id uuid.UUID, vm entity.VmCore) (entity.Vm, error)
	Delete(id uuid.UUID) error

	// Power
	GetPower(id uuid.UUID) State
	Start(id uuid.UUID) error
	Restart(id uuid.UUID) error
	Shutdown(id uuid.UUID) error
}

VmUseCase provides VM control

Directories

Path Synopsis
Package mock_models is a generated GoMock package.
Package mock_models is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL