Versions in this module Expand all Collapse all v0 v0.0.4 Dec 16, 2020 Changes in this version + const DefaultAdsbxEndpoint + const DefaultGeoHashLength + const DefaultHistoryFileCount + const DefaultHistoryInterval + const DefaultNearestAirportMaxAltitude + const DefaultNearestAirportMaxDistance + const DefaultOnGroundUpdateThreshold + const DefaultSightingReopenInterval + const Dump1090MapService + const GeocodeEndpoints + const MapProduced + const SpottedInFlight + const TakeoffComplete + const TakeoffFromAirport + const TakeoffUnknownAirport + const Tar1090MapService + const TrackCallSigns + const TrackKmlLocation + const TrackSquawks + const TrackTakeoff + const TrackTxTypes + var DefaultMapServices = []string + var ErrUnknownProject = errors.New("unknown project") + func AirlineCodeFromCallsign(callSign string) (string, bool) + type AdsbxAircraft struct + Alt string + Altt string + Call string + Country string + Galt string + Ground string + Icao string + Lat string + Lon string + Mlat string + Opicao string + Pos string + PosTime string + Registration string + Sat string + Spd string + Sqk string + Talt string + Tisb string + Trak string + Trkh string + Trt string + Ttrk string + Type string + Vsi string + Vsit string + Wtc string + type AdsbxAircraftResponse struct + Aircraft []AdsbxAircraft + CTime int64 + Msg string + PTime int64 + Total int64 + type AdsbxProducer struct + func NewAdsbxProducer(msgs chan *pb.Message, url string, apikey string) *AdsbxProducer + func (p *AdsbxProducer) GetAdsbx(ctx context.Context, client *http.Client, msgs chan *pb.Message, ...) error + func (p *AdsbxProducer) Name() string + func (p *AdsbxProducer) PanicIfStuck(stop bool) + func (p *AdsbxProducer) Start() + func (p *AdsbxProducer) Stop() + type AircraftMap struct + func NewAircraftMap(cfg *config.MapSettings) (*AircraftMap, error) + func (m *AircraftMap) GetProjectAircraft(projectName string, f func(int64, []*JSONAircraft) error) error + func (m *AircraftMap) RegisterMapService(services ...MapService) error + func (m *AircraftMap) Serve() + func (m *AircraftMap) Stop() error + type BeastProducer struct + func NewBeastProducer(msgs chan *pb.Message, host string, port uint16, name string) *BeastProducer + func (p *BeastProducer) Name() string + func (p *BeastProducer) Start() + func (p *BeastProducer) Stop() + type EmailNotification string + func EmailNotificationFromString(n string) (EmailNotification, error) + type Feature string + func FeatureFromString(f string) (Feature, error) + type FlightTime struct + EndTime time.Time + EndTimeFmt string + SightingDuration time.Duration + StartTime time.Time + StartTimeFmt string + type GeocodeLocation struct + type JSONAircraft struct + BarometricAltitude int64 + BarometricRate int64 + Category string + Emergency string + Flight string + GVA int64 + GeometricAltitude int64 + GeometricRate int64 + GroundSpeed float64 + Hex string + IndicatedAirSpeed uint64 + Latitude float64 + Longitude float64 + Mach float64 + MagneticHeading float64 + Messages int64 + NacP uint32 + NacV uint32 + NavAltitudeFMS int64 + NavAltitudeMCP int64 + NavHeading float64 + NavModes []string + NavQNH float64 + Nic string + NicBaro uint32 + RadiusOfContainment int64 + Roll float64 + Rssi float64 + SDA int64 + Seen int64 + SeenPos float64 + Sil uint32 + SilType uint32 + Squawk string + Track float64 + TrackRate float64 + TrueAirSpeed uint64 + TrueHeading float64 + Type string + Version int64 + func (j *JSONAircraft) UpdateWithState(state *pb.State) + type MapAccess interface + GetProjectAircraft func(projectName string, f func(int64, []*JSONAircraft) error) error + type MapHistoryUpdateScheduler interface + UpdateHistory func(projects []string) error + type MapProjectAircraftUpdateListener struct + func NewMapProjectAircraftUpdateListener(m *AircraftMap) *MapProjectAircraftUpdateListener + func (l *MapProjectAircraftUpdateListener) LostAircraft(p *Project, s *Sighting) + func (l *MapProjectAircraftUpdateListener) NewAircraft(p *Project, s *Sighting) + func (l *MapProjectAircraftUpdateListener) UpdatedAircraft(p *Project, s *Sighting) + type MapProjectStatusListener struct + func NewMapProjectStatusListener(m *AircraftMap) *MapProjectStatusListener + func (p *MapProjectStatusListener) Activated(project *Project) + func (p *MapProjectStatusListener) Deactivated(project *Project) + type MapService interface + MapService func() string + RegisterRoutes func(r *mux.Router) error + UpdateHistory func(projNames []string) error + type Options struct + AircraftDb *aircraftdb.Db + AirportGeocoder *geo.NearestAirportGeocoder + Allocations ccode.CountryAllocationSearcher + CountryCodes *iso3166.Store + Filter string + LocationUpdateInterval time.Duration + Mailer mailer.MailSender + NearestAirportMaxAltitude int64 + NearestAirportMaxDistance float64 + OnGroundUpdateThreshold int64 + SightingTimeout time.Duration + Workers int + type Producer interface + Name func() string + Start func() + Stop func() + type Project struct + EmailNotifications []EmailNotification + Features []Feature + Filter string + HasLocationUpdateInterval bool + LocationUpdateInterval time.Duration + Name string + NotifyEmail string + Observations map[string]*ProjectObservation + OnGroundUpdateThreshold int64 + Program cel.Program + Project *db.Project + ReopenSightings bool + ReopenSightingsInterval time.Duration + Session *db.Session + ShouldMap bool + func InitProject(cfg config.Project) (*Project, error) + func (p *Project) IsEmailNotificationEnabled(n EmailNotification) bool + func (p *Project) IsFeatureEnabled(f Feature) bool + type ProjectAircraftUpdateListener interface + LostAircraft func(p *Project, s *Sighting) + NewAircraft func(p *Project, s *Sighting) + UpdatedAircraft func(p *Project, s *Sighting) + type ProjectObservation struct + func NewProjectObservation(p *Project, s *Sighting, msgTime time.Time) *ProjectObservation + func (o *ProjectObservation) AltitudeBarometric() int64 + func (o *ProjectObservation) AltitudeGeometric() int64 + func (o *ProjectObservation) CallSign() string + func (o *ProjectObservation) GetFlightTime() FlightTime + func (o *ProjectObservation) HaveAltitudeBarometric() bool + func (o *ProjectObservation) HaveAltitudeGeometric() bool + func (o *ProjectObservation) HaveCallSign() bool + func (o *ProjectObservation) HaveLocation() bool + func (o *ProjectObservation) HaveSquawk() bool + func (o *ProjectObservation) Location() (float64, float64) + func (o *ProjectObservation) SetAltitudeBarometric(alt int64) error + func (o *ProjectObservation) SetAltitudeGeometric(alt int64) error + func (o *ProjectObservation) SetCallSign(callsign string, track bool, msgTime time.Time) error + func (o *ProjectObservation) SetLocation(lat, lon float64, track bool, msgTime time.Time) error + func (o *ProjectObservation) SetSquawk(squawk string, track bool, msgTime time.Time) error + func (o *ProjectObservation) Squawk() string + type ProjectStatusListener interface + Activated func(project *Project) + Deactivated func(project *Project) + type Sighting struct + State pb.State + Tags SightingTags + func NewSighting(icao string, now time.Time) *Sighting + type SightingTags struct + IsInTakeoff bool + type Tracker struct + func New(database db.Database, opt Options) (*Tracker, error) + func (t *Tracker) AddProject(p *Project) error + func (t *Tracker) ProcessMessage(project *Project, s *Sighting, now time.Time, msg *pb.Message) error + func (t *Tracker) RegisterProjectAircraftUpdateListener(l ProjectAircraftUpdateListener) error + func (t *Tracker) RegisterProjectStatusListener(l ProjectStatusListener) error + func (t *Tracker) Start(msgs chan *pb.Message) + func (t *Tracker) Stop() error + func (t *Tracker) UpdateStateFromMessage(s *Sighting, msg *pb.Message, now time.Time) error