voyage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package voyage provides the Voyage aggregate.

Index

Constants

This section is empty.

Variables

View Source
var (
	V100 = New("V100", Schedule{
		[]CarrierMovement{
			{DepartureLocation: location.Hongkong, ArrivalLocation: location.Tokyo},
			{DepartureLocation: location.Tokyo, ArrivalLocation: location.NewYork},
		},
	})

	V300 = New("V300", Schedule{
		[]CarrierMovement{
			{DepartureLocation: location.Tokyo, ArrivalLocation: location.Rotterdam},
			{DepartureLocation: location.Rotterdam, ArrivalLocation: location.Hamburg},
			{DepartureLocation: location.Hamburg, ArrivalLocation: location.Melbourne},
			{DepartureLocation: location.Melbourne, ArrivalLocation: location.Tokyo},
		},
	})

	V400 = New("V400", Schedule{
		[]CarrierMovement{
			{DepartureLocation: location.Hamburg, ArrivalLocation: location.Stockholm},
			{DepartureLocation: location.Stockholm, ArrivalLocation: location.Helsinki},
			{DepartureLocation: location.Helsinki, ArrivalLocation: location.Hamburg},
		},
	})
)

A set of sample voyages.

View Source
var (
	V0100S = New("0100S", Schedule{[]CarrierMovement{}})
	V0200T = New("0200T", Schedule{[]CarrierMovement{}})
	V0300A = New("0300A", Schedule{[]CarrierMovement{}})
	V0301S = New("0301S", Schedule{[]CarrierMovement{}})
	V0400S = New("0400S", Schedule{[]CarrierMovement{}})
)

These voyages are hard-coded into the current pathfinder. Make sure they exist.

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

ErrUnknown is used when a voyage could not be found.

Functions

This section is empty.

Types

type CarrierMovement

type CarrierMovement struct {
	DepartureLocation location.Location
	ArrivalLocation   location.Location
	DepartureTime     time.Time
	ArrivalTime       time.Time
}

CarrierMovement is a vessel voyage from one location to another.

type Number

type Number string

Number uniquely identifies a particular Voyage.

type Repository

type Repository interface {
	Find(Number) (*Voyage, error)
}

Repository provides access a voyage store.

type Schedule

type Schedule struct {
	CarrierMovements []CarrierMovement
}

Schedule describes a voyage schedule.

type Voyage

type Voyage struct {
	Number   Number
	Schedule Schedule
}

Voyage is a uniquely identifiable series of carrier movements.

func New

func New(n Number, s Schedule) *Voyage

New creates a voyage with a voyage number and a provided schedule.

Jump to

Keyboard shortcuts

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