model

package
v0.0.0-...-b39efbf Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	ID       uuid.UUID `sql:"id,pk,type:uuid default gen_random_uuid()" json:"id"`
	Name     string    `sql:"name,type:varchar(50)" json:"name"`
	Address  string    `sql:"address,type:varchar(16)" json:"address"`
	Status   Status    `sql:"status,type:int4" json:"status"`
	User     string    `sql:"host_user,type:varchar(32)" json:"user"`
	Password string    `sql:"password,type:text" json:"password"`
	Port     int       `sql:"port,type:int4,default:8001" json:"port"`
}

Host represents the hosts table

type Status

type Status int
const (
	UNKNOWN Status = iota
	DOWN
	UP
	INSTALLING
	INITIALIZING
	ACTIVATING
	FAILED
)

TODO split up to VM statuses and host statuses

type VM

type VM struct {
	ID             uuid.UUID `sql:"id,pk,type:uuid default gen_random_uuid()" json:"id"`
	Name           string    `sql:"name,type:varchar(50)" json:"name"`
	Status         Status    `sql:"status,type:int4" json:"status"`
	HostID         uuid.UUID `sql:"host_id,type:uuid" json:"host_id"`
	VCPU           int64     `sql:"vcpu,type:int4" json:"vcpu"`
	Memory         int64     `sql:"memory,type:int4" json:"memory"`
	KernelImage    string    `sql:"kernel,type:varchar(255)" json:"kernel"`
	RootFileSystem string    `sql:"root_file_system,type:varchar(255)" json:"rootfs"`
	Address        string    `sql:"address,type:varchar(16)" json:"address"`
}

VM represents the vms table

type Volume

type Volume struct {
	ID          uuid.UUID `sql:"id,pk,type:uuid default gen_random_uuid()" json:"id"`
	Status      Status    `sql:"status,type:int4" json:"status"`
	Description string    `sql:"description,type:varchar(255)" json:"description"`
	Image       string    `sql:"image,type:varchar(50)" json:"image"`
	Size        int64     `sql:"size,type:bigint" json:"size"`
}

Volume represents the volumes table

Jump to

Keyboard shortcuts

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