domain

package
v0.0.0-...-da8027b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegisterNewFlightCommand = stream.CommandType("RegisterNewFlight")
	AppendTrackLogCommand    = stream.CommandType("AppendTrackLog")
)
View Source
const (
	NewFlightRegisteredEvent = stream.EventType("NewFlightRegistered")
	TrackPointAppendedEvent  = stream.EventType("TrackPointAppended")
)
View Source
const Stream = stream.Type("Flight")

Variables

This section is empty.

Functions

This section is empty.

Types

type Airport

type Airport struct {
	Code string
	Name string
	City string
}

type AppendTrackLog

type AppendTrackLog struct {
	TrackPoint TrackPoint
}

type ArrivalTime

type ArrivalTime struct {
	Landing     time.Time
	GateArrival time.Time
}

type DepartureTime

type DepartureTime struct {
	GateDeparture time.Time
	Takeoff       time.Time
}

type Flight

type Flight struct {
	stream.Stream
	// contains filtered or unexported fields
}

func (*Flight) AppendTrackPoint

func (f *Flight) AppendTrackPoint(p AppendTrackLog) error

func (*Flight) Apply

func (f *Flight) Apply(e stream.Event, isNew bool)

func (*Flight) Type

func (f *Flight) Type() stream.Type

type Information

type Information struct {
	Speed    string
	Altitude string
	Distance string
	Route    string
}

type Mutator

type Mutator interface {
	RegisterNewFlight(context.Context, *Flight, RegisterNewFlight) error
	AppendTrackLog(context.Context, *Flight, AppendTrackLog) error
}

func NewMutator

func NewMutator() Mutator

type NewFlightRegistered

type NewFlightRegistered struct {
	FlightID               stream.ID
	AircraftID             stream.ID
	AirlineID              stream.ID
	From                   Airport
	To                     Airport
	ScheduledDepartureTime DepartureTime
	DepartureTime          DepartureTime
	ScheduledArrivalTime   ArrivalTime
	ArrivalTime            ArrivalTime
	Status                 Status
}

type Projection

type Projection interface {
	NewFlightRegistered(context.Context, stream.ID, stream.Version, NewFlightRegistered) error
	TrackPointAppended(context.Context, stream.ID, stream.Version, TrackPointAppended) error
}

type RegisterNewFlight

type RegisterNewFlight struct {
	AircraftID             stream.ID
	AirlineID              stream.ID
	From                   Airport
	To                     Airport
	ScheduledDepartureTime DepartureTime
	ScheduledArrivalTime   ArrivalTime
}

type Status

type Status int
const (
	Pending Status = 1
)

type TrackPoint

type TrackPoint struct {
	Latitude  float64
	Longitude float64
	Rate      float64
}

func (TrackPoint) String

func (p TrackPoint) String() string

type TrackPointAppended

type TrackPointAppended struct {
	AircraftID stream.ID
	AirlineID  stream.ID
	From       Airport
	To         Airport
	TrackPoint TrackPoint
	Status     Status
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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