airports

package
v0.0.0-...-ed7ff26 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAirport = errors.New("invalid airport")
)

Functions

This section is empty.

Types

type Airport

type Airport struct {
	ID               int64      `json:"id"`
	FAAID            string     `json:"faa_id" gorm:"unique"`
	ICAOID           string     `json:"icao_id" gorm:"unique"`
	ATIS             string     `json:"atis"`
	ATISTime         *time.Time `json:"atis_time"`
	ArrivalATIS      string     `json:"arrival_atis"`
	ArrivalATISTime  *time.Time `json:"arrival_atis_time"`
	DepartureRunways string     `json:"departure_runways"`
	ArrivalRunways   string     `json:"arrival_runways"`
	METAR            string     `json:"metar"`
	TAF              string     `json:"taf"`
	MagVar           int        `json:"mag_var"`
	ParentFacility   int64      `json:"parent_facility"`
}

type AirportService

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

func NewAirportService

func NewAirportService(db *gorm.DB, c *cache.Cache) *AirportService

func (*AirportService) AddHook

func (s *AirportService) AddHook(h func(old Airport, new Airport))

func (*AirportService) CleanupATIS

func (s *AirportService) CleanupATIS() error

func (*AirportService) CreateAirport

func (s *AirportService) CreateAirport(airport *Airport) error

func (*AirportService) DeleteAirport

func (s *AirportService) DeleteAirport(id string) error

func (*AirportService) GetAirport

func (s *AirportService) GetAirport(id string) (Airport, error)

func (*AirportService) GetAirports

func (s *AirportService) GetAirports() ([]Airport, error)

func (*AirportService) GetIdentifiers

func (s *AirportService) GetIdentifiers(id string) (string, string, error)

Takes an airport identifier and returns both FAAID and ICAOID, useful for converting between the two.

func (*AirportService) UpdateAirport

func (s *AirportService) UpdateAirport(airport Airport) error

func (*AirportService) UpdateWeather

func (s *AirportService) UpdateWeather() error

Jump to

Keyboard shortcuts

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