skp_bana.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // SPDX-FileCopyrightText: Adam Evyčędo
  2. //
  3. // SPDX-License-Identifier: AGPL-3.0-or-later
  4. package traffic
  5. import (
  6. "apiote.xyz/p/szczanieckiej/transformers"
  7. "net/http"
  8. "time"
  9. "golang.org/x/text/transform"
  10. )
  11. type SkpBana struct {
  12. client http.Client
  13. }
  14. func (SkpBana) getTimezone() *time.Location {
  15. l, _ := time.LoadLocation("Europe/Warsaw")
  16. return l
  17. }
  18. func (g SkpBana) ConvertVehicles() ([]Vehicle, error) {
  19. return []Vehicle{}, nil
  20. }
  21. func (z SkpBana) GetVersions(_ time.Time, timezone *time.Location) ([]Version, error) {
  22. version, err := MakeVersionTimezone("00010101_99991231", timezone)
  23. if err != nil {
  24. return nil, err
  25. }
  26. version.Link = "https://bimba.app/gtfs/pl-30_3025_bana.zip"
  27. return []Version{version}, nil
  28. }
  29. func (SkpBana) String() string {
  30. return "skp_bana"
  31. }
  32. func (SkpBana) RealtimeFeeds() map[RealtimeFeedType]string {
  33. return map[RealtimeFeedType]string{}
  34. }
  35. func (SkpBana) Transformer() transform.Transformer {
  36. return transformers.TransformerPL
  37. }
  38. func (SkpBana) Name() string {
  39. return "Średzka Kolej Powiatowa"
  40. }
  41. func (SkpBana) Flags() FeedFlags {
  42. return FeedFlags{
  43. Headsign: HeadsignTripHeadsing,
  44. StopIdFormat: "{{stop_id}}",
  45. StopName: "{{stop_name}}",
  46. LineName: "{{route_short_name}}",
  47. }
  48. }
  49. func (SkpBana) FeedPrepareZip(path string) error {
  50. return nil
  51. }
  52. func (SkpBana) QRInfo() (string, QRLocation, string) {
  53. return "", QRLocationNone, ""
  54. }