Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Station ¶
type Station struct { ID uint Type string Street string StreetNumber string Height int Lon float64 Lat float64 Distance float64 }
Station contains info about a station
type StationProvider ¶
type StationProvider interface { GetAllStations() ([]Station, error) GetStationByID(id uint) (Station, error) GetNearbyStations(lat, lon float64, minStations int) ([]Station, error) GetStationStateByInterval(stationID int, start time.Time, duration time.Duration) ([]StationState, error) GetCurrentStationStateStationByID(stationID uint) (StationState, error) }
StationProvider gives you a list of the nearby stations
func NewSQLStationProvider ¶
func NewSQLStationProvider(db *sql.DB) StationProvider
NewSQLStationProvider returns a StationStateProvider that uses mysql to retrieve the information
type StationState ¶
StationState represents the state of a current station in a point in time
type StationStatePersister ¶
type StationStatePersister interface {
PersistCollection(collection.StationStateCollection) error
}
StationStatePersister takes the data from a collection.StationStateCollection and saves it to a persistent storage
func NewSQLStorage ¶
func NewSQLStorage(db *sql.DB) StationStatePersister
NewSQLStorage returns a StationStaterPersister that will persist data in the database/sql passed to it
Click to show internal directories.
Click to hide internal directories.