kit: github.com/go-kit/kit/examples/shipping/location Index | Files

package location

import "github.com/go-kit/kit/examples/shipping/location"

Package location provides the Location aggregate.

Index

Package Files

location.go sample_locations.go

Variables

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.

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

ErrUnknown is used when a location could not be found.

type Location Uses

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 Uses

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

Repository provides access a location store.

type UNLocode Uses

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.

Package location imports 1 packages (graph) and is imported by 28 packages. Updated 2017-02-04. Refresh now. Tools for package owners.