OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-kit / kit / examples / shipping / location / location.go
1 // Package location provides the Location aggregate.
2 package location
3
4 import (
5         "errors"
6 )
7
8 // UNLocode is the United Nations location code that uniquely identifies a
9 // particular location.
10 //
11 // http://www.unece.org/cefact/locode/
12 // http://www.unece.org/cefact/locode/DocColumnDescription.htm#LOCODE
13 type UNLocode string
14
15 // Location is a location is our model is stops on a journey, such as cargo
16 // origin or destination, or carrier movement endpoints.
17 type Location struct {
18         UNLocode UNLocode
19         Name     string
20 }
21
22 // ErrUnknown is used when a location could not be found.
23 var ErrUnknown = errors.New("unknown location")
24
25 // Repository provides access a location store.
26 type Repository interface {
27         Find(locode UNLocode) (*Location, error)
28         FindAll() []*Location
29 }