Files
go-gtfs/pkg/types/route.go
2025-11-15 17:53:50 +01:00

24 lines
709 B
Go

package types
type Route struct {
Agency *Agency `json:"agency" csv:"-"`
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)
}