A question refers to the comment ! And if not Ooopsy

This commit is contained in:
mr
2024-08-30 14:50:48 +02:00
parent db78c70dc3
commit 8180fe5e99
39 changed files with 737 additions and 404 deletions

View File

@@ -2,6 +2,7 @@ package utils
type DataType int
// DataType - Enum for the different types of resources in db accessible from the outside
const (
INVALID DataType = iota
DATA_RESOURCE
@@ -19,6 +20,7 @@ const (
BOOKING
)
// Bind the standard API name to the data type
var DefaultAPI = [...]string{
"",
"oc-catalog",
@@ -36,6 +38,7 @@ var DefaultAPI = [...]string{
"oc-datacenter",
}
// Bind the standard data name to the data type
var Str = [...]string{
"invalid",
"data_resource",
@@ -57,11 +60,11 @@ func FromInt(i int) string {
return Str[i]
}
func (d DataType) API() string {
func (d DataType) API() string { // API - Returns the API name of the data type
return DefaultAPI[d]
}
func (d DataType) String() string {
func (d DataType) String() string { // String - Returns the string name of the data type
return Str[d]
}