Documentation
¶
Index ¶
- Variables
- type Base
- func (v Base) Float() float64
- func (v Base) IsValid() bool
- func (v Base) MarshalJSON() ([]byte, error)
- func (v Base) MarshalText() (text []byte, err error)
- func (v Base) Ordinal() int
- func (v *Base) Parse(s string) error
- func (v *Base) Scan(value interface{}) error
- func (v Base) String() string
- func (v Base) Tag() string
- func (v *Base) UnmarshalJSON(text []byte) error
- func (v *Base) UnmarshalText(text []byte) error
- func (v Base) Value() (driver.Value, error)
- type Country
- func (v Country) Int() int
- func (v Country) IsValid() bool
- func (v Country) MarshalJSON() ([]byte, error)
- func (v Country) MarshalText() (text []byte, err error)
- func (v Country) Ordinal() int
- func (v *Country) Parse(s string) error
- func (v *Country) Scan(value interface{}) error
- func (v Country) String() string
- func (v Country) Tag() string
- func (v *Country) UnmarshalJSON(text []byte) error
- func (v *Country) UnmarshalText(text []byte) error
- func (v Country) Value() (driver.Value, error)
- type Day
- func (v Day) Int() int
- func (v Day) IsValid() bool
- func (v Day) MarshalJSON() ([]byte, error)
- func (v Day) MarshalText() (text []byte, err error)
- func (v Day) Ordinal() int
- func (v *Day) Parse(s string) error
- func (v *Day) Scan(value interface{}) error
- func (v Day) String() string
- func (v Day) Tag() string
- func (v *Day) UnmarshalJSON(text []byte) error
- func (v *Day) UnmarshalText(text []byte) error
- func (v Day) Value() (driver.Value, error)
- type GreekAlphabet
- func (v GreekAlphabet) Int() int
- func (v GreekAlphabet) IsValid() bool
- func (v GreekAlphabet) MarshalJSON() ([]byte, error)
- func (v GreekAlphabet) MarshalText() (text []byte, err error)
- func (v GreekAlphabet) Ordinal() int
- func (v *GreekAlphabet) Parse(s string) error
- func (v *GreekAlphabet) Scan(value interface{}) error
- func (v GreekAlphabet) String() string
- func (v GreekAlphabet) Tag() string
- func (v *GreekAlphabet) UnmarshalJSON(text []byte) error
- func (v *GreekAlphabet) UnmarshalText(text []byte) error
- func (v GreekAlphabet) Value() (driver.Value, error)
- type Method
- func (v Method) Int() int
- func (v Method) IsValid() bool
- func (v Method) MarshalJSON() ([]byte, error)
- func (v Method) MarshalText() (text []byte, err error)
- func (v Method) Ordinal() int
- func (v *Method) Parse(s string) error
- func (v *Method) Scan(value interface{}) error
- func (v Method) String() string
- func (v Method) Tag() string
- func (v *Method) UnmarshalJSON(text []byte) error
- func (v *Method) UnmarshalText(text []byte) error
- func (v Method) Value() (driver.Value, error)
- type Month
- func (v Month) Int() int
- func (v Month) IsValid() bool
- func (v Month) MarshalJSON() ([]byte, error)
- func (v Month) MarshalText() (text []byte, err error)
- func (v Month) Ordinal() int
- func (v *Month) Parse(s string) error
- func (v *Month) Scan(value interface{}) error
- func (v Month) String() string
- func (v Month) Tag() string
- func (v *Month) UnmarshalJSON(text []byte) error
- func (v *Month) UnmarshalText(text []byte) error
- func (v Month) Value() (driver.Value, error)
- type Pet
- func (v Pet) Int() int
- func (v Pet) IsValid() bool
- func (v Pet) MarshalJSON() ([]byte, error)
- func (v Pet) MarshalText() (text []byte, err error)
- func (v Pet) Ordinal() int
- func (v *Pet) Parse(s string) error
- func (v *Pet) Scan(value interface{}) error
- func (v Pet) String() string
- func (v Pet) Tag() string
- func (v *Pet) UnmarshalJSON(text []byte) error
- func (v *Pet) UnmarshalText(text []byte) error
- func (v Pet) Value() (driver.Value, error)
- type SalesChannel
- func (v SalesChannel) Int() int
- func (v SalesChannel) IsValid() bool
- func (v SalesChannel) MarshalJSON() ([]byte, error)
- func (v SalesChannel) MarshalText() (text []byte, err error)
- func (v SalesChannel) Ordinal() int
- func (v *SalesChannel) Parse(s string) error
- func (v *SalesChannel) Scan(value interface{}) error
- func (v SalesChannel) String() string
- func (v SalesChannel) Tag() string
- func (v *SalesChannel) UnmarshalJSON(text []byte) error
- func (v *SalesChannel) UnmarshalText(text []byte) error
- func (v SalesChannel) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var AllBaseEnums = enum.FloatEnums{ A, C, G, T, }
AllBaseEnums lists all 4 values in order.
AllBases lists all 4 values in order.
var AllCountries = []Country{}/* 247 elements not displayed */
AllCountries lists all 247 values in order.
var AllCountryEnums = enum.IntEnums{}/* 247 elements not displayed */
AllCountryEnums lists all 247 values in order.
var AllDayEnums = enum.IntEnums{ Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, }
AllDayEnums lists all 7 values in order.
AllDays lists all 7 values in order.
var AllGreekAlphabetEnums = enum.IntEnums{ Αλφα, Βήτα, Γάμμα, Δέλτα, Εψιλον, Ζήτα, Ητα, Θήτα, Ιώτα, Κάππα, Λάμβδα, Μυ, Νυ, Ξι, Ομικρον, Πι, Ρώ, Σίγμα, Ταυ, Υψιλον, Φι, Χι, Ψι, Ωμέγα, }
AllGreekAlphabetEnums lists all 24 values in order.
var AllGreekAlphabets = []GreekAlphabet{ Αλφα, Βήτα, Γάμμα, Δέλτα, Εψιλον, Ζήτα, Ητα, Θήτα, Ιώτα, Κάππα, Λάμβδα, Μυ, Νυ, Ξι, Ομικρον, Πι, Ρώ, Σίγμα, Ταυ, Υψιλον, Φι, Χι, Ψι, Ωμέγα, }
AllGreekAlphabets lists all 24 values in order.
AllMethodEnums lists all 6 values in order.
AllMethods lists all 6 values in order.
var AllMonthEnums = enum.IntEnums{ January, February, March, April, May, June, July, August, September, October, November, December, }
AllMonthEnums lists all 12 values in order.
var AllMonths = []Month{ January, February, March, April, May, June, July, August, September, October, November, December, }
AllMonths lists all 12 values in order.
var AllPetEnums = enum.IntEnums{ MyCat, MyDog, MyMouse, MyElephant, MyKoala_Bear, }
AllPetEnums lists all 5 values in order.
var AllPets = []Pet{ MyCat, MyDog, MyMouse, MyElephant, MyKoala_Bear, }
AllPets lists all 5 values in order.
var AllSalesChannelEnums = enum.IntEnums{ OnlineSales, InstoreSales, TelephoneSales, }
AllSalesChannelEnums lists all 3 values in order.
var AllSalesChannels = []SalesChannel{ OnlineSales, InstoreSales, TelephoneSales, }
AllSalesChannels lists all 3 values in order.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base float32
const A Base = 331.2
Nucleotide Molecular Weights, g/mol
const C Base = 307.2
const G Base = 347.2
const T Base = 322.2
func AsBase ¶
AsBase parses a string to find the corresponding Base, accepting either one of the string values or a number. The input representation is determined by baseMarshalTextRep. It wraps Parse.
func BaseOf ¶
BaseOf returns a Base based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid Base is returned.
func MustParseBase ¶ added in v2.7.0
MustParseBase is similar to AsBase except that it panics on error.
func (Base) Float ¶
Float returns the float64 value. It serves to facilitate polymorphism (see enum.FloatEnum).
func (Base) MarshalJSON ¶
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to baseMarshalTextRep.
func (Base) MarshalText ¶
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to baseMarshalTextRep.
func (Base) Ordinal ¶
Ordinal returns the ordinal number of a Base. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*Base) Parse ¶
Parse parses a string to find the corresponding Base, accepting one of the string values or a number. The input representation is determined by baseMarshalTextRep. It is used by AsBase.
Usage Example
v := new(Base) err := v.Parse(s) ... etc
func (*Base) Scan ¶
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (Base) String ¶
String returns the literal string representation of a Base, which is the same as the const identifier but without prefix or suffix.
func (*Base) UnmarshalJSON ¶
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*Base) UnmarshalText ¶
UnmarshalText converts transmitted values to ordinary values.
type Country ¶ added in v2.5.0
type Country int
const ( Afghanistan Country = iota Aland_Islands Albania Algeria American_Samoa Andorra Angola Anguilla Antarctica Antigua_and_Barbuda Argentina Armenia Aruba Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia Bosnia_and_Herzegovina Botswana Bouvet_Island Brazil British_Virgin_Islands British_Indian_Ocean_Territory Brunei_Darussalam Bulgaria Burkina_Faso Burundi Cambodia Cameroon Canada Cape_Verde Cayman_Islands Central_African_Republic Chad Chile China Hong_Kong // Special Administrative Region of China Macao // Special Administrative Region of China Christmas_Island Cocos_Islands // Cocos (Keeling) Islands Colombia Comoros Congo_Brazzaville // Congo (Brazzaville) Congo_DRC // Democratic Republic of the Congo Cook_Islands Costa_Rica Côte_dIvoire // Côte_d’Ivoire Croatia Cuba Cyprus Czech_Republic Denmark Djibouti Dominica Dominican_Republic Ecuador Egypt El_Salvador Equatorial_Guinea Eritrea Estonia Ethiopia Falkland_Islands // Falkland Islands (Malvinas) Faroe_Islands Fiji Finland France French_Guiana French_Polynesia French_Southern_Territories Gabon Gambia Georgia Germany Ghana Gibraltar Greece Greenland Grenada Guadeloupe Guam Guatemala Guernsey Guinea Guinea_Bissau Guyana Haiti Heard_Island_and_Mcdonald_Islands Holy_See // Vatican City State Honduras Hungary Iceland India Indonesia Iran // Islamic Republic of Iran Iraq Ireland Isle_of_Man Israel Italy Jamaica Japan Jersey Jordan Kazakhstan Kenya Kiribati Democratic_Peoples_Republic_of_Korea // Democratic People’s Republic of Korea South_Korea // Republic of Korea Kuwait Kyrgyzstan Lao_PDR Latvia Lebanon Lesotho Liberia Libya Liechtenstein Lithuania Luxembourg Macedonia // Republic of Macedonia Madagascar Malawi Malaysia Maldives Mali Malta Marshall_Islands Martinique Mauritania Mauritius Mayotte Mexico Micronesia // Federated States of Micronesia Moldova Monaco Mongolia Montenegro Montserrat Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands Netherlands_Antilles New_Caledonia New_Zealand Nicaragua Niger Nigeria Niue Norfolk_Island Northern_Mariana_Islands Norway Oman Pakistan Palau Palestinian_Territory // Palestinian Territory, Occupied Panama Papua_New_Guinea Paraguay Peru Philippines Pitcairn Poland Portugal Puerto_Rico Qatar Réunion Romania Russian_Federation Rwanda Saint_Barthélemy Saint_Helena Saint_Kitts_and_Nevis Saint_Lucia Saint_Martin // Saint-Martin (French part) Saint_Pierre_and_Miquelon Saint_Vincent_and_Grenadines Samoa San_Marino Sao_Tome_and_Principe Saudi_Arabia Senegal Serbia Seychelles Sierra_Leone Singapore Slovakia Slovenia Solomon_Islands Somalia South_Africa South_Georgia_and_the_South_Sandwich_Islands South_Sudan Spain Sri_Lanka Sudan Suriname Svalbard_and_Jan_Mayen_Islands Swaziland // Eswatini Sweden Switzerland Syria // Syrian Arab Republic Taiwan // Taiwan, Republic of China Tajikistan Tanzania // United Republic of Tanzania Thailand Timor_Leste Togo Tokelau Tonga Trinidad_and_Tobago Tunisia Turkey Turkmenistan Turks_and_Caicos_Islands Tuvalu Uganda Ukraine United_Arab_Emirates United_Kingdom United_States_of_America United_States_Minor_Outlying_Islands Uruguay Uzbekistan Vanuatu Venezuela // Bolivarian Republic of Venezuela Viet_Nam Virgin_Islands Wallis_and_Futuna_Islands Western_Sahara Yemen Zambia Zimbabwe )
func AsCountry ¶ added in v2.5.0
AsCountry parses a string to find the corresponding Country, accepting either one of the string values or a number. The input representation is determined by countryMarshalTextRep. It wraps Parse. The input case does not matter.
func CountryOf ¶ added in v2.5.0
CountryOf returns a Country based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid Country is returned.
func MustParseCountry ¶ added in v2.7.0
MustParseCountry is similar to AsCountry except that it panics on error. The input case does not matter.
func (Country) Int ¶ added in v2.5.0
Int returns the int value, which is not necessarily the same as the ordinal. This facilitates polymorphism (see enum.IntEnum).
func (Country) IsValid ¶ added in v2.5.0
IsValid determines whether a Country is one of the defined constants.
func (Country) MarshalJSON ¶ added in v2.5.0
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to countryMarshalTextRep.
func (Country) MarshalText ¶ added in v2.5.0
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to countryMarshalTextRep.
func (Country) Ordinal ¶ added in v2.5.0
Ordinal returns the ordinal number of a Country. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*Country) Parse ¶ added in v2.5.0
Parse parses a string to find the corresponding Country, accepting one of the string values or a number. The input representation is determined by countryMarshalTextRep. It is used by AsCountry. The input case does not matter.
Usage Example
v := new(Country) err := v.Parse(s) ... etc
func (*Country) Scan ¶ added in v2.5.0
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (Country) String ¶ added in v2.5.0
String returns the literal string representation of a Country, which is the same as the const identifier but without prefix or suffix.
func (Country) Tag ¶ added in v2.5.0
Tag returns the string representation of a Country. For invalid values, this returns v.String() (see IsValid).
func (*Country) UnmarshalJSON ¶ added in v2.5.0
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*Country) UnmarshalText ¶ added in v2.5.0
UnmarshalText converts transmitted values to ordinary values.
type Day ¶
type Day uint
const ( Sunday Day Monday Tuesday Wednesday )
It is allowable to break the constant blocks (although it's a bit unnecessary here). However, the numeric values *must* all be distinct, otherwise the generated enum will not compile.
func AsDay ¶
AsDay parses a string to find the corresponding Day, accepting either one of the string values or a number. The input representation is determined by dayMarshalTextRep. It wraps Parse.
func DayOf ¶
DayOf returns a Day based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid Day is returned.
func MustParseDay ¶ added in v2.7.0
MustParseDay is similar to AsDay except that it panics on error.
func (Day) Int ¶
Int returns the int value, which is not necessarily the same as the ordinal. This facilitates polymorphism (see enum.IntEnum).
func (Day) MarshalJSON ¶
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to dayMarshalTextRep.
func (Day) MarshalText ¶
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to dayMarshalTextRep.
func (Day) Ordinal ¶
Ordinal returns the ordinal number of a Day. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*Day) Parse ¶
Parse parses a string to find the corresponding Day, accepting one of the string values or a number. The input representation is determined by dayMarshalTextRep. It is used by AsDay.
Usage Example
v := new(Day) err := v.Parse(s) ... etc
func (*Day) Scan ¶
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (Day) String ¶
String returns the literal string representation of a Day, which is the same as the const identifier but without prefix or suffix.
func (*Day) UnmarshalJSON ¶
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*Day) UnmarshalText ¶
UnmarshalText converts transmitted values to ordinary values.
type GreekAlphabet ¶ added in v2.1.0
type GreekAlphabet int
const ( Αλφα GreekAlphabet = iota + 1 // U0391 = Α Βήτα Γάμμα Δέλτα Εψιλον Ζήτα // U0396 Ητα Θήτα Ιώτα Κάππα Λάμβδα // U039b Μυ Νυ Ξι Ομικρον Πι // U03A0 Ρώ // there is no U03A2 Σίγμα // U03a3 Ταυ Υψιλον Φι Χι // U03a7 Ψι Ωμέγα )
func AsGreekAlphabet ¶ added in v2.1.0
func AsGreekAlphabet(s string) (GreekAlphabet, error)
AsGreekAlphabet parses a string to find the corresponding GreekAlphabet, accepting either one of the string values or a number. The input representation is determined by greekalphabetMarshalTextRep. It wraps Parse.
func GreekAlphabetOf ¶ added in v2.1.0
func GreekAlphabetOf(v int) GreekAlphabet
GreekAlphabetOf returns a GreekAlphabet based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid GreekAlphabet is returned.
func MustParseGreekAlphabet ¶ added in v2.7.0
func MustParseGreekAlphabet(s string) GreekAlphabet
MustParseGreekAlphabet is similar to AsGreekAlphabet except that it panics on error.
func (GreekAlphabet) Int ¶ added in v2.1.0
func (v GreekAlphabet) Int() int
Int returns the int value, which is not necessarily the same as the ordinal. This facilitates polymorphism (see enum.IntEnum).
func (GreekAlphabet) IsValid ¶ added in v2.1.0
func (v GreekAlphabet) IsValid() bool
IsValid determines whether a GreekAlphabet is one of the defined constants.
func (GreekAlphabet) MarshalJSON ¶ added in v2.1.0
func (v GreekAlphabet) MarshalJSON() ([]byte, error)
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to greekalphabetMarshalTextRep.
func (GreekAlphabet) MarshalText ¶ added in v2.1.0
func (v GreekAlphabet) MarshalText() (text []byte, err error)
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to greekalphabetMarshalTextRep.
func (GreekAlphabet) Ordinal ¶ added in v2.1.0
func (v GreekAlphabet) Ordinal() int
Ordinal returns the ordinal number of a GreekAlphabet. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*GreekAlphabet) Parse ¶ added in v2.1.0
func (v *GreekAlphabet) Parse(s string) error
Parse parses a string to find the corresponding GreekAlphabet, accepting one of the string values or a number. The input representation is determined by greekalphabetMarshalTextRep. It is used by AsGreekAlphabet.
Usage Example
v := new(GreekAlphabet) err := v.Parse(s) ... etc
func (*GreekAlphabet) Scan ¶ added in v2.1.0
func (v *GreekAlphabet) Scan(value interface{}) error
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (GreekAlphabet) String ¶ added in v2.1.0
func (v GreekAlphabet) String() string
String returns the literal string representation of a GreekAlphabet, which is the same as the const identifier but without prefix or suffix.
func (GreekAlphabet) Tag ¶ added in v2.1.0
func (v GreekAlphabet) Tag() string
Tag returns the string representation of a GreekAlphabet. For invalid values, this returns v.String() (see IsValid).
func (*GreekAlphabet) UnmarshalJSON ¶ added in v2.1.0
func (v *GreekAlphabet) UnmarshalJSON(text []byte) error
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*GreekAlphabet) UnmarshalText ¶ added in v2.1.0
func (v *GreekAlphabet) UnmarshalText(text []byte) error
UnmarshalText converts transmitted values to ordinary values.
func (GreekAlphabet) Value ¶ added in v2.1.0
func (v GreekAlphabet) Value() (driver.Value, error)
Value converts the GreekAlphabet to a string. It implements driver.Valuer, https://golang.org/pkg/database/sql/driver/#Valuer
type Method ¶
type Method uint
func AsMethod ¶
AsMethod parses a string to find the corresponding Method, accepting either one of the string values or a number. The input representation is determined by methodMarshalTextRep. It wraps Parse. The input case does not matter.
func MethodOf ¶
MethodOf returns a Method based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid Method is returned.
func MustParseMethod ¶ added in v2.7.0
MustParseMethod is similar to AsMethod except that it panics on error. The input case does not matter.
func (Method) Int ¶
Int returns the int value, which is not necessarily the same as the ordinal. This facilitates polymorphism (see enum.IntEnum).
func (Method) MarshalJSON ¶
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to methodMarshalTextRep.
func (Method) MarshalText ¶
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to methodMarshalTextRep.
func (Method) Ordinal ¶
Ordinal returns the ordinal number of a Method. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*Method) Parse ¶
Parse parses a string to find the corresponding Method, accepting one of the string values or a number. The input representation is determined by methodMarshalTextRep. It is used by AsMethod. The input case does not matter.
Usage Example
v := new(Method) err := v.Parse(s) ... etc
func (*Method) Scan ¶
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (Method) String ¶
String returns the literal string representation of a Method, which is the same as the const identifier but without prefix or suffix.
func (Method) Tag ¶
Tag returns the string representation of a Method. For invalid values, this returns v.String() (see IsValid).
func (*Method) UnmarshalJSON ¶
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*Method) UnmarshalText ¶
UnmarshalText converts transmitted values to ordinary values.
type Month ¶
type Month uint
func AsMonth ¶
AsMonth parses a string to find the corresponding Month, accepting either one of the string values or a number. The input representation is determined by monthMarshalTextRep. It wraps Parse. The input case does not matter.
func MonthOf ¶
MonthOf returns a Month based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid Month is returned.
func MustParseMonth ¶ added in v2.7.0
MustParseMonth is similar to AsMonth except that it panics on error. The input case does not matter.
func (Month) Int ¶
Int returns the int value, which is not necessarily the same as the ordinal. This facilitates polymorphism (see enum.IntEnum).
func (Month) MarshalJSON ¶
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to monthMarshalTextRep.
func (Month) MarshalText ¶
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to monthMarshalTextRep.
func (Month) Ordinal ¶
Ordinal returns the ordinal number of a Month. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*Month) Parse ¶
Parse parses a string to find the corresponding Month, accepting one of the string values or a number. The input representation is determined by monthMarshalTextRep. It is used by AsMonth. The input case does not matter.
Usage Example
v := new(Month) err := v.Parse(s) ... etc
func (*Month) Scan ¶
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (Month) String ¶
String returns the literal string representation of a Month, which is the same as the const identifier but without prefix or suffix.
func (*Month) UnmarshalJSON ¶
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*Month) UnmarshalText ¶
UnmarshalText converts transmitted values to ordinary values.
type Pet ¶
type Pet uint16
These all have prefix "My", which is stripped from the String representation.
func AsPet ¶
AsPet parses a string to find the corresponding Pet, accepting either one of the string values or a number. The input representation is determined by petMarshalTextRep. It wraps Parse.
func MustParsePet ¶ added in v2.7.0
MustParsePet is similar to AsPet except that it panics on error.
func PetOf ¶
PetOf returns a Pet based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid Pet is returned.
func (Pet) Int ¶
Int returns the int value, which is not necessarily the same as the ordinal. This facilitates polymorphism (see enum.IntEnum).
func (Pet) MarshalJSON ¶
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to petMarshalTextRep.
func (Pet) MarshalText ¶
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to petMarshalTextRep.
func (Pet) Ordinal ¶
Ordinal returns the ordinal number of a Pet. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*Pet) Parse ¶
Parse parses a string to find the corresponding Pet, accepting one of the string values or a number. The input representation is determined by petMarshalTextRep. It is used by AsPet.
Usage Example
v := new(Pet) err := v.Parse(s) ... etc
func (*Pet) Scan ¶
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (Pet) String ¶
String returns the literal string representation of a Pet, which is the same as the const identifier but without prefix or suffix.
func (Pet) Tag ¶
Tag returns the string representation of a Pet. For invalid values, this returns v.String() (see IsValid).
func (*Pet) UnmarshalJSON ¶
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*Pet) UnmarshalText ¶
UnmarshalText converts transmitted values to ordinary values.
type SalesChannel ¶ added in v2.9.0
type SalesChannel int
const ( OnlineSales SalesChannel // json:"webshop" sql:"o" -- String() is "online" InstoreSales // json:"store" sql:"s" -- String() is "instore" TelephoneSales // json:"phone" sql:"t" -- String() is "telephone" )
func AsSalesChannel ¶ added in v2.9.0
func AsSalesChannel(s string) (SalesChannel, error)
AsSalesChannel parses a string to find the corresponding SalesChannel, accepting either one of the string values or a number. The input representation is determined by saleschannelMarshalTextRep. It wraps Parse.
func MustParseSalesChannel ¶ added in v2.9.0
func MustParseSalesChannel(s string) SalesChannel
MustParseSalesChannel is similar to AsSalesChannel except that it panics on error.
func SalesChannelOf ¶ added in v2.9.0
func SalesChannelOf(v int) SalesChannel
SalesChannelOf returns a SalesChannel based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid SalesChannel is returned.
func (SalesChannel) Int ¶ added in v2.9.0
func (v SalesChannel) Int() int
Int returns the int value, which is not necessarily the same as the ordinal. This facilitates polymorphism (see enum.IntEnum).
func (SalesChannel) IsValid ¶ added in v2.9.0
func (v SalesChannel) IsValid() bool
IsValid determines whether a SalesChannel is one of the defined constants.
func (SalesChannel) MarshalJSON ¶ added in v2.9.0
func (v SalesChannel) MarshalJSON() ([]byte, error)
MarshalJSON converts values to bytes suitable for transmission via JSON. The representation is chosen according to saleschannelMarshalTextRep.
func (SalesChannel) MarshalText ¶ added in v2.9.0
func (v SalesChannel) MarshalText() (text []byte, err error)
MarshalText converts values to a form suitable for transmission via XML etc. The representation is chosen according to saleschannelMarshalTextRep.
func (SalesChannel) Ordinal ¶ added in v2.9.0
func (v SalesChannel) Ordinal() int
Ordinal returns the ordinal number of a SalesChannel. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*SalesChannel) Parse ¶ added in v2.9.0
func (v *SalesChannel) Parse(s string) error
Parse parses a string to find the corresponding SalesChannel, accepting one of the string values or a number. The input representation is determined by saleschannelMarshalTextRep. It is used by AsSalesChannel.
Usage Example
v := new(SalesChannel) err := v.Parse(s) ... etc
func (*SalesChannel) Scan ¶ added in v2.9.0
func (v *SalesChannel) Scan(value interface{}) error
Scan parses some value, which can be a number, a string or []byte. It implements sql.Scanner, https://golang.org/pkg/database/sql/#Scanner
func (SalesChannel) String ¶ added in v2.9.0
func (v SalesChannel) String() string
String returns the literal string representation of a SalesChannel, which is the same as the const identifier but without prefix or suffix.
func (SalesChannel) Tag ¶ added in v2.9.0
func (v SalesChannel) Tag() string
Tag returns the JSON representation of a SalesChannel.
func (*SalesChannel) UnmarshalJSON ¶ added in v2.9.0
func (v *SalesChannel) UnmarshalJSON(text []byte) error
UnmarshalJSON converts transmitted JSON values to ordinary values. It allows both ordinals and strings to represent the values.
func (*SalesChannel) UnmarshalText ¶ added in v2.9.0
func (v *SalesChannel) UnmarshalText(text []byte) error
UnmarshalText converts transmitted values to ordinary values.
func (SalesChannel) Value ¶ added in v2.9.0
func (v SalesChannel) Value() (driver.Value, error)
Value converts the SalesChannel to a string. It implements driver.Valuer, https://golang.org/pkg/database/sql/driver/#Valuer