light modification

This commit is contained in:
mr 2025-01-15 11:09:33 +01:00
parent b48e2cb3e5
commit 555c5acb26
3 changed files with 23 additions and 0 deletions

View File

@ -13,3 +13,8 @@ const (
func (t InfrastructureType) String() string { func (t InfrastructureType) String() string {
return [...]string{"DOCKER", "KUBERNETES", "SLURM", "HW", "CONDOR"}[t] return [...]string{"DOCKER", "KUBERNETES", "SLURM", "HW", "CONDOR"}[t]
} }
// get list of all infrastructure types
func InfrastructureList() []InfrastructureType {
return []InfrastructureType{DOCKER, KUBERNETES, SLURM, HW, CONDOR}
}

View File

@ -36,3 +36,8 @@ func (d ScheduledType) String() string {
func (d ScheduledType) EnumIndex() int { func (d ScheduledType) EnumIndex() int {
return int(d) return int(d)
} }
// List
func ScheduleList() []ScheduledType {
return []ScheduledType{DRAFT, SCHEDULED, STARTED, FAILURE, SUCCESS, FORGOTTEN, DELAYED, CANCELLED}
}

View File

@ -17,6 +17,15 @@ var argoType = [...]string{
"Ti", "Ti",
} }
// Size to string
func (t StorageSize) String() string {
return [...]string{"GB", "MB", "KB", "TB"}[t]
}
func (t StorageSize) SizeList() []StorageSize {
return []StorageSize{GB, MB, KB, TB}
}
// New creates a new instance of the StorageResource struct // New creates a new instance of the StorageResource struct
func (dma StorageSize) ToArgo() string { func (dma StorageSize) ToArgo() string {
return argoType[dma] return argoType[dma]
@ -39,3 +48,7 @@ const (
func (t StorageType) String() string { func (t StorageType) String() string {
return [...]string{"FILE", "STREAM", "API", "DATABASE", "S3", "MEMORY", "HARDWARE"}[t] return [...]string{"FILE", "STREAM", "API", "DATABASE", "S3", "MEMORY", "HARDWARE"}[t]
} }
func (t StorageType) TypeList() []StorageType {
return []StorageType{FILE, STREAM, API, DATABASE, S3, MEMORY, HARDWARE}
}