location

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2016 License: MIT Imports: 1 Imported by: 0

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