flight

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Airport

type Airport struct {
	Name    string  `json:"name"`
	City    string  `json:"city"`
	Country string  `json:"countryCode"`
	Iata    string  `json:"iataCode"`
	Icao    string  `json:"icaoCode"`
	Lat     float64 `json:"latitude"`
	Long    float64 `json:"longitude"`
}

Airport represents the details of a given airport

type Path

type Path struct {
	Segments []*Segment `json:"segments"`
}

Path represents a list of flight segments

func (*Path) Distance

func (p *Path) Distance() float64

Distance retrieves the sum of the distances of flight segments which make up the path

type Segment

type Segment struct {
	Origin      *Airport `json:"origin"`
	Destination *Airport `json:"destination"`
}

Segment represents a non-stop flight between origin and destination airports

func (*Segment) Distance

func (s *Segment) Distance() float64

Distance returns the distance (in miles) between the origin and destination airports

Jump to

Keyboard shortcuts

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