Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetFlights ¶
func (a *API) GetFlights(ctx context.Context, airline string, radarOpts *RadarOptions) (GetFlightsResponse, error)
GetFlights Get flights: - airline: The airline ICAO. Ex: "DAL" - radarOpts: Optional radar options.
type Flight ¶
type Flight struct { ID string // FlightRadar24 ID ICAORegistration string // ICAO 24-bit address The ICAO24 code (sometimes called the Mode S code) is a 24-bit unique number that is assigned to each vehicle or object that can transmit ADS-B messages. It is usually transmitted by aircraft but some airport ground vehicles and multilateration towers also have ICAO24 codes assigned to them. Latitude float64 // Latitude Longitude float64 // Longitude Heading uint8 // Heading in degrees Altitude uint // Altitude in feet Speed uint // Speed in knots SquawkCode string // Squawk code RadarID string // Radar ID ICAOModel string // ICAO model type Registration string // Registration Timestamp int64 // Timestamp Origin string // Origin airport IATA code Destination string // Destination airport IATA code FlightNumber string // Flight number IsOnGround bool // Is on ground RateOfClimb uint // Rate of climb in feet per minute CallSign string // Callsign IsGlider bool // Is glider Company string // Company }
type FlightStats ¶
type FlightStats struct { Total FlightStatsItem `mapstructure:"total"` Visible FlightStatsItem `mapstructure:"visible"` }
type FlightStatsItem ¶
type GetFlightsResponse ¶
type GetFlightsResponse struct { Flights []Flight `mapstructure:",remain"` Stats FlightStats `mapstructure:"stats"` FullCount float64 `mapstructure:"full_count"` Version float64 `mapstructure:"version"` }
type Option ¶
type Option func(o *apiOptions)
func WithClient ¶
func WithLogger ¶
func WithLogger(logger resty.Logger) Option
type RadarOptions ¶
type RadarOptions struct { Bounds []float64 `url:"bounds,int" del:"!"` // [upperLeftLat, upperLefLng, lowerRightLat, lowerRightLng] FAA bool `url:"faa,int"` // Use US/Canada data source Satellite bool `url:"satellite,int"` // FLARM bool `url:"flarm,int"` // Use FLARM data source MLAT bool `url:"mlat,int"` // Use MLAT data source ADSB bool `url:"adsb,int"` // Use ADS-B data source InAir bool `url:"air,int"` // Get in-air aircraft OnGround bool `url:"onground,int"` // Get on-ground aircraft Inactive bool `url:"vehicles,int"` // Get inactive aircraft on ground Gliders bool `url:"gliders,int"` // Get gliders EstimatedPosition bool `url:"gnd,int"` // Get estimated position Stats bool `url:"stats,int"` // Default true Limit int `url:"limit"` // Default 5000 MaxAge int `url:"maxage"` // Default 14400 }
Click to show internal directories.
Click to hide internal directories.