locode

package
v0.38.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidString = errors.New("invalid string format in UN/Locode")

ErrInvalidString is the error of incorrect string format of the LOCODE.

Functions

This section is empty.

Types

type LOCODE

type LOCODE [2]string

LOCODE represents code from UN/LOCODE coding scheme.

func FromString

func FromString(s string) (*LOCODE, error)

FromString parses string and returns LOCODE.

If string has incorrect format, ErrInvalidString returns.

func (*LOCODE) CountryCode

func (l *LOCODE) CountryCode() string

CountryCode returns a string representation of country code.

func (*LOCODE) LocationCode

func (l *LOCODE) LocationCode() string

LocationCode returns a string representation of location code.

type Record

type Record struct {
	// Change Indicator.
	Ch string

	// Combination of a 2-character country code and a 3-character location code.
	LOCODE LOCODE

	// Name of the locations which has been allocated a UN/LOCODE.
	Name string

	// Names of the locations which have been allocated a UN/LOCODE without diacritic signs.
	NameWoDiacritics string

	// ISO 1-3 character alphabetic and/or numeric code for the administrative division of the country concerned.
	SubDiv string

	// 8-digit function classifier code for the location.
	Function string

	// Status of the entry by a 2-character code.
	Status string

	// Last date when the location was updated/entered.
	Date string

	// The IATA code for the location if different from location code in column LOCODE.
	IATA string

	// Geographical coordinates (latitude/longitude) of the location, if there is any.
	Coordinates string

	// Some general remarks regarding the UN/LOCODE in question.
	Remarks string
}

Record represents a single record of the UN/LOCODE table.

Directories

Path Synopsis
db
table
csv

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL