location

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package location provides the Location aggregate.

Index

Constants

This section is empty.

Variables

View Source
var (
	Stockholm = &Location{SESTO, "Stockholm"}
	Melbourne = &Location{AUMEL, "Melbourne"}
	Hongkong  = &Location{CNHKG, "Hongkong"}
	NewYork   = &Location{USNYC, "New York"}
	Chicago   = &Location{USCHI, "Chicago"}
	Tokyo     = &Location{JNTKO, "Tokyo"}
	Hamburg   = &Location{DEHAM, "Hamburg"}
	Rotterdam = &Location{NLRTM, "Rotterdam"}
	Helsinki  = &Location{FIHEL, "Helsinki"}
)

Sample locations.

View Source
var ErrUnknown = errors.New("unknown location")

ErrUnknown is used when a location could not be found.

Functions

This section is empty.

Types

type Location

type Location struct {
	UNLocode UNLocode
	Name     string
}

Location is a location is our model is stops on a journey, such as cargo origin or destination, or carrier movement endpoints.

type Repository

type Repository interface {
	Find(locode UNLocode) (*Location, error)
	FindAll() []*Location
}

Repository provides access a location store.

type UNLocode

type UNLocode string

UNLocode is the United Nations location code that uniquely identifies a particular location.

http://www.unece.org/cefact/locode/ http://www.unece.org/cefact/locode/DocColumnDescription.htm#LOCODE

var (
	SESTO UNLocode = "SESTO"
	AUMEL UNLocode = "AUMEL"
	CNHKG UNLocode = "CNHKG"
	USNYC UNLocode = "USNYC"
	USCHI UNLocode = "USCHI"
	JNTKO UNLocode = "JNTKO"
	DEHAM UNLocode = "DEHAM"
	NLRTM UNLocode = "NLRTM"
	FIHEL UNLocode = "FIHEL"
)

Sample UN locodes.

Jump to

Keyboard shortcuts

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