vatsim

package
v0.0.0-...-0ad4d90 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ratings = [13]string{
	"",
	"OBS",
	"S1",
	"S2",
	"S3",
	"C1",
	"C2",
	"C3",
	"I1",
	"I2",
	"I3",
	"SUP",
	"ADM",
}

Functions

func GetDateOfRatingChange

func GetDateOfRatingChange(cid string) (*time.Time, error)

GetDateOfRatingChange returns the date of the last rating change of a VATSIM CID from the VATSIM API.

func GetLocation

func GetLocation(cid string) (string, string, string, error)

GetLocation returns the Region, Division and Subdivision of a VATSIM CID from the VATSIM API. Returns: Region, Division, Subdivision, error

func GetRating

func GetRating(cid string) (int, error)

GetRating returns the rating of a VATSIM CID from the VATSIM API. The rating is a integar that represents the rating "id". Typical: OBS=1, S1=2, S2=3, S3=4, C1=5, C2=6, C3=7, I1=8, I2=9, I3=10, SUP=11, ADM=12

Types

type VATSIMController

type VATSIMController struct {
	CID       int        `json:"cid"`
	Callsign  string     `json:"callsign"`
	Name      string     `json:"name"`
	Frequency string     `json:"frequency"`
	Facility  int        `json:"facility"`
	Rating    int        `json:"rating"`
	LogonTime *time.Time `json:"logon_time"`
}

type VATSIMData

type VATSIMData struct {
	Controllers []*VATSIMController `json:"controllers"`
	Flights     []*VATSIMFlight     `json:"pilots"`
}

func GetData

func GetData() (*VATSIMData, error)

type VATSIMFlight

type VATSIMFlight struct {
	CID         int              `json:"cid"`
	Callsign    string           `json:"callsign"`
	Latitude    float64          `json:"latitude"`
	Longitude   float64          `json:"longitude"`
	Altitude    int              `json:"altitude"`
	Groundspeed int              `json:"groundspeed"`
	Heading     int              `json:"heading"`
	FlightPlan  VATSIMFlightPlan `json:"flight_plan"`
}

type VATSIMFlightPlan

type VATSIMFlightPlan struct {
	Aircraft  string `json:"aircraft_faa"`
	Departure string `json:"departure"`
	Arrival   string `json:"arrival"`
	Route     string `json:"route"`
}

Jump to

Keyboard shortcuts

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