George Bartolomey
9c2c76ca32
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 4m47s
DCO action / DCO (pull_request) Successful in 4m40s
Build / Build Components (1.21) (pull_request) Successful in 7m27s
Tests and linters / Staticcheck (pull_request) Successful in 8m22s
Tests and linters / gopls check (pull_request) Successful in 10m56s
Build / Build Components (1.22) (pull_request) Successful in 11m48s
Tests and linters / Tests (1.22) (pull_request) Successful in 16m11s
Tests and linters / Lint (pull_request) Successful in 16m27s
Pre-commit hooks / Pre-commit (pull_request) Successful in 19m12s
Tests and linters / Tests (1.21) (pull_request) Successful in 20m31s
Tests and linters / Tests with -race (pull_request) Successful in 8m56s
Removed pkg/util/locode package, added git.frostfs.info/TrueCloudLab/frostfs-locode-db/pkg/locode dependency. Signed-off-by: George Bartolomey <george@bh4.ru>
59 lines
1.4 KiB
Go
59 lines
1.4 KiB
Go
package locode
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-locode-db/pkg/locode"
|
|
locodedb "git.frostfs.info/TrueCloudLab/frostfs-locode-db/pkg/locode/db"
|
|
)
|
|
|
|
// Record is an interface of read-only
|
|
// FrostFS LOCODE database single entry.
|
|
type Record interface {
|
|
// Must return ISO 3166-1 alpha-2
|
|
// country code.
|
|
//
|
|
// Must not return nil.
|
|
CountryCode() *locodedb.CountryCode
|
|
|
|
// Must return English short country name
|
|
// officially used by the ISO 3166
|
|
// Maintenance Agency (ISO 3166/MA).
|
|
CountryName() string
|
|
|
|
// Must return UN/LOCODE 3-character code
|
|
// for the location (numerals 2-9 may also
|
|
// be used).
|
|
//
|
|
// Must not return nil.
|
|
LocationCode() *locodedb.LocationCode
|
|
|
|
// Must return name of the location which
|
|
// have been allocated a UN/LOCODE without
|
|
// diacritic sign.
|
|
LocationName() string
|
|
|
|
// Must return ISO 1-3 character alphabetic
|
|
// and/or numeric code for the administrative
|
|
// division of the country concerned.
|
|
SubDivCode() string
|
|
|
|
// Must return subdivision name.
|
|
SubDivName() string
|
|
|
|
// Must return existing continent where is
|
|
// the location.
|
|
//
|
|
// Must not return nil.
|
|
Continent() *locodedb.Continent
|
|
}
|
|
|
|
// DB is an interface of read-only
|
|
// FrostFS LOCODE database.
|
|
type DB interface {
|
|
// Must find the record that corresponds to
|
|
// LOCODE and provides the Record interface.
|
|
//
|
|
// Must return an error if Record is nil.
|
|
//
|
|
// LOCODE is always non-nil.
|
|
Get(*locode.LOCODE) (Record, error)
|
|
}
|