Versions in this module Expand all Collapse all v0 v0.2.0 Jul 27, 2016 v0.1.0 Jun 7, 2016 Changes in this version + var ErrUnknown = errors.New("unknown cargo") + type Cargo struct + Delivery Delivery + Itinerary Itinerary + Origin location.UNLocode + RouteSpecification RouteSpecification + TrackingID TrackingID + func New(id TrackingID, rs RouteSpecification) *Cargo + func (c *Cargo) AssignToRoute(itinerary Itinerary) + func (c *Cargo) DeriveDeliveryProgress(history HandlingHistory) + func (c *Cargo) SpecifyNewRoute(rs RouteSpecification) + type Delivery struct + CurrentVoyage voyage.Number + ETA time.Time + IsMisdirected bool + IsUnloadedAtDestination bool + Itinerary Itinerary + LastEvent HandlingEvent + LastKnownLocation location.UNLocode + NextExpectedActivity HandlingActivity + RouteSpecification RouteSpecification + RoutingStatus RoutingStatus + TransportStatus TransportStatus + func DeriveDeliveryFrom(rs RouteSpecification, itinerary Itinerary, history HandlingHistory) Delivery + func (d Delivery) IsOnTrack() bool + func (d Delivery) UpdateOnRouting(rs RouteSpecification, itinerary Itinerary) Delivery + type HandlingActivity struct + Location location.UNLocode + Type HandlingEventType + VoyageNumber voyage.Number + type HandlingEvent struct + Activity HandlingActivity + TrackingID TrackingID + type HandlingEventFactory struct + CargoRepository Repository + LocationRepository location.Repository + VoyageRepository voyage.Repository + func (f *HandlingEventFactory) CreateHandlingEvent(registrationTime time.Time, completionTime time.Time, trackingID TrackingID, ...) (HandlingEvent, error) + type HandlingEventRepository interface + QueryHandlingHistory func(TrackingID) HandlingHistory + Store func(e HandlingEvent) + type HandlingEventType int + const Claim + const Customs + const Load + const NotHandled + const Receive + const Unload + func (t HandlingEventType) String() string + type HandlingHistory struct + HandlingEvents []HandlingEvent + func (h HandlingHistory) MostRecentlyCompletedEvent() (HandlingEvent, error) + type Itinerary struct + Legs []Leg + func (i Itinerary) FinalArrivalLocation() location.UNLocode + func (i Itinerary) FinalArrivalTime() time.Time + func (i Itinerary) InitialDepartureLocation() location.UNLocode + func (i Itinerary) IsEmpty() bool + func (i Itinerary) IsExpected(event HandlingEvent) bool + type Leg struct + LoadLocation location.UNLocode + LoadTime time.Time + UnloadLocation location.UNLocode + UnloadTime time.Time + VoyageNumber voyage.Number + func NewLeg(voyageNumber voyage.Number, loadLocation, unloadLocation location.UNLocode, ...) Leg + type Repository interface + Find func(trackingID TrackingID) (*Cargo, error) + FindAll func() []*Cargo + Store func(cargo *Cargo) error + type RouteSpecification struct + ArrivalDeadline time.Time + Destination location.UNLocode + Origin location.UNLocode + func (s RouteSpecification) IsSatisfiedBy(itinerary Itinerary) bool + type RoutingStatus int + const Misrouted + const NotRouted + const Routed + func (s RoutingStatus) String() string + type TrackingID string + func NextTrackingID() TrackingID + type TransportStatus int + const Claimed + const InPort + const NotReceived + const OnboardCarrier + const Unknown + func (s TransportStatus) String() string