Documentation ¶
Index ¶
- Variables
- func IntShopNames() []string
- func MakeNames() []string
- func NoZerosNames() []string
- func ShopNames() []string
- type AllNegative
- type Animal
- type Color
- type Commented
- type ComplexCommented
- type DataType
- type Device
- type DiffBase
- type Enum32bit
- type Enum64bit
- type ForceLowerType
- type ForceUpperType
- type IntShop
- type Make
- type NoZeros
- type Product
- type ProjectStatus
- func (x ProjectStatus) IsValid() bool
- func (x ProjectStatus) MarshalText() ([]byte, error)
- func (x ProjectStatus) Name() string
- func (x ProjectStatus) Ptr() *ProjectStatus
- func (x *ProjectStatus) Scan(value any) (err error)
- func (x ProjectStatus) String() string
- func (x *ProjectStatus) UnmarshalText(text []byte) error
- func (x ProjectStatus) Val() int
- func (x ProjectStatus) Value() (driver.Value, error)
- type ProjectStrStatus
- func (x ProjectStrStatus) IsValid() bool
- func (x ProjectStrStatus) MarshalText() ([]byte, error)
- func (x ProjectStrStatus) Name() string
- func (x ProjectStrStatus) Ptr() *ProjectStrStatus
- func (x *ProjectStrStatus) Scan(value any) (err error)
- func (x ProjectStrStatus) String() string
- func (x *ProjectStrStatus) UnmarshalText(text []byte) error
- func (x ProjectStrStatus) Val() string
- func (x ProjectStrStatus) Value() (driver.Value, error)
- type ProjectStrStatusIntCode
- func (x ProjectStrStatusIntCode) DbCode() int
- func (x ProjectStrStatusIntCode) IsValid() bool
- func (x ProjectStrStatusIntCode) MarshalText() ([]byte, error)
- func (x ProjectStrStatusIntCode) Name() string
- func (x ProjectStrStatusIntCode) Ptr() *ProjectStrStatusIntCode
- func (x *ProjectStrStatusIntCode) Scan(value any) (err error)
- func (x ProjectStrStatusIntCode) String() string
- func (x *ProjectStrStatusIntCode) UnmarshalText(text []byte) error
- func (x ProjectStrStatusIntCode) Val() string
- func (x ProjectStrStatusIntCode) Value() (driver.Value, error)
- type Shop
- type Status
- type Suffix
- type X
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAllNegative = errors.New("not a valid AllNegative")
var ErrInvalidAnimal = errors.New("not a valid Animal")
var ErrInvalidColor = errors.New("not a valid Color")
var ErrInvalidCommented = errors.New("not a valid Commented")
var ErrInvalidComplexCommented = errors.New("not a valid ComplexCommented")
var ErrInvalidDataType = errors.New("not a valid DataType")
var ErrInvalidDevice = errors.New("not a valid Device")
var ErrInvalidDiffBase = errors.New("not a valid DiffBase")
var ErrInvalidEnum32bit = errors.New("not a valid Enum32bit")
var ErrInvalidEnum64bit = errors.New("not a valid Enum64bit")
var ErrInvalidForceLowerType = errors.New("not a valid ForceLowerType")
var ErrInvalidForceUpperType = errors.New("not a valid ForceUpperType")
var ErrInvalidIntShop = fmt.Errorf("not a valid IntShop, try [%s]", strings.Join(_IntShopNames, ", "))
var ErrInvalidMake = fmt.Errorf("not a valid Make, try [%s]", strings.Join(_MakeNames, ", "))
var ErrInvalidNoZeros = fmt.Errorf("not a valid NoZeros, try [%s]", strings.Join(_NoZerosNames, ", "))
var ErrInvalidProduct = errors.New("not a valid Product")
var ErrInvalidProjectStatus = errors.New("not a valid ProjectStatus")
var ErrInvalidProjectStrStatus = errors.New("not a valid ProjectStrStatus")
var ErrInvalidProjectStrStatusIntCode = errors.New("not a valid ProjectStrStatusIntCode")
var ErrInvalidShop = fmt.Errorf("not a valid Shop, try [%s]", strings.Join(_ShopNames, ", "))
var ErrInvalidStatus = errors.New("not a valid Status")
var ErrInvalidSuffix = errors.New("not a valid Suffix")
var ErrProjectStatusNilPtr = errors.New("value pointer is nil")
var ErrProjectStrStatusIntCodeNilPtr = errors.New("value pointer is nil")
var ErrProjectStrStatusNilPtr = errors.New("value pointer is nil")
Functions ¶
func IntShopNames ¶
func IntShopNames() []string
IntShopNames returns a list of the names of IntShop
func NoZerosNames ¶
func NoZerosNames() []string
NoZerosNames returns a list of the names of NoZeros
Types ¶
type AllNegative ¶
type AllNegative int
@ENUM{ Unknown = -5, Good, Bad, Ugly }.
const ( // AllNegativeUnknown is an AllNegative of type Unknown. AllNegativeUnknown AllNegative = -5 // AllNegativeGood is an AllNegative of type Good. AllNegativeGood AllNegative = -4 // AllNegativeBad is an AllNegative of type Bad. AllNegativeBad AllNegative = -3 // AllNegativeUgly is an AllNegative of type Ugly. AllNegativeUgly AllNegative = -2 )
func ParseAllNegative ¶
func ParseAllNegative(value string) (AllNegative, error)
ParseAllNegative converts a string to an AllNegative.
func (AllNegative) IsValid ¶
func (x AllNegative) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (AllNegative) String ¶
func (x AllNegative) String() string
String implements the Stringer interface.
type Animal ¶
type Animal int32
Animal x @ENUM(Name string){ Cat(_), Dog(Dog), Fish("Fish") FishPlusPlus("Fish++") FishSharp("Fish#") }.
const ( // AnimalCat is an Animal of type Cat. AnimalCat Animal = iota // AnimalDog is an Animal of type Dog. AnimalDog // AnimalFish is an Animal of type Fish. AnimalFish // AnimalFishPlusPlus is an Animal of type Fish++. AnimalFishPlusPlus // AnimalFishSharp is an Animal of type Fish#. AnimalFishSharp )
func ParseAnimal ¶
ParseAnimal converts a string to an Animal.
type Color ¶
type Color int
Color is an enumeration of colors that are allowed. @EnumConfig(marshal, noCase, Mustparse, ptr)
@ENUM (Name string){
Black(_), White(_), Red(_) Green(_) = 33 // Green starts with 33
Blue(_) grey(_)=45 _ _ yellow(_) blue_green("blue-green") red_orange("red-orange") yellow_green(_) red_orange_blue("red-orange-blue") }
const ( // ColorBlack is a Color of type Black. ColorBlack Color = 0 // ColorWhite is a Color of type White. ColorWhite Color = 1 // ColorRed is a Color of type Red. ColorRed Color = 2 // ColorGreen is a Color of type Green. ColorGreen Color = 33 // Green starts with 33 // ColorBlue is a Color of type Blue. ColorBlue Color = 34 // ColorGrey is a Color of type grey. ColorGrey Color = 45 // ColorYellow is a Color of type yellow. ColorYellow Color = 48 // ColorBlueGreen is a Color of type blue-green. ColorBlueGreen Color = 49 // ColorRedOrange is a Color of type red-orange. ColorRedOrange Color = 50 // ColorYellowGreen is a Color of type yellow_green. ColorYellowGreen Color = 51 // ColorRedOrangeBlue is a Color of type red-orange-blue. ColorRedOrangeBlue Color = 52 )
func MustParseColor ¶
MustParseColor converts a string to a Color, and panics if is not valid.
func ParseColor ¶
ParseColor converts a string to a Color.
func (Color) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (Color) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Color) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Commented ¶
type Commented int
Commented is an enumeration of commented values
@ENUM{ value1 // Commented value 1 value2 value3 // Commented value 3 }
func ParseCommented ¶
ParseCommented converts a string to a Commented.
func (Commented) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (Commented) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Commented) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type ComplexCommented ¶
type ComplexCommented int
ComplexCommented has some extra complicated parsing rules.
@ENUM{ _, // Placeholder with a ',' in it. (for harder testing)
value1 // Commented value 1 value2, _ _ value3 // Commented value 3 }
const ( // ComplexCommentedValue1 is a ComplexCommented of type value1. ComplexCommentedValue1 ComplexCommented // Commented value 1 // ComplexCommentedValue2 is a ComplexCommented of type value2. ComplexCommentedValue2 // ComplexCommentedValue3 is a ComplexCommented of type value3. ComplexCommentedValue3 // Commented value 3 )
func ParseComplexCommented ¶
func ParseComplexCommented(value string) (ComplexCommented, error)
ParseComplexCommented converts a string to a ComplexCommented.
func (ComplexCommented) IsValid ¶
func (x ComplexCommented) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ComplexCommented) MarshalText ¶
func (x ComplexCommented) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (ComplexCommented) Name ¶
func (x ComplexCommented) Name() string
Name is the attribute of ComplexCommented.
func (ComplexCommented) String ¶
func (x ComplexCommented) String() string
String implements the Stringer interface.
func (*ComplexCommented) UnmarshalText ¶
func (x *ComplexCommented) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
func (ComplexCommented) Val ¶
func (x ComplexCommented) Val() int
Val is the attribute of ComplexCommented.
type DataType ¶
type DataType byte
DataType 数据类型
@EnumConfig(NoCamel) @Enum { AI = 0x0A // 表示模拟量 DI = 0x0D // 表示数字量 }
func ParseDataType ¶
ParseDataType converts a string to a DataType.
func (DataType) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
type Device ¶
type Device int
Device : protocol deveice
@Enum(code int, isBit bool, str string, a int16) { SM(0x91, true, "123", 1) // 特殊继电器, bit, 10 SD(0xA9, false, "456", 2) // 特殊寄存器, word, 10 }
func ParseDevice ¶
ParseDevice converts a string to a Device.
type DiffBase ¶
type DiffBase int
@EnumConfig(forcelower) @ENUM{
B3 = 03 B4 = 04 B5 = 5 B6 = 0b110 B7 = 0b111 B8 = 0x08 B9 = 0x09 B10 = 0x0B B11 = 0x2B
}
const ( // DiffBaseB3 is a DiffBase of type b3. DiffBaseB3 DiffBase = 3 // DiffBaseB4 is a DiffBase of type b4. DiffBaseB4 DiffBase = 4 // DiffBaseB5 is a DiffBase of type b5. DiffBaseB5 DiffBase = 5 // DiffBaseB6 is a DiffBase of type b6. DiffBaseB6 DiffBase = 6 // DiffBaseB7 is a DiffBase of type b7. DiffBaseB7 DiffBase = 7 // DiffBaseB8 is a DiffBase of type b8. DiffBaseB8 DiffBase = 8 // DiffBaseB9 is a DiffBase of type b9. DiffBaseB9 DiffBase = 9 // DiffBaseB10 is a DiffBase of type b10. DiffBaseB10 DiffBase = 11 // DiffBaseB11 is a DiffBase of type b11. DiffBaseB11 DiffBase = 43 )
func ParseDiffBase ¶
ParseDiffBase converts a string to a DiffBase.
func (DiffBase) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
type Enum32bit ¶
type Enum32bit uint32
@EnumConfig(values) @ENUM{
Unkno = 0 E2P15 = 32768 E2P16 = 65536 E2P17 = 131072 E2P18 = 262144 E2P19 = 524288 E2P20 = 1048576 E2P21 = 2097152 E2P22 = 33554432 E2P23 = 67108864 E2P28 = 536870912 E2P30 = 1073741824
}
const ( // Enum32bitUnkno is an Enum32bit of type Unkno. Enum32bitUnkno Enum32bit = 0 // Enum32bitE2P15 is an Enum32bit of type E2P15. Enum32bitE2P15 Enum32bit = 32768 // Enum32bitE2P16 is an Enum32bit of type E2P16. Enum32bitE2P16 Enum32bit = 65536 // Enum32bitE2P17 is an Enum32bit of type E2P17. Enum32bitE2P17 Enum32bit = 131072 // Enum32bitE2P18 is an Enum32bit of type E2P18. Enum32bitE2P18 Enum32bit = 262144 // Enum32bitE2P19 is an Enum32bit of type E2P19. Enum32bitE2P19 Enum32bit = 524288 // Enum32bitE2P20 is an Enum32bit of type E2P20. Enum32bitE2P20 Enum32bit = 1048576 // Enum32bitE2P21 is an Enum32bit of type E2P21. Enum32bitE2P21 Enum32bit = 2097152 // Enum32bitE2P22 is an Enum32bit of type E2P22. Enum32bitE2P22 Enum32bit = 33554432 // Enum32bitE2P23 is an Enum32bit of type E2P23. Enum32bitE2P23 Enum32bit = 67108864 // Enum32bitE2P28 is an Enum32bit of type E2P28. Enum32bitE2P28 Enum32bit = 536870912 // Enum32bitE2P30 is an Enum32bit of type E2P30. Enum32bitE2P30 Enum32bit = 1073741824 )
func Enum32bitValues ¶
func Enum32bitValues() []Enum32bit
Enum32bitValues returns a list of the values of Enum32bit
func ParseEnum32bit ¶
ParseEnum32bit converts a string to an Enum32bit.
func (Enum32bit) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
type Enum64bit ¶
type Enum64bit uint64
@EnumConfig(values) @ENUM{ Unkno = 0 E2P15 = 32768 E2P16 = 65536 E2P17 = 131072 E2P18 = 262144 E2P19 = 524288 E2P20 = 1048576 E2P21 = 2097152 E2P22 = 33554432 E2P23 = 67108864 E2P28 = 536870912 E2P30 = 1073741824 E2P31 = 2147483648 E2P32 = 4294967296 E2P33 = 8454967296 E2P63 = 18446744073709551615 }
const ( // Enum64bitUnkno is an Enum64bit of type Unkno. Enum64bitUnkno Enum64bit = 0 // Enum64bitE2P15 is an Enum64bit of type E2P15. Enum64bitE2P15 Enum64bit = 32768 // Enum64bitE2P16 is an Enum64bit of type E2P16. Enum64bitE2P16 Enum64bit = 65536 // Enum64bitE2P17 is an Enum64bit of type E2P17. Enum64bitE2P17 Enum64bit = 131072 // Enum64bitE2P18 is an Enum64bit of type E2P18. Enum64bitE2P18 Enum64bit = 262144 // Enum64bitE2P19 is an Enum64bit of type E2P19. Enum64bitE2P19 Enum64bit = 524288 // Enum64bitE2P20 is an Enum64bit of type E2P20. Enum64bitE2P20 Enum64bit = 1048576 // Enum64bitE2P21 is an Enum64bit of type E2P21. Enum64bitE2P21 Enum64bit = 2097152 // Enum64bitE2P22 is an Enum64bit of type E2P22. Enum64bitE2P22 Enum64bit = 33554432 // Enum64bitE2P23 is an Enum64bit of type E2P23. Enum64bitE2P23 Enum64bit = 67108864 // Enum64bitE2P28 is an Enum64bit of type E2P28. Enum64bitE2P28 Enum64bit = 536870912 // Enum64bitE2P30 is an Enum64bit of type E2P30. Enum64bitE2P30 Enum64bit = 1073741824 // Enum64bitE2P31 is an Enum64bit of type E2P31. Enum64bitE2P31 Enum64bit = 2147483648 // Enum64bitE2P32 is an Enum64bit of type E2P32. Enum64bitE2P32 Enum64bit = 4294967296 // Enum64bitE2P33 is an Enum64bit of type E2P33. Enum64bitE2P33 Enum64bit = 8454967296 // Enum64bitE2P63 is an Enum64bit of type E2P63. Enum64bitE2P63 Enum64bit = 18446744073709551615 )
func Enum64bitValues ¶
func Enum64bitValues() []Enum64bit
Enum64bitValues returns a list of the values of Enum64bit
func ParseEnum64bit ¶
ParseEnum64bit converts a string to an Enum64bit.
func (Enum64bit) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
type ForceLowerType ¶
type ForceLowerType int
@EnumConfig(forcelower) @ENUM{ DataSwap, BootNode, }
const ( // ForceLowerTypeDataSwap is a ForceLowerType of type dataswap. ForceLowerTypeDataSwap ForceLowerType = iota // ForceLowerTypeBootNode is a ForceLowerType of type bootnode. ForceLowerTypeBootNode )
func ParseForceLowerType ¶
func ParseForceLowerType(value string) (ForceLowerType, error)
ParseForceLowerType converts a string to a ForceLowerType.
func (ForceLowerType) IsValid ¶
func (x ForceLowerType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ForceLowerType) Name ¶
func (x ForceLowerType) Name() string
Name is the attribute of ForceLowerType.
func (ForceLowerType) String ¶
func (x ForceLowerType) String() string
String implements the Stringer interface.
func (ForceLowerType) Val ¶
func (x ForceLowerType) Val() int
Val is the attribute of ForceLowerType.
type ForceUpperType ¶
type ForceUpperType int
@EnumConfig(forceupper) @ENUM{ DataSwap, BootNode, }
const ( // ForceUpperTypeDataSwap is a ForceUpperType of type DATASWAP. ForceUpperTypeDataSwap ForceUpperType = iota // ForceUpperTypeBootNode is a ForceUpperType of type BOOTNODE. ForceUpperTypeBootNode )
func ParseForceUpperType ¶
func ParseForceUpperType(value string) (ForceUpperType, error)
ParseForceUpperType converts a string to a ForceUpperType.
func (ForceUpperType) IsValid ¶
func (x ForceUpperType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ForceUpperType) Name ¶
func (x ForceUpperType) Name() string
Name is the attribute of ForceUpperType.
func (ForceUpperType) String ¶
func (x ForceUpperType) String() string
String implements the Stringer interface.
func (ForceUpperType) Val ¶
func (x ForceUpperType) Val() int
Val is the attribute of ForceUpperType.
type IntShop ¶
type IntShop int
@EnumConfig(marshal, prefix="AcmeInt_", noprefix, nocamel, names) Shops @ENUM{ SOME_PLACE_AWESOME, SomewhereElse, LocationUnknown }
func ParseIntShop ¶
ParseIntShop converts a string to an IntShop.
func (IntShop) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (IntShop) MarshalText ¶
MarshalText implements the text marshaller method.
func (*IntShop) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Make ¶
type Make int32
Make x @ENUM{Toyota,_,Chevy,_,Ford,_,Tesla,_,Hyundai,_,Nissan,_,Jaguar,_,Audi,_,BMW,_,Mercedes_Benz,_,Volkswagon}
const ( // MakeToyota is a Make of type Toyota. MakeToyota Make = iota // MakeChevy is a Make of type Chevy. MakeChevy // MakeFord is a Make of type Ford. MakeFord // MakeTesla is a Make of type Tesla. MakeTesla // MakeHyundai is a Make of type Hyundai. MakeHyundai // MakeNissan is a Make of type Nissan. MakeNissan // MakeJaguar is a Make of type Jaguar. MakeJaguar // MakeAudi is a Make of type Audi. MakeAudi // MakeBmw is a Make of type BMW. MakeBmw // MakeMercedesBenz is a Make of type Mercedes_Benz. MakeMercedesBenz // MakeVolkswagon is a Make of type Volkswagon. MakeVolkswagon )
func (Make) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (Make) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Make) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type NoZeros ¶
type NoZeros int32
Make x @ENUM{start=20,middle,end,ps,pps,ppps}
const ( // NoZerosStart is a NoZeros of type start. NoZerosStart NoZeros = 20 // NoZerosMiddle is a NoZeros of type middle. NoZerosMiddle NoZeros = 21 // NoZerosEnd is a NoZeros of type end. NoZerosEnd NoZeros = 22 // NoZerosPs is a NoZeros of type ps. NoZerosPs NoZeros = 23 // NoZerosPps is a NoZeros of type pps. NoZerosPps NoZeros = 24 // NoZerosPpps is a NoZeros of type ppps. NoZerosPpps NoZeros = 25 )
func NoZerosValues ¶
func NoZerosValues() []NoZeros
NoZerosValues returns a list of the values of NoZeros
func ParseNoZeros ¶
ParseNoZeros converts a string to a NoZeros.
func (NoZeros) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (NoZeros) MarshalText ¶
MarshalText implements the text marshaller method.
func (*NoZeros) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Product ¶
type Product int32
@EnumConfig(prefix="AcmeInc") Products of AcmeInc @ENUM{ Anvil, Dynamite, Glue }
func ParseProduct ¶
ParseProduct converts a string to a Product.
type ProjectStatus ¶
type ProjectStatus int
@EnumConfig(sql, ptr, marshal, nocomments) @ENUM{pending, inWork, completed, rejected}
const ( ProjectStatusPending ProjectStatus = iota ProjectStatusInWork ProjectStatusCompleted ProjectStatusRejected )
func ParseProjectStatus ¶
func ParseProjectStatus(value string) (ProjectStatus, error)
ParseProjectStatus converts a string to a ProjectStatus.
func (ProjectStatus) IsValid ¶
func (x ProjectStatus) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ProjectStatus) MarshalText ¶
func (x ProjectStatus) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (ProjectStatus) Name ¶
func (x ProjectStatus) Name() string
Name is the attribute of ProjectStatus.
func (ProjectStatus) Ptr ¶
func (x ProjectStatus) Ptr() *ProjectStatus
func (*ProjectStatus) Scan ¶
func (x *ProjectStatus) Scan(value any) (err error)
Scan implements the Scanner interface.
func (ProjectStatus) String ¶
func (x ProjectStatus) String() string
String implements the Stringer interface.
func (*ProjectStatus) UnmarshalText ¶
func (x *ProjectStatus) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type ProjectStrStatus ¶
type ProjectStrStatus string
@EnumConfig(sql, ptr, marshal, nocomments) @ENUM{pending, inWork, completed, rejected}
const ( ProjectStrStatusPending ProjectStrStatus = "pending" ProjectStrStatusInWork ProjectStrStatus = "inWork" ProjectStrStatusCompleted ProjectStrStatus = "completed" ProjectStrStatusRejected ProjectStrStatus = "rejected" )
func ParseProjectStrStatus ¶
func ParseProjectStrStatus(value string) (ProjectStrStatus, error)
ParseProjectStrStatus converts a string to a ProjectStrStatus.
func (ProjectStrStatus) IsValid ¶
func (x ProjectStrStatus) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ProjectStrStatus) MarshalText ¶
func (x ProjectStrStatus) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (ProjectStrStatus) Name ¶
func (x ProjectStrStatus) Name() string
Name is the attribute of ProjectStrStatus.
func (ProjectStrStatus) Ptr ¶
func (x ProjectStrStatus) Ptr() *ProjectStrStatus
func (*ProjectStrStatus) Scan ¶
func (x *ProjectStrStatus) Scan(value any) (err error)
Scan implements the Scanner interface.
func (ProjectStrStatus) String ¶
func (x ProjectStrStatus) String() string
String implements the Stringer interface.
func (*ProjectStrStatus) UnmarshalText ¶
func (x *ProjectStrStatus) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
func (ProjectStrStatus) Val ¶
func (x ProjectStrStatus) Val() string
Val is the attribute of ProjectStrStatus.
type ProjectStrStatusIntCode ¶
type ProjectStrStatusIntCode string
@EnumConfig(sql, ptr, marshal, nocomments, sqlName=dbCode)
@ENUM(dbCode int) { pending(0) inWork(10) completed(20) rejected(30) }
const ( ProjectStrStatusIntCodePending ProjectStrStatusIntCode = "pending" ProjectStrStatusIntCodeInWork ProjectStrStatusIntCode = "inWork" ProjectStrStatusIntCodeCompleted ProjectStrStatusIntCode = "completed" ProjectStrStatusIntCodeRejected ProjectStrStatusIntCode = "rejected" )
func ParseProjectStrStatusIntCode ¶
func ParseProjectStrStatusIntCode(value string) (ProjectStrStatusIntCode, error)
ParseProjectStrStatusIntCode converts a string to a ProjectStrStatusIntCode.
func (ProjectStrStatusIntCode) DbCode ¶
func (x ProjectStrStatusIntCode) DbCode() int
DbCode is the attribute of ProjectStrStatusIntCode.
func (ProjectStrStatusIntCode) IsValid ¶
func (x ProjectStrStatusIntCode) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ProjectStrStatusIntCode) MarshalText ¶
func (x ProjectStrStatusIntCode) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (ProjectStrStatusIntCode) Name ¶
func (x ProjectStrStatusIntCode) Name() string
Name is the attribute of ProjectStrStatusIntCode.
func (ProjectStrStatusIntCode) Ptr ¶
func (x ProjectStrStatusIntCode) Ptr() *ProjectStrStatusIntCode
func (*ProjectStrStatusIntCode) Scan ¶
func (x *ProjectStrStatusIntCode) Scan(value any) (err error)
Scan implements the Scanner interface.
func (ProjectStrStatusIntCode) String ¶
func (x ProjectStrStatusIntCode) String() string
String implements the Stringer interface.
func (*ProjectStrStatusIntCode) UnmarshalText ¶
func (x *ProjectStrStatusIntCode) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
func (ProjectStrStatusIntCode) Val ¶
func (x ProjectStrStatusIntCode) Val() string
Val is the attribute of ProjectStrStatusIntCode.
type Shop ¶
type Shop string
@EnumConfig(marshal, prefix="AcmeInc_", noprefix, nocamel, names) Shops @ENUM{ SOME_PLACE_AWESOME, SomewhereElse, LocationUnknown }
const ( // AcmeInc_SOME_PLACE_AWESOME is a Shop of type SOME_PLACE_AWESOME. AcmeInc_SOME_PLACE_AWESOME Shop = "SOME_PLACE_AWESOME" // AcmeInc_SomewhereElse is a Shop of type SomewhereElse. AcmeInc_SomewhereElse Shop = "SomewhereElse" // AcmeInc_LocationUnknown is a Shop of type LocationUnknown. AcmeInc_LocationUnknown Shop = "LocationUnknown" )
func (Shop) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (Shop) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Shop) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Status ¶
type Status int
@ENUM{ Unknown = -1, Good, Bad }.
func ParseStatus ¶
ParseStatus converts a string to a Status.
type Suffix ¶
type Suffix string
Suffix @ENUM{gen}
const ( // SuffixGen is a Suffix of type gen. SuffixGen Suffix = "gen" )
func ParseSuffix ¶
ParseSuffix converts a string to a Suffix.
Source Files ¶
- animal.go
- animal_ag.go
- attr_default_value.go
- attr_default_value_ag.go
- color.go
- color_ag.go
- commented.go
- commented_ag.go
- custom_prefix.go
- custom_prefix_ag.go
- diff_base.go
- diff_base_ag.go
- enum_32_bit.go
- enum_32_bit_ag.go
- enum_64_bit.go
- enum_64_bit_ag.go
- enum_8_bit.go
- enum_8_bit_ag.go
- example.go
- example_ag.go
- force_lower.go
- force_lower_ag.go
- force_upper.go
- force_upper_ag.go
- negative.go
- negative_ag.go
- replace_prefix.go
- replace_prefix_ag.go
- replace_prefix_int.go
- replace_prefix_int_ag.go
- sql.go
- sql_ag.go
- suffix.enum.gen.go
- suffix.go