oc-lib/models/utils/enums.go

38 lines
588 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-19 10:54:58 +02:00
)
var str = [...]string{
"invalid",
"data_resource",
"processing_resource",
"storage_resource",
"datacenter_resource",
"workflow_resource",
"workflow",
}
func FromInt(i int) string {
return str[i]
}
func (d DataType) String() string {
return str[d]
}
// EnumIndex - Creating common behavior-give the type a EnumIndex functio
func (d DataType) EnumIndex() int {
return int(d)
}