Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeoNames ¶ added in v0.26.1
type GeoNames struct { GeoNameID int `gorm:"column:geoname_id"` LocaleCode string `gorm:"column:locale_code"` ContinentCode string `gorm:"column:continent_code"` ContinentName string `gorm:"column:continent_name"` CountryIsoCode string `gorm:"column:country_iso_code"` CountryName string `gorm:"column:country_name"` Subdivision1IsoCode string `gorm:"column:subdivision_1_iso_code"` Subdivision1Name string `gorm:"column:subdivision_1_name"` Subdivision2IsoCode string `gorm:"column:subdivision_2_iso_code"` Subdivision2Name string `gorm:"column:subdivision_2_name"` CityName string `gorm:"column:city_name"` MetroCode string `gorm:"column:metro_code"` TimeZone string `gorm:"column:time_zone"` IsInEuropeanUnion string `gorm:"column:is_in_european_union"` }
type Geolocation ¶
type Geolocation struct {
// contains filtered or unexported fields
}
func NewGeolocation ¶
func (*Geolocation) GetAllCountries ¶
func (gl *Geolocation) GetAllCountries() ([]Country, error)
GetAllCountries retrieves a list of all countries.
func (*Geolocation) GetCitiesByCountry ¶
func (gl *Geolocation) GetCitiesByCountry(countryISOCode string) ([]City, error)
GetCitiesByCountry retrieves a list of cities in a specific country based on the country's ISO code.
func (*Geolocation) Stop ¶
func (gl *Geolocation) Stop() error
type Record ¶
type Record struct { City struct { GeonameID uint `maxminddb:"geoname_id"` Names struct { En string `maxminddb:"en"` } `maxminddb:"names"` } `maxminddb:"city"` Continent struct { GeonameID uint `maxminddb:"geoname_id"` Code string `maxminddb:"code"` } `maxminddb:"continent"` Country struct { GeonameID uint `maxminddb:"geoname_id"` ISOCode string `maxminddb:"iso_code"` } `maxminddb:"country"` }
type SqliteStore ¶
type SqliteStore struct {
// contains filtered or unexported fields
}
SqliteStore represents a location storage backed by a Sqlite DB.
func NewSqliteStore ¶
func (*SqliteStore) GetAllCountries ¶
func (s *SqliteStore) GetAllCountries() ([]Country, error)
GetAllCountries returns a list of all countries in the store.
func (*SqliteStore) GetCitiesByCountry ¶
func (s *SqliteStore) GetCitiesByCountry(countryISOCode string) ([]City, error)
GetCitiesByCountry retrieves a list of cities from the store based on the given country ISO code.
Click to show internal directories.
Click to hide internal directories.