flightradar24sdk

package module
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 8 Imported by: 0

README

flightradar24sdk

Golang SDK for flightradar24.com

This project is at Work In Progress status!

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 NewAPI

func NewAPI(opts ...Option) *API

func (*API) Client

func (a *API) Client() *resty.Client

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 FlightStatsItem struct {
	ADSB      int
	MLAT      int
	FAA       int
	FLARM     int
	Estimated int
	Satellite int
	Uat       int
	Other     int
}

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 WithClient(client *http.Client) Option

func WithDebug

func WithDebug(enabled bool) Option

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
}

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

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