Rainbond/api/model/app.go

49 lines
1.4 KiB
Go
Raw Normal View History

2020-09-27 16:27:46 +08:00
package model
// AppPort -
type AppPort struct {
ServiceID string `json:"service_id" validate:"required"`
ContainerPort int `json:"container_port" validate:"required"`
PortAlias string `json:"port_alias" validate:"required"`
K8sServiceName string `json:"k8s_service_name" validate:"required"`
}
2020-09-28 16:43:27 +08:00
// AppStatus -
type AppStatus struct {
2021-04-16 18:40:49 +08:00
Status string `json:"status"`
2021-04-26 14:51:23 +08:00
Cpu *int64 `json:"cpu"`
Memory *int64 `json:"memory"`
2021-04-16 18:40:49 +08:00
Disk int64 `json:"disk"`
Phase string `json:"phase"`
ValuesTemplate string `json:"valuesTemplate"`
2021-04-19 11:52:52 +08:00
Readme string `json:"readme"`
2020-09-28 16:43:27 +08:00
}
2021-04-16 16:27:21 +08:00
// AppDetectProcess -
type AppDetectProcess struct {
Type string `json:"type"`
Ready bool `json:"ready"`
Error string `json:"error"`
}
2021-04-17 15:47:59 +08:00
// AppService -
type AppService struct {
ServiceName string `json:"service_name"`
2021-04-21 15:12:34 +08:00
Address string `json:"address"`
2021-04-20 11:25:24 +08:00
TCPPorts []int32 `json:"tcp_ports"`
2021-04-17 15:47:59 +08:00
Pods []*AppPod `json:"pods"`
}
2021-04-23 10:03:15 +08:00
// ByServiceName implements sort.Interface for []*AppService based on
// the ServiceName field.
type ByServiceName []*AppService
func (a ByServiceName) Len() int { return len(a) }
func (a ByServiceName) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a ByServiceName) Less(i, j int) bool { return a[i].ServiceName < a[j].ServiceName }
2021-04-17 15:47:59 +08:00
type AppPod struct {
PodName string `json:"pod_name"`
PodStatus string `json:"pod_status"`
}