diff --git a/cmd/neofs-cli/modules/util.go b/cmd/neofs-cli/modules/util.go index 75b403bb..9d9de245 100644 --- a/cmd/neofs-cli/modules/util.go +++ b/cmd/neofs-cli/modules/util.go @@ -164,7 +164,7 @@ var ( } fmt.Printf("Country: %s\n", record.CountryName()) - fmt.Printf("City: %s\n", record.CityName()) + fmt.Printf("Location: %s\n", record.LocationName()) fmt.Printf("Continent: %s\n", record.Continent()) if subDivCode := record.SubDivCode(); subDivCode != "" { fmt.Printf("Subdivision: [%s] %s\n", subDivCode, record.SubDivName()) diff --git a/pkg/innerring/locode.go b/pkg/innerring/locode.go index 40e6ab41..01720f98 100644 --- a/pkg/innerring/locode.go +++ b/pkg/innerring/locode.go @@ -30,7 +30,7 @@ type locodeBoltEntryWrapper struct { } func (l *locodeBoltEntryWrapper) LocationName() string { - return l.Record.CityName() + return l.Record.LocationName() } type locodeBoltDBWrapper locodebolt.DB diff --git a/pkg/util/locode/db/boltdb/calls.go b/pkg/util/locode/db/boltdb/calls.go index f260da8c..2e88a933 100644 --- a/pkg/util/locode/db/boltdb/calls.go +++ b/pkg/util/locode/db/boltdb/calls.go @@ -48,26 +48,26 @@ func locationBucketKey(lc *locodedb.LocationCode) ([]byte, error) { } type recordJSON struct { - CountryName string - CityName string - SubDivName string - SubDivCode string - Latitude float64 - Longitude float64 - Continent string + CountryName string + LocationName string + SubDivName string + SubDivCode string + Latitude float64 + Longitude float64 + Continent string } func recordValue(r locodedb.Record) ([]byte, error) { p := r.GeoPoint() rj := &recordJSON{ - CountryName: r.CountryName(), - CityName: r.CityName(), - SubDivName: r.SubDivName(), - SubDivCode: r.SubDivCode(), - Latitude: p.Latitude(), - Longitude: p.Longitude(), - Continent: r.Continent().String(), + CountryName: r.CountryName(), + LocationName: r.LocationName(), + SubDivName: r.SubDivName(), + SubDivCode: r.SubDivCode(), + Latitude: p.Latitude(), + Longitude: p.Longitude(), + Continent: r.Continent().String(), } return json.Marshal(rj) @@ -82,7 +82,7 @@ func recordFromValue(data []byte) (*locodedb.Record, error) { r := new(locodedb.Record) r.SetCountryName(rj.CountryName) - r.SetCityName(rj.CityName) + r.SetLocationName(rj.LocationName) r.SetSubDivName(rj.SubDivName) r.SetSubDivCode(rj.SubDivCode) r.SetGeoPoint(locodedb.NewPoint(rj.Latitude, rj.Longitude)) diff --git a/pkg/util/locode/db/record.go b/pkg/util/locode/db/record.go index 6fb9dea8..eea167a8 100644 --- a/pkg/util/locode/db/record.go +++ b/pkg/util/locode/db/record.go @@ -45,7 +45,7 @@ func (k *Key) LocationCode() *LocationCode { type Record struct { countryName string - cityName string + locationName string subDivName string @@ -71,9 +71,9 @@ func NewRecord(r locode.Record) (*Record, error) { } return &Record{ - cityName: r.NameWoDiacritics, - subDivCode: r.SubDiv, - p: point, + locationName: r.NameWoDiacritics, + subDivCode: r.SubDiv, + p: point, }, nil } @@ -87,14 +87,14 @@ func (r *Record) SetCountryName(name string) { r.countryName = name } -// CityName returns city name. -func (r *Record) CityName() string { - return r.cityName +// LocationName returns location name. +func (r *Record) LocationName() string { + return r.locationName } -// SetCityName sets city name. -func (r *Record) SetCityName(name string) { - r.cityName = name +// SetLocationName sets location name. +func (r *Record) SetLocationName(name string) { + r.locationName = name } // SubDivCode returns subdivision code.