Versions in this module Expand all Collapse all v0 v0.5.0 Sep 30, 2024 Changes in this version + const ContinentAfrica + const ContinentAntarctica + const ContinentAsia + const ContinentEurope + const ContinentNorthAmerica + const ContinentOceania + const ContinentSouthAmerica + const ContinentUnknown + var ErrAirportNotFound = errors.New("airport not found") + var ErrCountryNotFound = errors.New("country not found") + var ErrSubDivNotFound = errors.New("subdivision not found") + func FillDatabase(table SourceTable, airports AirportDB, continents ContinentsDB, names NamesDB, ...) error + type AirportDB interface + Get func(locode.Record) (*AirportRecord, error) + type AirportRecord struct + CountryName string + Point *Point + type Continent uint8 + func ContinentFromString(str string) Continent + func (c *Continent) Is(c2 Continent) bool + func (c Continent) String() string + type ContinentsDB interface + PointContinent func(*Point) (*Continent, error) + type CountryCode locodecolumn.CountryCode + func CountryCodeFromString(s string) (*CountryCode, error) + func CountryFromColumn(cc *locodecolumn.CountryCode) (*CountryCode, error) + func (c *CountryCode) String() string + type DB interface + Get func(Key) (*Record, error) + Put func(Key, Record) error + type Key struct + func NewKey(lc locode.LOCODE) (*Key, error) + func (k *Key) CountryCode() *CountryCode + func (k *Key) LocationCode() *LocationCode + type LocationCode locodecolumn.LocationCode + func LocationCodeFromString(s string) (*LocationCode, error) + func LocationFromColumn(cc *locodecolumn.LocationCode) (*LocationCode, error) + func (l *LocationCode) String() string + type NamesDB interface + CountryName func(*CountryCode) (string, error) + SubDivName func(*CountryCode, string) (string, error) + type Point struct + func NewPoint(lat, lng float64) *Point + func PointFromCoordinates(crd *locodecolumn.Coordinates) (*Point, error) + func (p Point) Latitude() float64 + func (p Point) Longitude() float64 + type Record struct + func LocodeRecord(db DB, sLocode string) (*Record, error) + func NewRecord(r locode.Record) (*Record, error) + func (r *Record) Continent() *Continent + func (r *Record) CountryName() string + func (r *Record) GeoPoint() *Point + func (r *Record) LocationName() string + func (r *Record) SetContinent(c *Continent) + func (r *Record) SetCountryName(name string) + func (r *Record) SetGeoPoint(p *Point) + func (r *Record) SetLocationName(name string) + func (r *Record) SetSubDivCode(name string) + func (r *Record) SetSubDivName(name string) + func (r *Record) SubDivCode() string + func (r *Record) SubDivName() string + type SourceTable interface + IterateAll func(func(locode.Record) error) error