27 lines
716 B
Go
27 lines
716 B
Go
|
package apps
|
||
|
|
||
|
import "github.com/jinzhu/gorm"
|
||
|
|
||
|
// Label holds metadata about the application
|
||
|
type Label struct {
|
||
|
Value string `json:"value"`
|
||
|
}
|
||
|
|
||
|
// App keeps info about hosted application
|
||
|
type App struct {
|
||
|
gorm.Model
|
||
|
|
||
|
Name string `json:"name" gorm:"primary_key"`
|
||
|
SSHPort int `json:"ssh_port"`
|
||
|
HTTPPort int `json:"http_port"`
|
||
|
Image string `json:"image"`
|
||
|
Status string `json:"status"` // running, data (no container, data only), stopped
|
||
|
CPU string `json:"cpu"`
|
||
|
Memory int `json:"memory"` // Limit in MB
|
||
|
Labels []Label `json:"labels"` // username:cx or user_id:1
|
||
|
|
||
|
MemoryUsage int `json:"memory_usage"` // Usage in MB
|
||
|
DiskUsage int `json:"disk_usage"` // Usage in MB
|
||
|
|
||
|
}
|