icao

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DATA_GITHUB string = "https://raw.githubusercontent.com/sfomuseum/go-sfomuseum-aircraft/main/data/aircraft-icao.json"
View Source
const DATA_JSON = "aircraft-icao.json"

Variables

This section is empty.

Functions

func NewICAOLookup

func NewICAOLookup(ctx context.Context, uri string) (aircraft.AircraftLookup, error)

NewICAOLookup will return an `aircraft.AircraftLookup` instance derived from precompiled (embedded) data in `data/icao.json`

func NewICAOLookupWithLookupFunc

func NewICAOLookupWithLookupFunc(ctx context.Context, lookup_func ICAOLookupFunc) (aircraft.AircraftLookup, error)

NewICAOLookupWithLookupFunc will return an `aircraft.AircraftLookup` instance derived by data compiled using `lookup_func`.

Types

type Aircraft

type Aircraft struct {
	ModelFullName       string
	Description         string
	WTC                 string
	Designator          string
	ManufacturerCode    string
	AircraftDescription string
	EngineCount         string
	EngineType          string
}

func (*Aircraft) String

func (a *Aircraft) String() string

type ICAOLookup

type ICAOLookup struct {
	aircraft.AircraftLookup
}

func (*ICAOLookup) Append

func (l *ICAOLookup) Append(ctx context.Context, data interface{}) error

func (*ICAOLookup) Find

func (l *ICAOLookup) Find(ctx context.Context, code string) ([]interface{}, error)

type ICAOLookupFunc

type ICAOLookupFunc func(context.Context)

func NewICAOLookupFuncWithReader

func NewICAOLookupFuncWithReader(ctx context.Context, r io.ReadCloser) ICAOLookupFunc

NewICAOLookup will return an `ICAOLookupFunc` function instance that, when invoked, will populate an `aircraft.AircraftLookup` instance with data stored in `r`. `r` will be closed when the `ICAOLookupFunc` function instance is invoked. It is assumed that the data in `r` will be formatted in the same way as the procompiled (embedded) data stored in `data/icao.json`.

Jump to

Keyboard shortcuts

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