Versions in this module Expand all Collapse all v1 v1.0.3 Feb 17, 2020 Changes in this version + const StatusDown + const StatusRecovering + const StatusUnknown + const StatusUp + var StoresDataDirectory = "data/" + func CleanUp() + func LoadStores() error + func SaveStores() error + func TakeMeasurements() + type ArrivalStore struct + func (store *ArrivalStore) CleanUp(currentTime time.Time) + func (store *ArrivalStore) GetAllArrivals() map[string]models.Arrival + func (store *ArrivalStore) GetArrival(serviceID, serviceDate string, station string) *models.Arrival + func (store *ArrivalStore) GetNumberOfArrivals() int + func (store *ArrivalStore) GetStationArrivals(station string, includeHidden bool) []models.Arrival + func (store *ArrivalStore) InitStore() + func (store *ArrivalStore) ProcessArrival(newArrival models.Arrival) + func (store *ArrivalStore) ReadStore() error + func (store *ArrivalStore) SaveStore() error + type Counters struct + Duplicates int + Error int + Outdated int + Processed int + Received int + TooLate int + type DepartureStore struct + func (store *DepartureStore) CleanUp(currentTime time.Time) + func (store *DepartureStore) GetAllDepartures() map[string]models.Departure + func (store *DepartureStore) GetDeparture(serviceID, serviceDate string, station string) *models.Departure + func (store *DepartureStore) GetNumberOfDepartures() int + func (store *DepartureStore) GetStationDepartures(station string, includeHidden bool) []models.Departure + func (store *DepartureStore) InitStore() + func (store *DepartureStore) ProcessDeparture(newDeparture models.Departure) + func (store *DepartureStore) ReadStore() error + func (store *DepartureStore) SaveStore() error + type DowntimeDetectionConfig struct + MinAverage float64 + MinAverageNight float64 + NightEndHour int + NightStartHour int + RecoveryTime int + func (downtimeDetection DowntimeDetectionConfig) CurrentMinimumAverage(time time.Time) float64 + type Measurement struct + Processed int + Time time.Time + type ServiceStore struct + func (store *ServiceStore) CleanUp(currentTime time.Time) + func (store *ServiceStore) GetAllServices() map[string]models.Service + func (store *ServiceStore) GetNumberOfServices() int + func (store *ServiceStore) GetService(serviceID, serviceDate string) *models.Service + func (store *ServiceStore) InitStore() + func (store *ServiceStore) ProcessService(newService models.Service) + func (store *ServiceStore) ReadStore() error + func (store *ServiceStore) SaveStore() error + type Store struct + Counters Counters + DowntimeDetection DowntimeDetectionConfig + LastStatusChange time.Time + MessagesAverage float64 + Status string + func (store *Store) ResetCounters() + func (store *Store) ResetStatus() + func (store *Store) TakeMeasurement() + type StoreCollection struct + ArrivalStore ArrivalStore + DepartureStore DepartureStore + ServiceStore ServiceStore + var Stores StoreCollection + func InitializeStores() *StoreCollection