add tpyes
This commit is contained in:
42
internal/types/types.go
Normal file
42
internal/types/types.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package types
|
||||
|
||||
type Mount struct {
|
||||
WorkspaceID string `json:"workspaceID" bind:"required"`
|
||||
Path string `json:"path" bind:"required"`
|
||||
}
|
||||
|
||||
// pvc, the storage
|
||||
type Pvc struct {
|
||||
ID string `json:"id" bind:"required"`
|
||||
UID string `json:"uid" bind:"required"`
|
||||
Limit string `json:"limit" bind:"required"`
|
||||
StorageClassName string `json:"storageClassName" bind:"required"`
|
||||
AccessMode string `json:"accessMode" bind:"required"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Mount *Mount `json:"mount,omitempty"`
|
||||
}
|
||||
|
||||
type HttpForward struct {
|
||||
Target string `json:"target" bind:"required"`
|
||||
WorkspaceID string `json:"workspaceID" bind:"required"`
|
||||
}
|
||||
|
||||
type ResourceLimits struct {
|
||||
// 1core=1000m
|
||||
CPU string `json:"cpu"`
|
||||
// 1Gi=1024Mi
|
||||
Memory string `json:"memory"`
|
||||
// temp storage limit,1Gi=1024Mi
|
||||
Storage string `json:"storage"`
|
||||
}
|
||||
|
||||
type Workspace struct {
|
||||
ID string `json:"id" bind:"required"`
|
||||
UID string `json:"uid" bind:"required"`
|
||||
Image string `json:"image" bind:"required"`
|
||||
Envs map[string]string `json:"envs,omitempty"`
|
||||
ResourceLimits *ResourceLimits `json:"resourcesLimits" bind:"required"`
|
||||
Pvcs []Pvc `json:"pvcs,omitempty"`
|
||||
HttpForwards []HttpForward `json:"httpForwards,omitempty"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
Reference in New Issue
Block a user