Documentation ¶
Index ¶
- Variables
- func FormatAddress(address *Params, latin bool) (string, error)
- func GetFieldOrder(address *Params, latin bool) ([][]string, error)
- func LoadValidationData(countryCode string) (io.Reader, error)
- func RegexesToStrings(in []*regexp.Regexp) []string
- type ErrorMap
- type InvalidCodeErr
- type Params
- type ValidationRules
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func LoadValidationData ¶
LoadValidationData
func RegexesToStrings ¶
Types ¶
type InvalidCodeErr ¶
type InvalidCodeErr struct {
// contains filtered or unexported fields
}
InvalidCodeErr indicate given country code is invalid
func (*InvalidCodeErr) Error ¶
func (i *InvalidCodeErr) Error() string
type Params ¶
type Params struct { CountryArea string CountryCode string City string CityArea string PostalCode string StreetAddress string SortingCode string }
func NormalizeAddress ¶
func (*Params) GetProperty ¶
type ValidationRules ¶
type ValidationRules struct { CountryCode string CountryName string AddressFormat string AddressLatinFormat string AllowedFields []string RequiredFields []string UpperFields []string CountryAreaType string CountryAreaChoices [][2]string CityType string CityChoices [][2]string CityAreaType string CityAreaChoices [][2]string PostalCodeType string PostalCodeMatchers []*regexp.Regexp PostalCodeExamples []string PostalCodePrefix string }
func GetValidationRules ¶
func GetValidationRules(address *Params) (*ValidationRules, error)
GetValidationRules get validation rules for given params.
there are 3 error types might be returned:
nil, *InvalidCodeErr, json (encoding/decoding) error
func (*ValidationRules) String ¶
func (v *ValidationRules) String() string
Click to show internal directories.
Click to hide internal directories.