Documentation ¶
Index ¶
- func CacheFlags(countries []Country, cacheDir string, dimensions FlagDimensions, ...) error
- func FormatCurrencies(currencies map[string]CurrencyInfo) string
- func FormatFlagFileName(countryName string) string
- func FormatInt(number int) string
- func FormatLanguages(langs map[string]string) string
- func FormatLatLng(latlng []float32) string
- func FormatTz(tzs []string) string
- func ReadFlag(fileName string, cacheDir string) (string, error)
- func SaveData(data []Country, cacheDir string, fileName string) error
- type CacheDir
- type Config
- type Country
- func ExactMatch(countries []Country, exp string) (Country, error)
- func FindByCapital(countries []Country, exp string) (Country, error)
- func FindByName(countries []Country, exp string) (Country, error)
- func FuzzyMatch(countries []Country, exp string) (Country, error)
- func GetData(url string, query string) ([]Country, error)
- func Random(countries []Country) Country
- func ReadData(cacheDir string, fileName string) ([]Country, error)
- type CurrencyInfo
- type FlagDimensions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheFlags ¶
func FormatCurrencies ¶
func FormatCurrencies(currencies map[string]CurrencyInfo) string
func FormatFlagFileName ¶
func FormatLanguages ¶
func FormatLatLng ¶
Types ¶
type Config ¶
type Config struct { Url string Query string CacheFile string CacheDir CacheDir Dimensions FlagDimensions }
type Country ¶
type Country struct { Name struct { Common string `json:"common"` Official string `json:"official"` } `json:"name"` // Lord have mercy Currencies map[string]CurrencyInfo `json:"currencies"` Capital []string `json:"capital"` Flag string `json:"flag"` Population int `json:"population"` Languages map[string]string `json:"languages"` Region string `json:"region"` Subregion string `json:"subregion"` Timezones []string `json:"timezones"` Latlng []float32 `json:"latlng"` CapitalInfo struct { Latlng []float32 `json:"latlng"` } `json:"capitalInfo"` Tld []string `json:"tld"` Flags struct { Png string `json:"png"` Svg string `json:"svg"` } `json:"flags"` }
func (Country) FlagAscii ¶
func (c Country) FlagAscii(converter *convert.ImageConverter, options *convert.Options) (string, error)
Generate flag ASCII from remote url image and return it as string
type CurrencyInfo ¶
type FlagDimensions ¶
Click to show internal directories.
Click to hide internal directories.