[#1] Fix comments and error messages

Signed-off-by: Stanislav Bogatyrev <s.bogatyrev@yadro.com>
This commit is contained in:
Stanislav Bogatyrev 2023-02-05 18:59:38 +03:00 committed by Stanislav Bogatyrev
parent c761a95eef
commit cb016d53a6
96 changed files with 167 additions and 167 deletions

View file

@ -13,13 +13,13 @@ import (
// Passing incorrect parameter values will result in constructor
// failure (error or panic depending on the implementation).
type Prm struct {
// Path to BoltDB file with NeoFS location database.
// Path to BoltDB file with FrostFS location database.
//
// Must not be empty.
Path string
}
// DB is a descriptor of the NeoFS BoltDB location database.
// DB is a descriptor of the FrostFS BoltDB location database.
//
// For correct operation, DB must be created
// using the constructor (New) based on the required parameters

View file

@ -7,7 +7,7 @@ import (
)
// CountryCode represents a country code for
// the storage in the NeoFS location database.
// the storage in the FrostFS location database.
type CountryCode locodecolumn.CountryCode
// CountryCodeFromString parses a string UN/LOCODE country code

View file

@ -16,7 +16,7 @@ type SourceTable interface {
IterateAll(func(locode.Record) error) error
}
// DB is an interface of NeoFS location database.
// DB is an interface of FrostFS location database.
type DB interface {
// Must save the record by key in the database.
Put(Key, Record) error
@ -25,7 +25,7 @@ type DB interface {
Get(Key) (*Record, error)
}
// AirportRecord represents the entry in NeoFS airport database.
// AirportRecord represents the entry in FrostFS airport database.
type AirportRecord struct {
// Name of the country where airport is located.
CountryName string
@ -38,7 +38,7 @@ type AirportRecord struct {
// when the required airport is not found.
var ErrAirportNotFound = errors.New("airport not found")
// AirportDB is an interface of NeoFS airport database.
// AirportDB is an interface of FrostFS airport database.
type AirportDB interface {
// Must return the record by UN/LOCODE table record.
//
@ -47,7 +47,7 @@ type AirportDB interface {
Get(locode.Record) (*AirportRecord, error)
}
// ContinentsDB is an interface of NeoFS continent database.
// ContinentsDB is an interface of FrostFS continent database.
type ContinentsDB interface {
// Must return continent of the geo point.
PointContinent(*Point) (*Continent, error)
@ -57,7 +57,7 @@ var ErrSubDivNotFound = errors.New("subdivision not found")
var ErrCountryNotFound = errors.New("country not found")
// NamesDB is an interface of the NeoFS location namespace.
// NamesDB is an interface of the FrostFS location namespace.
type NamesDB interface {
// Must resolve a country code to a country name.
//
@ -73,7 +73,7 @@ type NamesDB interface {
SubDivName(*CountryCode, string) (string, error)
}
// FillDatabase generates the NeoFS location database based on the UN/LOCODE table.
// FillDatabase generates the FrostFS location database based on the UN/LOCODE table.
func FillDatabase(table SourceTable, airports AirportDB, continents ContinentsDB, names NamesDB, db DB) error {
return table.IterateAll(func(tableRecord locode.Record) error {
if tableRecord.LOCODE.LocationCode() == "" {
@ -152,7 +152,7 @@ func FillDatabase(table SourceTable, airports AirportDB, continents ContinentsDB
})
}
// LocodeRecord returns the record from the NeoFS location database
// LocodeRecord returns the record from the FrostFS location database
// corresponding to the string representation of UN/LOCODE.
func LocodeRecord(db DB, sLocode string) (*Record, error) {
lc, err := locode.FromString(sLocode)

View file

@ -7,7 +7,7 @@ import (
)
// LocationCode represents a location code for
// the storage in the NeoFS location database.
// the storage in the FrostFS location database.
type LocationCode locodecolumn.LocationCode
// LocationCodeFromString parses a string UN/LOCODE location code

View file

@ -8,7 +8,7 @@ import (
locodecolumn "github.com/TrueCloudLab/frostfs-node/pkg/util/locode/column"
)
// Key represents the key in NeoFS location database.
// Key represents the key in FrostFS location database.
type Key struct {
cc *CountryCode
@ -43,7 +43,7 @@ func (k *Key) LocationCode() *LocationCode {
return k.lc
}
// Record represents the entry in NeoFS location database.
// Record represents the entry in FrostFS location database.
type Record struct {
countryName string