oc-lib/models/utils/enums.go

41 lines
636 B
Go
Raw Normal View History

2024-07-19 10:54:58 +02:00
package utils
type DataType int
const (
INVALID DataType = iota
DATA_RESOURCE
PROCESSING_RESOURCE
STORAGE_RESOURCE
DATACENTER_RESOURCE
WORKFLOW_RESOURCE
WORKFLOW
2024-07-23 16:14:46 +02:00
WORKFLOW_EXECUTION
2024-07-25 09:28:55 +02:00
WORKSPACE
2024-07-19 10:54:58 +02:00
)
2024-07-26 14:15:55 +02:00
var Str = [...]string{
2024-07-19 10:54:58 +02:00
"invalid",
"data_resource",
"processing_resource",
"storage_resource",
"datacenter_resource",
"workflow_resource",
"workflow",
2024-07-24 08:58:40 +02:00
"workflow_execution",
2024-07-25 09:28:55 +02:00
"workspace",
2024-07-19 10:54:58 +02:00
}
func FromInt(i int) string {
2024-07-26 14:15:55 +02:00
return Str[i]
2024-07-19 10:54:58 +02:00
}
func (d DataType) String() string {
2024-07-26 14:15:55 +02:00
return Str[d]
2024-07-19 10:54:58 +02:00
}
// EnumIndex - Creating common behavior-give the type a EnumIndex functio
func (d DataType) EnumIndex() int {
return int(d)
}