Documentation ¶
Index ¶
- Variables
- type Airport
- type AirportService
- func (s *AirportService) AddHook(h func(old Airport, new Airport))
- func (s *AirportService) CleanupATIS() error
- func (s *AirportService) CreateAirport(airport *Airport) error
- func (s *AirportService) DeleteAirport(id string) error
- func (s *AirportService) GetAirport(id string) (Airport, error)
- func (s *AirportService) GetAirports() ([]Airport, error)
- func (s *AirportService) GetIdentifiers(id string) (string, string, error)
- func (s *AirportService) UpdateAirport(airport Airport) error
- func (s *AirportService) UpdateWeather() error
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
Click to show internal directories.
Click to hide internal directories.