Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { EndpointURL *url.URL UserAgent string HafasService *HafasService // contains filtered or unexported fields }
APIClient for api requests
type HafasArrival ¶
type HafasArrival struct { Platform string `json:"platform"` ScheduledTime int64 `json:"scheduledTime"` Time int64 `json:"time"` Reihung bool `json:"reihung"` }
HafasArrival ressource
type HafasCoordinates ¶
HafasCoordinates ressource
type HafasDeparture ¶
type HafasDeparture struct { Platform string `json:"platform"` ScheduledTime int64 `json:"scheduledTime"` Time int64 `json:"time"` Reihung bool `json:"reihung"` }
HafasDeparture ressource
type HafasMock ¶
type HafasMock struct {
TrainExists bool
}
HafasMock to testing
func (*HafasMock) GetTrainByStation ¶
func (h *HafasMock) GetTrainByStation(ctx context.Context, trainName string, stationEVA int, stationDate int64) (*HafasTrain, error)
GetTrainByStation by name, station id and date
type HafasService ¶
type HafasService struct {
// contains filtered or unexported fields
}
HafasService serve the marudor hafas api
func (*HafasService) FindTrain ¶
func (h *HafasService) FindTrain(ctx context.Context, trainName string, date time.Time) (*[]HafasTrainResult, error)
FindTrain by name and date
func (*HafasService) GetTrainByStation ¶
func (h *HafasService) GetTrainByStation(ctx context.Context, trainName string, stationEVA int, stationDate int64) (*HafasTrain, error)
GetTrainByStation by name, station id and date
type HafasStation ¶
type HafasStation struct { ID string `json:"id"` Title string `json:"title"` Coordinates HafasCoordinates `json:"coordinates"` }
HafasStation ressource
type HafasStop ¶
type HafasStop struct { Station *HafasStation `json:"station"` Departure *HafasDeparture `json:"departure"` Arrival *HafasArrival `json:"arrival"` TrainLoad *HafasTrainLoad `json:"auslastung"` }
HafasStop ressource
type HafasTrain ¶
type HafasTrain struct { JID string `json:"jid"` Train HafasTrainInfo `json:"train"` Departure *HafasDeparture `json:"departure"` Arrival *HafasArrival `json:"arrival"` TrainLoad *HafasTrainLoad `json:"auslastung"` Type string `json:"type"` // duration // train // segmentStart // segmentDestination CurrentStop *HafasStop `json:"currentStop"` Stops []HafasStop `json:"stops"` FinalDestination string `json:"finalDestination"` }
HafasTrain ressource
type HafasTrainInfo ¶
type HafasTrainInfo struct { Name string `json:"name"` Line string `json:"line"` Admin string `json:"admin"` Number string `json:"number"` Type string `json:"type"` Operator HafasTrainOperator `json:"operator"` }
HafasTrainInfo ressource
type HafasTrainLoad ¶
HafasTrainLoad ressource
type HafasTrainOperator ¶
HafasTrainOperator resource
type HafasTrainResult ¶
type HafasTrainResult struct { Train HafasTrainInfo `json:"train"` JID string `json:"jid"` FirstStop *HafasStop `json:"firstStop"` LastStop *HafasStop `json:"lastStop"` Stops []HafasStop `json:"stops"` }
HafasTrainResult from find train search
Click to show internal directories.
Click to hide internal directories.