goext/enums/enum.go

34 lines
625 B
Go
Raw Normal View History

2023-08-09 14:40:16 +02:00
package enums
type Enum interface {
Valid() bool
ValuesAny() []any
ValuesMeta() []EnumMetaValue
VarName() string
TypeName() string
PackageName() string
2023-08-09 14:40:16 +02:00
}
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"`
}