goext/enums/enum.go

32 lines
584 B
Go
Raw Permalink Normal View History

2023-08-09 14:40:16 +02:00
package enums
type Enum interface {
Valid() bool
ValuesAny() []any
ValuesMeta() []EnumMetaValue
VarName() string
}
type StringEnum interface {
Enum
String() string
}
type DescriptionEnum interface {
Enum
Description() string
DescriptionMeta() EnumDescriptionMetaValue
2023-08-09 14:40:16 +02:00
}
type EnumMetaValue struct {
VarName string `json:"varName"`
Value Enum `json:"value"`
2023-08-09 14:40:16 +02:00
Description *string `json:"description"`
}
type EnumDescriptionMetaValue struct {
VarName string `json:"varName"`
Value Enum `json:"value"`
Description string `json:"description"`
}