Documentation ¶
Index ¶
- Variables
- func AccountStateStrings() []string
- func CountryCodeStrings() []string
- func CurrencyStrings() []string
- func TimezoneStrings() []string
- func UserRoleStrings() []string
- type AccountState
- func (_a AccountState) IsValid() bool
- func (_a AccountState) MarshalJSON() ([]byte, error)
- func (_a *AccountState) Scan(value interface{}) error
- func (_a AccountState) String() string
- func (_a *AccountState) UnmarshalJSON(data []byte) error
- func (_a AccountState) Validate() error
- func (_a AccountState) Value() (driver.Value, error)
- type CountryCode
- func (_c CountryCode) GetAreaInSquareKilometer() uint32
- func (_c CountryCode) GetCountryCode() string
- func (_c CountryCode) GetCountryName() string
- func (_c CountryCode) GetGdpInBillion() float64
- func (_c CountryCode) GetIso2LetterCode() string
- func (_c CountryCode) GetPopulation() uint32
- func (_c CountryCode) IsValid() bool
- func (_c CountryCode) MarshalBinary() ([]byte, error)
- func (_c CountryCode) MarshalGQL(w io.Writer)
- func (_c CountryCode) MarshalJSON() ([]byte, error)
- func (_c CountryCode) MarshalText() ([]byte, error)
- func (_c CountryCode) MarshalYAML() (interface{}, error)
- func (_c *CountryCode) Scan(value interface{}) error
- func (_c CountryCode) String() string
- func (_c *CountryCode) UnmarshalBinary(text []byte) error
- func (_c *CountryCode) UnmarshalGQL(value interface{}) error
- func (_c *CountryCode) UnmarshalJSON(data []byte) error
- func (_c *CountryCode) UnmarshalText(text []byte) error
- func (_c *CountryCode) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (_c CountryCode) Validate() error
- func (_c CountryCode) Value() (driver.Value, error)
- type Currency
- func (_c Currency) GetCurrencyName() string
- func (_c Currency) GetMinorUnit() uint8
- func (_c Currency) GetNumericCode() uint16
- func (_c Currency) IsValid() bool
- func (_c Currency) MarshalBinary() ([]byte, error)
- func (_c Currency) MarshalGQL(w io.Writer)
- func (_c Currency) MarshalJSON() ([]byte, error)
- func (_c Currency) MarshalText() ([]byte, error)
- func (_c Currency) MarshalYAML() (interface{}, error)
- func (_c *Currency) Scan(value interface{}) error
- func (_c Currency) String() string
- func (_c *Currency) UnmarshalBinary(text []byte) error
- func (_c *Currency) UnmarshalGQL(value interface{}) error
- func (_c *Currency) UnmarshalJSON(data []byte) error
- func (_c *Currency) UnmarshalText(text []byte) error
- func (_c *Currency) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (_c Currency) Validate() error
- func (_c Currency) Value() (driver.Value, error)
- type NotAnEnum
- type Timezone
- func (_t Timezone) IsValid() bool
- func (_t Timezone) MarshalBinary() ([]byte, error)
- func (_t Timezone) MarshalGQL(w io.Writer)
- func (_t Timezone) MarshalJSON() ([]byte, error)
- func (_t Timezone) MarshalText() ([]byte, error)
- func (_t Timezone) MarshalYAML() (interface{}, error)
- func (_t *Timezone) Scan(value interface{}) error
- func (_t Timezone) String() string
- func (_t *Timezone) UnmarshalBinary(text []byte) error
- func (_t *Timezone) UnmarshalGQL(value interface{}) error
- func (_t *Timezone) UnmarshalJSON(data []byte) error
- func (_t *Timezone) UnmarshalText(text []byte) error
- func (_t *Timezone) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (_t Timezone) Validate() error
- func (_t Timezone) Value() (driver.Value, error)
- type UserRole
- func (_u UserRole) IsValid() bool
- func (_u UserRole) MarshalBinary() ([]byte, error)
- func (_u UserRole) MarshalGQL(w io.Writer)
- func (_u UserRole) MarshalJSON() ([]byte, error)
- func (_u UserRole) MarshalText() ([]byte, error)
- func (_u UserRole) MarshalYAML() (interface{}, error)
- func (_u *UserRole) Scan(value interface{}) error
- func (_u UserRole) String() string
- func (_u *UserRole) UnmarshalBinary(text []byte) error
- func (_u *UserRole) UnmarshalGQL(value interface{}) error
- func (_u *UserRole) UnmarshalJSON(data []byte) error
- func (_u *UserRole) UnmarshalText(text []byte) error
- func (_u *UserRole) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (_u UserRole) Validate() error
- func (_u UserRole) Value() (driver.Value, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoValidEnum = errors.New("not a valid enum")
)
Functions ¶
func AccountStateStrings ¶
func AccountStateStrings() []string
AccountStateStrings returns a slice of all String values of the enum.
func CountryCodeStrings ¶
func CountryCodeStrings() []string
CountryCodeStrings returns a slice of all String values of the enum.
func CurrencyStrings ¶
func CurrencyStrings() []string
CurrencyStrings returns a slice of all String values of the enum.
func TimezoneStrings ¶
func TimezoneStrings() []string
TimezoneStrings returns a slice of all String values of the enum.
func UserRoleStrings ¶
func UserRoleStrings() []string
UserRoleStrings returns a slice of all String values of the enum.
Types ¶
type AccountState ¶
type AccountState uint
AccountState represents various entity lifecycle states.
const ( AccountStateStaged AccountState = iota AccountStateProvisioned AccountStateActivated AccountStateDeactivated AccountStateDeprovisioned )
func AccountStateFromString ¶
func AccountStateFromString(raw string) (AccountState, bool)
AccountStateFromString determines the enum value with an exact case match.
func AccountStateFromStringIgnoreCase ¶
func AccountStateFromStringIgnoreCase(raw string) (AccountState, bool)
AccountStateFromStringIgnoreCase determines the enum value with a case-insensitive match.
func AccountStateValues ¶
func AccountStateValues() []AccountState
AccountStateValues returns all values of the enum.
func (AccountState) IsValid ¶
func (_a AccountState) IsValid() bool
IsValid tests whether the value is a valid enum value.
func (AccountState) MarshalJSON ¶
func (_a AccountState) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for AccountState.
func (*AccountState) Scan ¶
func (_a *AccountState) Scan(value interface{}) error
Scan implements the sql/driver.Scanner interface for AccountState.
func (AccountState) String ¶
func (_a AccountState) String() string
String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern AccountState(%d) instead.
func (*AccountState) UnmarshalJSON ¶
func (_a *AccountState) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for AccountState.
func (AccountState) Validate ¶
func (_a AccountState) Validate() error
Validate whether the value is within the range of enum values.
type CountryCode ¶
type CountryCode uint
CountryCode represents a set of 3-Letter codes of Countries. Each CountryCode comes with its additional data columns to augment the enum. Note: The CSV has an 8-column layout. The columns 3-8 are added values.
Example ¶
cc := utils.Must(CountryCodeFromString("USA")) fmt.Println("Country Name:", cc.GetCountryName()) fmt.Println("Country Code:", cc.GetCountryCode()) fmt.Println("Area (in km^2):", cc.GetAreaInSquareKilometer()) fmt.Println("GDP in USD:", cc.GetGdpInBillion()*1e12) fmt.Println("Population:", cc.GetPopulation())
Output: Country Name: United States Country Code: 1 Area (in km^2): 9629091 GDP in USD: 1.672e+15 Population: 310232863
func CountryCodeFromString ¶
func CountryCodeFromString(raw string) (CountryCode, bool)
CountryCodeFromString determines the enum value with an exact case match.
func CountryCodeFromStringIgnoreCase ¶
func CountryCodeFromStringIgnoreCase(raw string) (CountryCode, bool)
CountryCodeFromStringIgnoreCase determines the enum value with a case-insensitive match.
func CountryCodeValues ¶
func CountryCodeValues() []CountryCode
CountryCodeValues returns all values of the enum.
func (CountryCode) GetAreaInSquareKilometer ¶
func (_c CountryCode) GetAreaInSquareKilometer() uint32
GetAreaInSquareKilometer returns the "area-in-square-kilometer" of the enum value.
func (CountryCode) GetCountryCode ¶
func (_c CountryCode) GetCountryCode() string
GetCountryCode returns the "country-code" of the enum value.
func (CountryCode) GetCountryName ¶
func (_c CountryCode) GetCountryName() string
GetCountryName returns the "country-name" of the enum value.
func (CountryCode) GetGdpInBillion ¶
func (_c CountryCode) GetGdpInBillion() float64
GetGdpInBillion returns the "gdp-in-billion" of the enum value.
func (CountryCode) GetIso2LetterCode ¶
func (_c CountryCode) GetIso2LetterCode() string
GetIso2LetterCode returns the "iso-2-letter-code" of the enum value.
func (CountryCode) GetPopulation ¶
func (_c CountryCode) GetPopulation() uint32
GetPopulation returns the "population" of the enum value.
func (CountryCode) IsValid ¶
func (_c CountryCode) IsValid() bool
IsValid tests whether the value is a valid enum value.
func (CountryCode) MarshalBinary ¶
func (_c CountryCode) MarshalBinary() ([]byte, error)
MarshalBinary implements the encoding.BinaryMarshaler interface for CountryCode.
func (CountryCode) MarshalGQL ¶
func (_c CountryCode) MarshalGQL(w io.Writer)
MarshalGQL implements the graphql.Marshaler interface for CountryCode.
func (CountryCode) MarshalJSON ¶
func (_c CountryCode) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for CountryCode.
func (CountryCode) MarshalText ¶
func (_c CountryCode) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for CountryCode.
func (CountryCode) MarshalYAML ¶
func (_c CountryCode) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for CountryCode.
func (*CountryCode) Scan ¶
func (_c *CountryCode) Scan(value interface{}) error
Scan implements the sql/driver.Scanner interface for CountryCode.
func (CountryCode) String ¶
func (_c CountryCode) String() string
String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern CountryCode(%d) instead.
func (*CountryCode) UnmarshalBinary ¶
func (_c *CountryCode) UnmarshalBinary(text []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for CountryCode.
func (*CountryCode) UnmarshalGQL ¶
func (_c *CountryCode) UnmarshalGQL(value interface{}) error
UnmarshalGQL implements the graphql.Unmarshaler interface for CountryCode.
func (*CountryCode) UnmarshalJSON ¶
func (_c *CountryCode) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for CountryCode.
func (*CountryCode) UnmarshalText ¶
func (_c *CountryCode) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for CountryCode.
func (*CountryCode) UnmarshalYAML ¶
func (_c *CountryCode) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for CountryCode.
func (CountryCode) Validate ¶
func (_c CountryCode) Validate() error
Validate whether the value is within the range of enum values.
type Currency ¶
type Currency uint
Currency represents a set of 3-Letter codes of Currencies. Each Currency comes with its additional data columns to augment the enum. Note: The CSV has a 5-column layout. The columns 3-5 are added values.
func CurrencyFromString ¶
CurrencyFromString determines the enum value with an exact case match.
func CurrencyFromStringIgnoreCase ¶
CurrencyFromStringIgnoreCase determines the enum value with a case-insensitive match.
func CurrencyValues ¶
func CurrencyValues() []Currency
CurrencyValues returns all values of the enum.
func (Currency) GetCurrencyName ¶
GetCurrencyName returns the "currency-name" of the enum value.
func (Currency) GetMinorUnit ¶
GetMinorUnit returns the "minor-unit" of the enum value.
func (Currency) GetNumericCode ¶
GetNumericCode returns the "numeric-code" of the enum value.
func (Currency) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface for Currency.
func (Currency) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface for Currency.
func (Currency) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Currency.
func (Currency) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Currency.
func (Currency) MarshalYAML ¶
MarshalYAML implements a YAML Marshaler for Currency.
func (Currency) String ¶
String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern Currency(%d) instead.
func (*Currency) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Currency.
func (*Currency) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface for Currency.
func (*Currency) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Currency.
func (*Currency) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Currency.
func (*Currency) UnmarshalYAML ¶
UnmarshalYAML implements a YAML Unmarshaler for Currency.
type NotAnEnum ¶
type NotAnEnum uint
NotAnEnum does not contain the magic comment and will therefore be ignored.
type Timezone ¶
type Timezone uint
Timezone represents a set of 424 Timezones from TimeZoneDB. Timezone has no default value, meaning it can only be deserialized from explicit values. Note: The CSV has a 2-column layout.
const (
TimezoneEuropeLondon Timezone = 379
)
func TimezoneFromString ¶
TimezoneFromString determines the enum value with an exact case match.
func TimezoneFromStringIgnoreCase ¶
TimezoneFromStringIgnoreCase determines the enum value with a case-insensitive match.
func TimezoneValues ¶
func TimezoneValues() []Timezone
TimezoneValues returns all values of the enum.
func (Timezone) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface for Timezone.
func (Timezone) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface for Timezone.
func (Timezone) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Timezone.
func (Timezone) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Timezone.
func (Timezone) MarshalYAML ¶
MarshalYAML implements a YAML Marshaler for Timezone.
func (Timezone) String ¶
String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern Timezone(%d) instead.
func (*Timezone) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for Timezone.
func (*Timezone) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface for Timezone.
func (*Timezone) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Timezone.
func (*Timezone) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Timezone.
func (*Timezone) UnmarshalYAML ¶
UnmarshalYAML implements a YAML Unmarshaler for Timezone.
type UserRole ¶
type UserRole uint
UserRole represents a set of user specific roles. UserRoles can be deserialized from "undefined"/empty values.
func UserRoleFromString ¶
UserRoleFromString determines the enum value with an exact case match.
func UserRoleFromStringIgnoreCase ¶
UserRoleFromStringIgnoreCase determines the enum value with a case-insensitive match.
func UserRoleValues ¶
func UserRoleValues() []UserRole
UserRoleValues returns all values of the enum.
func (UserRole) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface for UserRole.
func (UserRole) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface for UserRole.
func (UserRole) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for UserRole.
func (UserRole) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for UserRole.
func (UserRole) MarshalYAML ¶
MarshalYAML implements a YAML Marshaler for UserRole.
func (UserRole) String ¶
String returns the string of the enum value. If the enum value is invalid, it will produce a string of the following pattern UserRole(%d) instead.
func (*UserRole) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for UserRole.
func (*UserRole) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface for UserRole.
func (*UserRole) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for UserRole.
func (*UserRole) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for UserRole.
func (*UserRole) UnmarshalYAML ¶
UnmarshalYAML implements a YAML Unmarshaler for UserRole.