aircraftdb

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OperatorCountryFixupMap = map[string]string{
	"Netherlands":             "Netherlands, Kingdom of",
	"Tanzania":                "United Republic of Tanzania",
	"Côte d'Ivoire":          "Côte d Ivoire",
	"Macedonia":               "North Macedonia",
	"Brunei":                  "Brunei Darussalam",
	"Syria":                   "Syrian Arab Republic",
	"Iran":                    "Iran, Islamic Republic",
	"Russia":                  "Russian Federation",
	"Moldova":                 "Republic of Moldova",
	"Laos":                    "Lao People's Democratic Republic",
	"São Tomé and Principe": "Sao Tome",
	"South Korea":             "Republic of Korea",
	"North Korea":             "Democratic People's Republic of Korea",
	"Congo (Brazzaville)":     "Democratic Republic of the Congo",
	"Perú":                   "Peru",
}

OperatorCountryFixupMap - map of mictronics country names to names in our list

Functions

func LoadAssets

func LoadAssets(db *Db, Asset func(string) ([]byte, error)) error

LoadAssets loads the readsb database from internal files into Db.

Types

type Db

type Db struct {
	// contains filtered or unexported fields
}

Db provides access to the readsb aircraft database

func New

func New() *Db

New returns an initialized (but empty) Db

func (*Db) GetAircraft

func (d *Db) GetAircraft(icao string) (*pb.AircraftInfo, bool)

GetAircraft searches for aircraft information using icao. The second return argument indicates whether the search was successful. If its false the aircraft info will be nil.

func (*Db) GetOperator

func (d *Db) GetOperator(code string) (*pb.Operator, bool)

GetOperator searches for operator information using code. The second return argument indicates whether the search was successful. If its false the operator info will be nil.

type Operator

type Operator struct {
	Name    string `json:"n"`
	Country string `json:"c"`
	R       string `json:"r"`
}

Operator contains information about an airline operator

Jump to

Keyboard shortcuts

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