This commit is contained in:
matst80
2025-11-14 20:21:53 +01:00
commit 4dbbd30d4d
38 changed files with 10969837 additions and 0 deletions

23
pkg/types/route.go Normal file
View File

@@ -0,0 +1,23 @@
package types
type Route struct {
Agency *Agency `json:"agency" csv:"agency"`
Trips []*Trip `json:"trips" csv:"trips"`
RouteID string `json:"route_id" csv:"route_id"`
AgencyID string `json:"agency_id" csv:"agency_id"`
RouteShortName string `json:"route_short_name" csv:"route_short_name"`
RouteLongName string `json:"route_long_name" csv:"route_long_name"`
RouteType int `json:"route_type" csv:"route_type"`
RouteURL string `json:"route_url" csv:"route_url"`
}
func (r *Route) SetAgency(agency *Agency) {
r.Agency = agency
}
func (r *Route) AddTrip(trip *Trip) {
if r.Trips == nil {
r.Trips = make([]*Trip, 0)
}
r.Trips = append(r.Trips, trip)
}