Documentation
¶
Index ¶
- func IsFlightIdsArtifactFilename(fn string) bool
- func IsTrackArtifactFilename(fn string) bool
- func MakeFlightIdsArtifactFilename(queryId string) string
- func MakeTrackArtifactFilename(flightId string) string
- type Api
- type ArtifactLocator
- type ArtifactRetriever
- type ArtifactSaver
- type Degrees
- type FileAeroApi
- type Flight
- type FlightsResponse
- type HttpAeroApi
- type Math
- type MockArtifactRetriever
- type Position
- type Radians
- type ResponseSaver
- type RetrieverSaverApiImpl
- type Track
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTrackArtifactFilename ¶
Types ¶
type ArtifactLocator ¶
type ArtifactLocator interface { // GetFlightIdsRef returns a reference used to obtain the flight identifier(s) for the desired track(s). // The return value is an address (such as a URL or file name) used within context to obtain the desired list. GetFlightIdsRef(tailNumber string, cutoffTime time.Time) (string, error) // GetTrackForFlightRef returns a reference (such as a URL or file name) used to obtain the desired track data. GetTrackForFlightRef(flightId string) string }
type ArtifactRetriever ¶
type ArtifactRetriever interface { ArtifactLocator persistence.Loader }
type ArtifactSaver ¶
type ArtifactSaver interface { ArtifactLocator persistence.Saver }
type FileAeroApi ¶
type FileAeroApi struct { ArtifactsDir string FlightIdsFileName string persistence.FileLoader persistence.FileSaver }
func (*FileAeroApi) GetFlightIdsRef ¶
func (*FileAeroApi) GetTrackForFlightRef ¶
func (c *FileAeroApi) GetTrackForFlightRef(flightId string) string
type FlightsResponse ¶
type FlightsResponse struct {
Flights []Flight `json:"flights"`
}
func FlightsFromJson ¶
func FlightsFromJson(flightsBytes []byte) (*FlightsResponse, error)
type HttpAeroApi ¶
func (*HttpAeroApi) GetFlightIdsRef ¶
func (*HttpAeroApi) GetTrackForFlightRef ¶
func (c *HttpAeroApi) GetTrackForFlightRef(flightId string) string
type Math ¶
type Math struct {
Debug bool
}
func (*Math) GetBankAngle ¶
GetBankAngle calculates and reports, using a loose heuristic, a reasonable "bank angle" that could be used by a general aviation aircraft to achieve the observed change in heading between one reported position and another.
func (*Math) GetGeoBearing ¶
GetGeoBearing calculates and reports the apparent compass bearing (0 <= bearing < 360) needed to arrive at a new geolocation
func (*Math) GetGeoGsKnots ¶
GetGeoGsKnots calculates and reports the apparent average ground speed used navigate the straight line distance between two geolocations
type MockArtifactRetriever ¶
func (*MockArtifactRetriever) GetFlightIdsRef ¶
func (*MockArtifactRetriever) GetTrackForFlightRef ¶
func (*MockArtifactRetriever) GetTrackForFlightRef(flightId string) string
type Position ¶
type Position struct { // 230811 Changed "AltAglD100" to "AltMslD100" per updated understanding // based upon post: "https://discussions.flightaware.com/t/aero-api-altitude/82883/4" // which reads: "None of our aircraft altitudes will ever be reported in AGL, if that helps." // and also based upon observed results for Virgin Galactic flight AltMslD100 float64 `json:"altitude"` // feet / 100 (MSL) GsKnots float64 `json:"groundspeed"` // knots Heading float64 `json:"heading"` // 0..359 Latitude float64 `json:"latitude"` // -90..90 Longitude float64 `json:"longitude"` // -180..180 Timestamp time.Time `json:"timestamp"` }
type RetrieverSaverApiImpl ¶
type RetrieverSaverApiImpl struct { Retriever ArtifactRetriever Saver ArtifactSaver }
func (*RetrieverSaverApiImpl) GetFlightIds ¶
func (a *RetrieverSaverApiImpl) GetFlightIds(tailNumber string, cutoffTime time.Time) ([]string, error)
GetFlightIds returns the AeroAPI identifier(s) of the flight(s) specified by the parameters cutoffTime (optional) - most recent time for a flight to be considered
func (*RetrieverSaverApiImpl) GetTrackForFlightId ¶
func (a *RetrieverSaverApiImpl) GetTrackForFlightId(flightId string) (*Track, error)
GetTrackForFlightId retrieves the track for the given flight given its AeroAPI identifier