geoCodes

package
v0.0.0-...-0a16625 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConverterMapXml = map[string]func(interface{}) interface{}{
	"country": func(data interface{}) interface{} {
		country := data.(*Country)
		return CountryToXML(*country)
	},
	"currency": func(data interface{}) interface{} {
		currency := data.(*Currency)
		return CurrencyToXML(*currency)
	},
	"geoSet": func(data interface{}) interface{} {
		geoSet := data.(*GeoSet)
		return GeoSetToXML(*geoSet)
	},
}
View Source
var CountrySettings = SettingsType{
	PrimaryKey: "Alpha2",
	Indexes: []string{
		"Name",
		"FullName",
		"Alpha2",
		"Alpha3",
		"UnM49",
	},
	Public: []string{
		"Name",
		"FullName",
		"OfficialName",
		"Alpha2",
		"Alpha3",
		"UnM49",
		"Flags",
		"Flags.Svg",
		"Dependency",
		"Mottos",
		"Mottos.Official",
		"Currencies",
		"Currencies.LegalTenders",
		"Currencies.WidelyAccepted",
		"DialCodes",
		"DialCodes.Main",
		"DialCodes.Exceptions",
		"CcTld",
		"TimeZones",
		"Languages",
		"Locales",
		"OtherAppsIds",
		"OtherAppsIds.GeoNamesOrg",
	},
}
View Source
var CurrencySettings = SettingsType{
	PrimaryKey: "IsoAlpha",
	Indexes: []string{
		"Name",
		"IsoAlpha",
		"IsoNumber",
	},
	Public: []string{
		"Name",
		"IsoAlpha",
		"IsoNumber",
		"Symbol",
		"Decimal",
	},
}
View Source
var GeoSetSettings = SettingsType{
	PrimaryKey: "InternalCode",
	Indexes: []string{
		"Name",
		"InternalCode",
	},
	Public: []string{
		"Name",
		"InternalCode",
		"UnM49",
		"Tags",
		"CountryCodes",
	},
}
View Source
var SettingsMap = map[string]interface{}{
	"countries":  CountrySettings,
	"geoSets":    GeoSetSettings,
	"currencies": CurrencySettings,
}
View Source
var SingleItemName = map[string]string{
	"countries":  "country",
	"geoSets":    "geoSet",
	"currencies": "currency",
}
View Source
var TransSettingsMap = map[string]interface{}{
	"countries":  TransCountry{},
	"geoSets":    TransGenericItem{},
	"currencies": TransGenericItem{},
}
View Source
var TypeMap = map[string]func() interface{}{
	"countries":  func() interface{} { return &Countries{} },
	"country":    func() interface{} { return &Country{} },
	"currencies": func() interface{} { return &Currencies{} },
	"currency":   func() interface{} { return &Currency{} },
	"geoSets":    func() interface{} { return &GeoSets{} },
	"geoSet":     func() interface{} { return &GeoSet{} },
}
View Source
var TypeMapXml = map[string]func() interface{}{
	"countries":  func() interface{} { return &CountriesXml{} },
	"currencies": func() interface{} { return &CurrenciesXml{} },
	"geoSets":    func() interface{} { return &GeoSetsXml{} },
}

Functions

This section is empty.

Types

type CDATA

type CDATA struct {
	Value string `xml:",cdata"`
}

type CcCurrencies

type CcCurrencies struct {
	LegalTenders   []string `json:"legalTenders" yaml:"legalTenders" xml:"legalTenders>currency"`
	WidelyAccepted []string `json:"widelyAccepted" yaml:"widelyAccepted" xml:"widelyAccepted>currency"`
}

type Config

type Config struct {
	Settings Settings `json:"settings"`
}

type ConfigLanguages

type ConfigLanguages struct {
	InPackage map[string]string `json:"inPackage"`
	Default   string            `json:"default"`
}

type Countries

type Countries []Country

type CountriesXml

type CountriesXml struct {
	XMLName   xml.Name     `xml:"countries"`
	Countries []CountryXml `xml:"country"`
}

type Country

type Country struct {
	Name         string            `json:"name" yaml:"name" xml:"name"`
	FullName     string            `json:"fullName" yaml:"fullName" xml:"fullName"`
	OfficialName map[string]string `json:"officialName" yaml:"officialName" xml:"officialName>name"`
	Alpha2       string            `json:"alpha2" yaml:"alpha2" xml:"alpha2"`
	Alpha3       string            `json:"alpha3" yaml:"alpha3" xml:"alpha3"`
	UnM49        string            `json:"unM49" yaml:"unM49" xml:"unM49"`
	Flags        Flags             `json:"flags" yaml:"flags" xml:"flags"`
	Dependency   *string           `json:"dependency" yaml:"dependency" xml:"dependency"`
	Mottos       Mottos            `json:"mottos" yaml:"mottos" xml:"mottos"`
	Currencies   CcCurrencies      `json:"currencies" yaml:"currencies" xml:"currencies"`
	DialCodes    DialCodes         `json:"dialCodes" yaml:"dialCodes" xml:"dialCodes"`
	CcTld        *string           `json:"ccTld" yaml:"ccTld" xml:"ccTld"`
	TimeZones    []string          `json:"timeZones" yaml:"timeZones" xml:"timeZones>tz"`
	Languages    []string          `json:"languages" yaml:"languages" xml:"languages>lang"`
	Locales      []string          `json:"locales" yaml:"locales" xml:"locales>locale"`
	OtherAppsIds OtherAppsIds      `json:"otherAppsIds" yaml:"otherAppsIds" xml:"otherAppsIds"`
	Keywords     []string          `json:"keywords" yaml:"keywords" xml:"keywords"`
}

type CountryXml

type CountryXml struct {
	XMLName xml.Name `xml:"country"`
	Index   string   `xml:"index,attr,omitempty"`
	Country
	OfficialName []LangStructXml `xml:"officialName>name"`
	Mottos       MottosXml       `xml:"mottos"`
	Flags        FlagsXml        `xml:"flags"`
}

func CountryToXML

func CountryToXML(country Country) CountryXml

type Currencies

type Currencies []Currency

type CurrenciesXml

type CurrenciesXml struct {
	XMLName    xml.Name      `xml:"currencies"`
	Currencies []CurrencyXml `xml:"currency"`
}

type Currency

type Currency struct {
	Name      string  `json:"name" yaml:"name" xml:"name"`
	IsoAlpha  string  `json:"isoAlpha" yaml:"isoAlpha" xml:"isoAlpha"`
	IsoNumber string  `json:"isoNumber" yaml:"isoNumber" xml:"isoNumber"`
	Symbol    *string `json:"symbol" yaml:"symbol" xml:"symbol,omitempty"`
	Decimal   *int64  `json:"decimal" yaml:"decimal" xml:"decimal,omitempty"`
}

type CurrencyXml

type CurrencyXml struct {
	XMLName xml.Name `xml:"currency"`
	Index   string   `xml:"index,attr,omitempty"`
	Currency
}

func CurrencyToXML

func CurrencyToXML(currency Currency) CurrencyXml

type DialCodes

type DialCodes struct {
	Main       []string `json:"main" yaml:"main" xml:"main>code"`
	Exceptions []string `json:"exceptions" yaml:"exceptions" xml:"exceptions>code"`
}

type Enquiries

type Enquiries struct {
	Index    *string
	Select   []string
	OrderBy  OrderByStruct
	Interval IntervalStruct
}

type Flags

type Flags struct {
	Svg string `json:"svg" yaml:"svg" xml:"svg"`
}

type FlagsXml

type FlagsXml struct {
	Svg CDATA `xml:"svg"`
}

type GeoCode

type GeoCode struct {
	SetType      string
	SetLocale    string
	SetObject    map[string]interface{}
	SetEnquiries Enquiries
}

type GeoCodeReference

type GeoCodeReference string

type GeoCodeResult

type GeoCodeResult interface{}

type GeoSet

type GeoSet struct {
	Name         string   `json:"name" yaml:"name" xml:"name"`
	InternalCode string   `json:"internalCode" yaml:"internalCode" xml:"internalCode"`
	UnM49        *string  `json:"unM49" yaml:"unM49" xml:"unM49"`
	Tags         []string `json:"tags" yaml:"tags" xml:"tags>tag"`
	CountryCodes []string `json:"countryCodes" yaml:"countryCodes" xml:"countryCodes>cc"`
}

type GeoSetXml

type GeoSetXml struct {
	XMLName xml.Name `xml:"geoSet"`
	Index   string   `xml:"index,attr,omitempty"`
	GeoSet
}

func GeoSetToXML

func GeoSetToXML(geoSet GeoSet) GeoSetXml

type GeoSets

type GeoSets []GeoSet

type GeoSetsXml

type GeoSetsXml struct {
	XMLName xml.Name    `xml:"geoSets"`
	GeoSets []GeoSetXml `xml:"geoSet"`
}

type IntervalStruct

type IntervalStruct struct {
	Offset int
	Limit  int
}

type LangStructXml

type LangStructXml struct {
	Lang  string `xml:"lang,attr"`
	Value string `xml:",chardata"`
}

type Mottos

type Mottos struct {
	Official map[string]string `json:"official" yaml:"official" xml:"official"`
}

type MottosXml

type MottosXml struct {
	Official []LangStructXml `json:"official" yaml:"official" xml:"official>motto"`
}

type OrderByStruct

type OrderByStruct struct {
	Property  string
	OrderType string
}

type OtherAppsIds

type OtherAppsIds struct {
	GeoNamesOrg *int64 `json:"geoNamesOrg" yaml:"geoNamesOrg" xml:"geoNamesOrg"`
}

type Settings

type Settings struct {
	Languages ConfigLanguages `json:"languages"`
}

type SettingsType

type SettingsType struct {
	PrimaryKey string
	Indexes    []string
	Public     []string
}

type TransCountries

type TransCountries map[string]TransCountry

type TransCountry

type TransCountry struct {
	Keywords []string `json:"keywords"`
	Name     string   `json:"name"`
	FullName string   `json:"fullName"`
	Demonyms []string `json:"demonyms"`
}

type TransGeneric

type TransGeneric map[string]TransGenericItem

type TransGenericItem

type TransGenericItem struct {
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL