Documentation ¶
Index ¶
- Constants
- type DatePattern
- type DateRange
- type Garage
- type JourneyPattern
- type JourneyPatternSection
- type JourneyPatternTimingLink
- type JourneyPatternTimingLinkPoint
- type Line
- type Location
- type LocationInner
- type OperatingProfile
- type Operator
- type Route
- type RouteLink
- type RouteSection
- type Service
- type ServicedOrganisation
- type StopPoint
- type TransXChange
- type VehicleJourney
- type VehicleJourneyTimingLink
Constants ¶
View Source
const DateTimeFormat = "2006-01-02T15:04:05"
View Source
const DateTimeFormatWithTimezone = "2006-01-02T15:04:05-07:00"
View Source
const DateTimeFormatWithTimezoneRegex = ".+[+-]\\d{2}:\\d{2}"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatePattern ¶
type JourneyPattern ¶
type JourneyPattern struct { ID string `xml:"id,attr"` CreationDateTime string `xml:",attr"` ModificationDateTime string `xml:",attr"` OperatingProfile OperatingProfile // `xml:",innerxml" json:"-" bson:"-"` DestinationDisplay string OperatorRef string Direction string RouteRef string JourneyPatternSectionRefs string }
type JourneyPatternSection ¶
type JourneyPatternSection struct { ID string `xml:"id,attr"` JourneyPatternTimingLinks []JourneyPatternTimingLink `xml:"JourneyPatternTimingLink"` }
func (*JourneyPatternSection) GetTimingLink ¶
func (jp *JourneyPatternSection) GetTimingLink(ID string) (*JourneyPatternTimingLink, error)
type JourneyPatternTimingLink ¶
type JourneyPatternTimingLink struct { ID string `xml:"id,attr"` RouteLinkRef string RunTime string From JourneyPatternTimingLinkPoint To JourneyPatternTimingLinkPoint }
type Line ¶
type Line struct { ID string `xml:"id,attr"` LineName string OutboundOrigin string `xml:"OutboundDescription>Origin"` OutboundDestination string `xml:"OutboundDescription>Destination"` OutboundDescription string `xml:"OutboundDescription>Description"` InboundOrigin string `xml:"InboundDescription>Origin"` InboundDestination string `xml:"InboundDescription>Destination"` InboundDescription string `xml:"InboundDescription>Description"` }
type Location ¶
type Location struct { LocationInner Translation LocationInner }
type LocationInner ¶
type OperatingProfile ¶
type OperatingProfile struct { XMLValue string `xml:",innerxml" json:"-" bson:"-"` RegularDayType []string PeriodicDayType []string BankHolidayOperation []string BankHolidayNonOperation []string ServicedOrganisationDayType []string SpecialDaysOperation []string }
func (*OperatingProfile) ToCTDF ¶
func (operatingProfile *OperatingProfile) ToCTDF(servicedOrganisations []*ServicedOrganisation) (*ctdf.Availability, error)
This is a bit hacky and doesn't seem like the best way of doing it but it works
type Operator ¶
type Operator struct { ID string `xml:"id,attr"` CreationDateTime string `xml:",attr"` ModificationDateTime string `xml:",attr"` NationalOperatorCode string OperatorCode string OperatorShortName string OperatorNameOnLicence string TradingName string LicenceNumber string Garages []Garage `xml:"Garages>Garage"` }
type RouteSection ¶
func (*RouteSection) GetRouteLink ¶
func (r *RouteSection) GetRouteLink(ID string) (*RouteLink, error)
type Service ¶
type Service struct { CreationDateTime string `xml:",attr"` ModificationDateTime string `xml:",attr"` ServiceCode string TicketMachineServiceCode string RegisteredOperatorRef string PublicUse bool OperatingPeriod DateRange Mode string OperatingProfile OperatingProfile // `xml:",innerxml" json:"-" bson:"-"` Lines []Line `xml:"Lines>Line"` //TODO: Handle Flexible service Origin string `xml:"StandardService>Origin"` Destination string `xml:"StandardService>Destination"` UseAllStopPoints string `xml:"StandardService>UseAllStopPoints"` JourneyPatterns []*JourneyPattern `xml:"StandardService>JourneyPattern"` }
type ServicedOrganisation ¶
type ServicedOrganisation struct { ServicedOrganisationClassification string NatureOfOrganisation string PhaseOfEducation string OrganisationCode string Name string Note string WorkingDays DatePattern Holidays DatePattern DateExclusion []string ParentServicedOrganisationRef string }
type TransXChange ¶
type TransXChange struct { FileName string `xml:",attr"` CreationDateTime string `xml:",attr"` ModificationDateTime string `xml:",attr"` StopPoints []*StopPoint Operators []*Operator Routes []*Route Services []*Service JourneyPatternSections []*JourneyPatternSection RouteSections []*RouteSection VehicleJourneys []*VehicleJourney ServicedOrganisations []*ServicedOrganisation SchemaVersion string `xml:",attr"` }
func (*TransXChange) Import ¶
func (doc *TransXChange) Import(dataset datasets.DataSet, datasource *ctdf.DataSourceReference) error
func (*TransXChange) ParseFile ¶
func (transXChange *TransXChange) ParseFile(reader io.Reader) error
func (*TransXChange) Validate ¶
func (doc *TransXChange) Validate() error
type VehicleJourney ¶
type VehicleJourney struct { CreationDateTime string `xml:",attr"` ModificationDateTime string `xml:",attr"` SequenceNumber string `xml:",attr"` PrivateCode string OperatorRef string Direction string GarageRef string VehicleJourneyCode string ServiceRef string LineRef string JourneyPatternRef string DepartureTime string DestinationDisplay string Frequency *struct { EndTime string Interval *struct { ScheduledFrequency string } } Operational struct { TicketMachine struct { JourneyCode string } Block struct { BlockNumber string } } VehicleJourneyTimingLinks []VehicleJourneyTimingLink `xml:"VehicleJourneyTimingLink"` OperatingProfile OperatingProfile // `xml:",innerxml" json:"-" bson:"-"` }
func (*VehicleJourney) GetVehicleJourneyTimingLinkByJourneyPatternTimingLinkRef ¶
func (v *VehicleJourney) GetVehicleJourneyTimingLinkByJourneyPatternTimingLinkRef(ID string) *VehicleJourneyTimingLink
type VehicleJourneyTimingLink ¶
type VehicleJourneyTimingLink struct { ID string `xml:"id,attr"` JourneyPatternTimingLinkRef string RunTime string From JourneyPatternTimingLinkPoint To JourneyPatternTimingLinkPoint }
Click to show internal directories.
Click to hide internal directories.