-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (28 loc) · 1002 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"agalera.eu/flight-tracking/internal/detector"
"agalera.eu/flight-tracking/internal/notification"
"agalera.eu/flight-tracking/internal/provider"
"agalera.eu/flight-tracking/internal/provider/flightradar24"
"agalera.eu/flight-tracking/internal/provider/radarbox"
"agalera.eu/flight-tracking/internal/request"
"agalera.eu/flight-tracking/internal/zone"
"time"
)
func AllProviders() []provider.DataProvider {
executor := request.HttpRequestExecutor{}
return []provider.DataProvider{
flightradar24.NewFlightRadarProvider(executor),
radarbox.NewRadarBoxProvider(executor),
}
}
func main() {
dataFolder := "./data"
eu := zone.Zone{Name: "Europe centered in Kiev", Area: zone.Bounds{Lat1: 55.594, Lng1: -5.48, Lat2: 44.389, Lng2: 68.344}}
notifiers := []notification.Notifier{¬ification.ConsoleNotifier{}}
det := detector.NewMilitaryFlightDetector(notifiers, AllProviders(), dataFolder)
for {
det.DetectMilitaryFlights(eu)
time.Sleep(30 * time.Second)
}
}