Documentation
¶
Index ¶
- Constants
- Variables
- func UnixInRange(seconds int64) bool
- func Write(f *Feed, sp WriteStreamProvider) error
- func WriteGOBFile(feed *Feed, path string) error
- func WriteGOBStream(feed *Feed, w io.Writer) error
- func WriteTxtarFile(filename string, feed *Feed) error
- func WriteZip(feed *Feed, wc io.WriteCloser) error
- func WriteZipFile(feed *Feed, path string) error
- type AbsoluteStopTime
- type AbsoluteStopTimes
- type Agencies
- type Agency
- type Area
- type Areas
- type Attribution
- type Attributions
- type BikeInformation
- type Color
- type ConflictBehaviour
- type ContinuousDropOff
- type ContinuousPickup
- type Currency
- type CurrencyCode
- type Date
- func (d Date) Date() (year int, month time.Month, day int)
- func (d Date) Format(layout string) string
- func (d Date) In(loc *time.Location) time.Time
- func (d Date) IsSet() bool
- func (d Date) Local() time.Time
- func (d Date) MarshalText() ([]byte, error)
- func (d *Date) Parse(data string) error
- func (d Date) String() string
- func (d Date) UTC() time.Time
- func (d Date) Unix() int64
- func (d Date) UnixNano() int64
- type DefaultService
- type Direction
- type DropOff
- type DurationLimitType
- type EntityErrors
- type EntityFilter
- type EntitySetErrors
- type ExactTimes
- type FareAttribute
- type FareAttributes
- type FareLegRule
- type FareLegRules
- type FareMedia
- type FareMediaType
- type FareMedias
- type FareProduct
- type FareProducts
- type FareRule
- type FareRules
- type FareTransferRule
- type FareTransferRules
- type FareTransferType
- type Feed
- func NewFeed() *Feed
- func Read(sp ReadStreamProvider, readerOpts ...ReadOpts) (*Feed, error)
- func ReadGOBFile(path string) (*Feed, error)
- func ReadGOBStream(r io.Reader) (*Feed, error)
- func ReadTxtarFile(filename string) (*Feed, error)
- func ReadZipFile(path string, readerOpts ...ReadOpts) (*Feed, error)
- func ReadZipReader(zr *zip.Reader, readerOpts ...ReadOpts) (*Feed, error)
- func (f *Feed) SetAgency(id string, agency *Agency, opts ...Opts) (*Agency, error)
- func (f *Feed) SetArea(id string, area *Area, opts ...Opts) (*Area, error)
- func (f *Feed) SetAttribution(id string, area *Attribution, opts ...Opts) (*Attribution, error)
- func (f *Feed) SetFareAttribute(id string, fareAttribute *FareAttribute, opts ...Opts) (*FareAttribute, error)
- func (f *Feed) SetFareLegRule(id string, fareLegRule *FareLegRule, opts ...Opts) (*FareLegRule, error)
- func (f *Feed) SetFareMedia(id string, fareMedia *FareMedia, opts ...Opts) (*FareMedia, error)
- func (f *Feed) SetFareProduct(id string, fareProduct *FareProduct, opts ...Opts) (*FareProduct, error)
- func (f *Feed) SetFareRule(id string, fareRule *FareRule, opts ...Opts) (*FareRule, error)
- func (f *Feed) SetFareTransferRule(id string, fareTransferRule *FareTransferRule, opts ...Opts) (*FareTransferRule, error)
- func (f *Feed) SetLevel(id string, level *Level, opts ...Opts) (*Level, error)
- func (f *Feed) SetNetwork(id string, network *Network, opts ...Opts) (*Network, error)
- func (f *Feed) SetPathway(id string, pathway *Pathway, opts ...Opts) (*Pathway, error)
- func (f *Feed) SetRoute(id string, route *Route, opts ...Opts) (*Route, error)
- func (f *Feed) SetService(id string, service *Service, opts ...Opts) (*Service, error)
- func (f *Feed) SetShape(id string, shape *Shape, opts ...Opts) (*Shape, error)
- func (f *Feed) SetStop(id string, stop *Stop, opts ...Opts) (*Stop, error)
- func (f *Feed) SetTimeframe(id string, timeframe *Timeframe, opts ...Opts) (*Timeframe, error)
- func (f *Feed) SetTransfer(id string, transfer *Transfer, opts ...Opts) (*Transfer, error)
- func (f *Feed) SetTranslation(id string, translation *Translation, opts ...Opts) (*Translation, error)
- func (f *Feed) SetTrip(id string, trip *Trip, opts ...Opts) (*Trip, error)
- func (f *Feed) Validate(opts ...ValidationOpts) error
- type FeedErrors
- type FeedInfo
- type Frequencies
- type Frequency
- type Level
- type Levels
- type Location
- type Network
- type Networks
- type Opts
- type Pathway
- type PathwayBidirectional
- type PathwayMode
- type Pathways
- type Pattern
- type Patterns
- type PaymentMethod
- type Pickup
- type Point
- type ReadOpts
- func ContinueOnRecordError() ReadOpts
- func IncludeUnreferenced() ReadOpts
- func WithEntityFilter(ef EntityFilter) ReadOpts
- func WithErrorCollector(ec func(e error)) ReadOpts
- func WithLogger(logger *slog.Logger) ReadOpts
- func WithModeFilter(modes ...RouteType) ReadOpts
- func WithOptimseServices(v bool) ReadOpts
- func WithOptimseShapes(v bool) ReadOpts
- type ReadStreamProvider
- type RelativeStopTime
- type RelativeStopTimes
- type Route
- type RouteType
- type Routes
- type Service
- func (s *Service) Copy() *Service
- func (s *Service) Hash() string
- func (fe *Service) ID() string
- func (s *Service) IsActiveOn(date Date) bool
- func (fe *Service) SetAdditionalField(k, v string)
- func (s *Service) SetID(id string, opts ...Opts) error
- func (s *Service) Validate(opts ...ValidationOpts) error
- type ServiceException
- type ServiceExceptionType
- type Services
- type Shape
- type Shapes
- type Stop
- type StopTime
- type Stops
- type Time
- type Timeframe
- type Timeframes
- type TimingPoint
- type Transfer
- func (t *Transfer) FromRoute() *Route
- func (t *Transfer) FromStop() *Stop
- func (t *Transfer) FromTrip() *Trip
- func (t *Transfer) ID() string
- func (fe *Transfer) SetAdditionalField(k, v string)
- func (t *Transfer) ToRoute() *Route
- func (t *Transfer) ToStop() *Stop
- func (t *Transfer) ToTrip() *Trip
- func (t *Transfer) Validate(opts ...ValidationOpts) error
- type TransferLimit
- type TransferType
- type Transfers
- type Translation
- type TranslationTable
- type Translations
- type Trip
- func (t *Trip) AbsoluteStopTimes() AbsoluteStopTimes
- func (fe *Trip) ID() string
- func (t *Trip) Pattern() Pattern
- func (t *Trip) RelativeStopTimes() RelativeStopTimes
- func (t *Trip) Route() *Route
- func (t *Trip) Service() *Service
- func (t *Trip) SetAbsoluteStopTimes(ast AbsoluteStopTimes) error
- func (fe *Trip) SetAdditionalField(k, v string)
- func (t *Trip) SetRelativeStopTimes(rst RelativeStopTimes) error
- func (t *Trip) Shape() *Shape
- func (t *Trip) Validate(opts ...ValidationOpts) error
- type Trips
- type ValidationOpts
- type WheelchairInformation
- type WriteStreamProvider
- type ZipReadProvider
- type ZipWriteProvider
Constants ¶
const ( RouteTypeTram RouteType = iota RouteTypeSubway RouteTypeRail RouteTypeBus RouteTypeFerry RouteTypeCableTram RouteTypeAerialLift RouteTypeFunicular RouteTypeTrolleybus RouteTypeMonorail RouteTypeExtRail = 100 RouteTypeExtHighSpeedRail = 101 RouteTypeExtLongDistanceTrains = 102 RouteTypeExtInterRegionalRailService = 103 RouteTypeExtCarTransportRailService = 104 RouteTypeExtSleeperRailService = 105 RouteTypeExtRegionalRailService = 106 RouteTypeExtTouristRailwayService = 107 RouteTypeExtRailShuttleWithinComplex = 108 RouteTypeExtSuburbanRailway = 109 RouteTypeExtReplacementRailService = 110 RouteTypeExtSpecialRailService = 111 RouteTypeExtLorryTransportRailService = 112 RouteTypeExtAllRailServices = 113 RouteTypeExtCrossCountryRailService = 114 RouteTypeExtVehicleTransportRailService = 115 RouteTypeExtRackAndPinionRailway = 116 RouteTypeExtAdditionalRailService = 117 RouteTypeExtCoachService = 200 RouteTypeExtInternationalCoachService = 201 RouteTypeExtNationalCoachService = 202 RouteTypeExtShuttleCoachService = 203 RouteTypeExtRegionalCoachService = 204 RouteTypeExtSpecialCoachService = 205 RouteTypeExtSightseeingCoachService = 206 RouteTypeExtTouristCoachService = 207 RouteTypeExtCommuterCoachService = 208 RouteTypeExtAllCoachServices = 209 RouteTypeExtUrbanRailwayService = 400 RouteTypeExtMetroService = 401 RouteTypeExtUndergroundService = 402 RouteTypeExtUrbanRailwayService2 = 403 RouteTypeExtAllUrbanRailwayServices = 404 RouteTypeExtMonorail = 405 RouteTypeExtBusService = 700 RouteTypeExtRegionalBusService = 701 RouteTypeExtExpressBusService = 702 RouteTypeExtStoppingBusService = 703 RouteTypeExtLocalBusService = 704 RouteTypeExtNightBusService = 705 RouteTypeExtPostBusService = 706 RouteTypeExtSpecialNeedsBus = 707 RouteTypeExtMobilityBusService = 708 RouteTypeExtMobilityBusForRegisteredDisabled = 709 RouteTypeExtSightseeingBus = 710 RouteTypeExtShuttleBus = 711 RouteTypeExtSchoolBus = 712 RouteTypeExtSchoolAndPublicServiceBus = 713 RouteTypeExtRailReplacementBusService = 714 RouteTypeExtDemandAndResponseBusService = 715 RouteTypeExtAllBusServices = 716 RouteTypeExtTrolleybusService = 800 RouteTypeExtTramService = 900 RouteTypeExtCityTramService = 901 RouteTypeExtLocalTramService = 902 RouteTypeExtRegionalTramService = 903 RouteTypeExtSightseeingTramService = 904 RouteTypeExtShuttleTramService = 905 RouteTypeExtAllTramServices = 906 RouteTypeExtWaterTransportService = 1000 RouteTypeExtAirService = 1100 RouteTypeExtFerryService = 1200 RouteTypeExtAerialLiftService = 1300 RouteTypeExtTelecabinService = 1301 RouteTypeExtCableCarService = 1302 RouteTypeExtElevatorService = 1303 RouteTypeExtChairLiftService = 1304 RouteTypeExtDragLiftService = 1305 RouteTypeExtSmallTelecabinService = 1306 RouteTypeExtAllTelecabinServices = 1307 RouteTypeExtFunicularService = 1400 RouteTypeExtTaxiService = 1500 RouteTypeExtCommunalTaxiService = 1501 RouteTypeExtWaterTaxiService = 1502 RouteTypeExtRailTaxiService = 1503 RouteTypeExtBikeTaxiService = 1504 RouteTypeExtLicensedTaxiService = 1505 RouteTypeExtPrivateHireServiceVehicle = 1506 RouteTypeExtAllTaxiServices = 1507 RouteTypeExtMiscellaneousService = 1700 RouteTypeExtHorseDrawnCarriage = 1702 )
const (
GTFSDateFormat = "20060102"
)
Format constants, for use with Parse and the Date.Format method.
Variables ¶
var ErrDuplicateEntity = fmt.Errorf("duplicate entity")
var ErrEmptySet = errors.New("empty set")
var ErrEmptyShape = errors.New("empty shape")
var ErrEntityAlreadySet = fmt.Errorf("entity already set, use Copy() to get a copy of the entity")
var ErrEnumOutOfRange = errors.New("enum out of range")
var ErrInvalidColor = errors.New("invalid color")
var ErrInvalidCurrencyCode = errors.New("invalid currency code")
var ErrInvalidDistanceTraveled = errors.New("invalid distance travelled")
var ErrInvalidEnumValue = errors.New("invalid enum value")
var ErrInvalidExactTime = errors.New("invalid exact_times")
var ErrInvalidSequence = errors.New("invalid sequence")
var ErrInvalidService = errors.New("invalid service")
var ErrInvalidTime = errors.New("invalid time")
var ErrInvalidTimePoint = errors.New("invalid timepoint")
var ErrKeyIDMismatch = errors.New("key and id mismatch")
var ErrMissingCSVColumn = fmt.Errorf("missing csv column")
var ErrMissingRequiredField = errors.New("missing required field")
var ErrNilEntity = fmt.Errorf("nil entity")
var ErrOutOfRange = errors.New("epochdate: dates must be in the range [1970-01-01,2149-06-06]")
ErrOutOfRange is returned if the input date is not a representable Date.
var ErrStationWithParentStation = errors.New("stations cannot have a parent station")
var ErrStreamNotFound = fmt.Errorf("file not found")
var ErrTripMissingStopTimes = errors.New("trip missing stop times")
Functions ¶
func UnixInRange ¶
UnixInRange is true if the provided Unix timestamp is in Date's representable range. The timestamp is interpreted according to the semantics used by NewFromUnix. You probably won't need to use this, since this will only return false if NewFromUnix returns an error of ErrOutOfRange.
func Write ¶
func Write(f *Feed, sp WriteStreamProvider) error
func WriteGOBFile ¶
func WriteTxtarFile ¶
WriteTxtarFile writes a feed to a txtar file. Useful for creating unit tests.
func WriteZipFile ¶
Types ¶
type AbsoluteStopTime ¶
func (*AbsoluteStopTime) SetAdditionalField ¶
func (fe *AbsoluteStopTime) SetAdditionalField(k, v string)
type AbsoluteStopTimes ¶
type AbsoluteStopTimes []AbsoluteStopTime
type Agencies ¶
func (*Agencies) Validate ¶
func (a *Agencies) Validate(opts ...ValidationOpts) error
type Agency ¶
type Agency struct { Name string // Required. Full name of the transit agency. URL string // Required. URL of the transit agency. Timezone string // Required. Timezone where the transit agency is located. If multiple agencies are specified in the dataset, each must have the same agency_timezone. Lang string // Optional. Primary language used by this transit agency. Should be provided to help GTFS consumers choose capitalization rules and other language-specific settings for the dataset. Phone string // Optional. A voice telephone number for the specified agency. This field is a string value that presents the telephone number as typical for the agency's service area. It may contain punctuation marks to group the digits of the number. Dialable text (for example, TriMet's "503-238-RIDE") is permitted, but the field must not contain any other descriptive text. FareURL string // Optional. URL of a web page that allows a rider to purchase tickets or other fare instruments for that agency online. Email string // Optional. Email address actively monitored by the agency’s customer service department. This email address should be a direct contact point where transit riders can reach a customer service representative at the agency. // contains filtered or unexported fields }
func (*Agency) SetAdditionalField ¶
func (fe *Agency) SetAdditionalField(k, v string)
func (*Agency) Validate ¶
func (a *Agency) Validate(opts ...ValidationOpts) error
type Area ¶
type Area struct { Name string // Optional // contains filtered or unexported fields }
func (*Area) SetAdditionalField ¶
func (fe *Area) SetAdditionalField(k, v string)
func (*Area) Validate ¶
func (a *Area) Validate(opts ...ValidationOpts) error
type Attribution ¶
type Attribution struct { AgencyID string // Optional RouteID string // Optional TripID string // Optional OrganizationName string // Required IsProducer bool // Optional IsOperator bool // Optional IsAuthority bool // Optional URL string // Optional Email string // Optional Phone string // Optional // contains filtered or unexported fields }
func (*Attribution) Agency ¶
func (a *Attribution) Agency() *Agency
func (*Attribution) Route ¶
func (a *Attribution) Route() *Route
func (*Attribution) SetAdditionalField ¶
func (fe *Attribution) SetAdditionalField(k, v string)
func (*Attribution) Trip ¶
func (a *Attribution) Trip() *Trip
func (*Attribution) Validate ¶
func (a *Attribution) Validate() error
type Attributions ¶
type Attributions map[string]*Attribution
func (*Attributions) Validate ¶
func (a *Attributions) Validate() error
type BikeInformation ¶
type BikeInformation int
const ( BikesNoInformation BikeInformation = iota BikesAllowed BikesNotAllowed )
func (*BikeInformation) Parse ¶
func (bi *BikeInformation) Parse(s string) error
func (BikeInformation) String ¶
func (bi BikeInformation) String() string
func (*BikeInformation) Validate ¶
func (bi *BikeInformation) Validate() error
type Color ¶
type Color uint32
A color encoded as a six-digit hexadecimal number. Refer to https://htmlcolorcodes.com to generate a valid value (the leading "#" must not be included). Example: FFFFFF for white, 000000 for black or 0039A6 for the A,C,E lines in NYMTA.
type ConflictBehaviour ¶
type ConflictBehaviour uint8
const ( ConflictError ConflictBehaviour = iota ConflictIgnore ConflictOverwrite )
type ContinuousDropOff ¶
type ContinuousDropOff int8
const ( ContinuousDropOffRegular ContinuousDropOff = iota ContinuousDropOffNotAllowed ContinuousDropOffMustPhone ContinuousDropOffMustCoordinate )
func (*ContinuousDropOff) Parse ¶
func (p *ContinuousDropOff) Parse(text string) error
func (ContinuousDropOff) String ¶
func (p ContinuousDropOff) String() string
func (ContinuousDropOff) Validate ¶
func (p ContinuousDropOff) Validate() error
type ContinuousPickup ¶
type ContinuousPickup int8
const ( ContinuousPickupRegular ContinuousPickup = iota ContinuousPickupNotAllowed ContinuousPickupMustPhone ContinuousPickupMustCoordinate )
func (*ContinuousPickup) Parse ¶
func (p *ContinuousPickup) Parse(text string) error
func (ContinuousPickup) String ¶
func (p ContinuousPickup) String() string
func (ContinuousPickup) Validate ¶
func (p ContinuousPickup) Validate() error
type CurrencyCode ¶
type CurrencyCode string
func (*CurrencyCode) Validate ¶
func (c *CurrencyCode) Validate() error
type Date ¶
type Date uint16
Date stores the number of days since Jan 1, 1970. The last representable date is June 6, 2149.
func NewFromDate ¶
NewFromDate returns a Date value corresponding to the supplied year, month, and day.
func NewFromTime ¶
NewFromTime returns a Date equivalent to NewFromDate(t.Date()), where t is a time.Time object.
func NewFromUnix ¶
NewFromUnix creates a Date from a Unix timestamp, relative to any location Specifically, if you pass in t.Unix(), where t is a time.Time value with a non-UTC zone, you may receive an unexpected Date. Unless this behavior is specifically desired (returning the date in one location at the given time instant in another location), it's best to use epochdate.NewFromTime(t), which normalizes the resulting Date value by adjusting for zone offsets.
func Parse ¶
Parse follows the same semantics as time.Parse, but ignores time-of-day information and returns a Date value.
func Today ¶
func Today() Date
Today returns the local date at this instant. If the local date does not fall within the representable range, then then zero value will be returned (1970-01-01).
func TodayUTC ¶
func TodayUTC() Date
TodayUTC returns the date at this instant, relative to UTC. If the UTC date does not fall within the representable range, then then zero value will be returned (1970-01-01).
func (Date) Date ¶
Date is semantically identical to the behavior of t.Date(), where t is a time.Time value.
func (Date) Format ¶
Format is identical to time.Time.Format, except that any time-of-day format specifiers that are used will be equivalent to "00:00:00Z".
func (Date) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
type DefaultService ¶
type DefaultService struct { Monday bool // Required Indicates whether the service operates on all Mondays in the date range specified by the start_date and end_date fields. Note that exceptions for particular dates may be listed in calendar_dates.txt. Valid options are: Tuesday bool // Required Functions in the same way as monday except applies to Tuesdays Wednesday bool // Required Functions in the same way as monday except applies to Wednesdays Thursday bool // Required Functions in the same way as monday except applies to Thursdays Friday bool // Required Functions in the same way as monday except applies to Fridays Saturday bool // Required Functions in the same way as monday except applies to Saturdays. Sunday bool // Required Functions in the same way as monday except applies to Sundays. StartDate Date // Required Start service day for the service interval. EndDate Date // Required End service day for the service interval. This service day is included in the interval. }
func (*DefaultService) Validate ¶
func (ds *DefaultService) Validate(opts ...ValidationOpts) error
type DurationLimitType ¶
type DurationLimitType int
const ( DurationLimitTypeUnset DurationLimitType = iota - 1 DurationLimitTypeDepartureArrival DurationLimitTypeDepartureDeparture DurationLimitTypeArrivalDeparture DurationLimitTypeArrivalArrival )
func (*DurationLimitType) Parse ¶
func (dlt *DurationLimitType) Parse(text string) error
func (DurationLimitType) String ¶
func (dlt DurationLimitType) String() string
func (DurationLimitType) Validate ¶
func (dlt DurationLimitType) Validate() error
type EntityErrors ¶
type EntityErrors []error
func (*EntityErrors) Add ¶
func (r *EntityErrors) Add(err error)
func (EntityErrors) Error ¶
func (r EntityErrors) Error() string
func (EntityErrors) Unwrap ¶
func (r EntityErrors) Unwrap() []error
type EntityFilter ¶
type EntitySetErrors ¶
type EntitySetErrors map[string]EntityErrors
func (EntitySetErrors) Error ¶
func (r EntitySetErrors) Error() string
func (*EntitySetErrors) Set ¶
func (r *EntitySetErrors) Set(id string, err EntityErrors)
func (EntitySetErrors) Unwrap ¶
func (r EntitySetErrors) Unwrap() []error
type ExactTimes ¶
type ExactTimes bool
func (*ExactTimes) Parse ¶
func (et *ExactTimes) Parse(text string) error
func (ExactTimes) String ¶
func (et ExactTimes) String() string
type FareAttribute ¶
type FareAttribute struct { Price Currency //Required Fare price, in the unit specified by currency_type. CurrencyType string //Required Currency used to pay the fare. PaymentMethod PaymentMethod //Required Indicates when the fare must be paid. Valid options are: Transfers TransferLimit //Required Indicates the number of transfers permitted on this fare. Valid options are: AgencyID string //Conditionally Required Identifies the relevant agency for a fare. TransferDuration int //Optional Length of time in seconds before a transfer expires. When transfers=0 this field may be used to indicate how long a ticket is valid for or it may be left empty. // contains filtered or unexported fields }
func (*FareAttribute) Agency ¶
func (a *FareAttribute) Agency() *Agency
func (*FareAttribute) SetAdditionalField ¶
func (fe *FareAttribute) SetAdditionalField(k, v string)
func (*FareAttribute) Validate ¶
func (a *FareAttribute) Validate(opts ...ValidationOpts) error
type FareAttributes ¶
type FareAttributes map[string]*FareAttribute
func (*FareAttributes) Validate ¶
func (a *FareAttributes) Validate(opts ...ValidationOpts) error
type FareLegRule ¶
type FareLegRule struct { LegGroupID string // Optional Identifies a group of entries in fare_leg_rules.txt. NetworkID string // Optional Identifies a route network that applies for the fare leg rule. FromAreaID string // Optional Identifies a departure area. ToAreaID string // Optional Identifies an arrival area. FromTimeframeGroupID string // Optional Defines the timeframe for the fare validation event at the start of the fare leg. ToTimeframeGroupID string // Optional Defines the timeframe for the fare validation event at the end of the fare leg. FareProductID string // Required The fare product required to travel the leg. // contains filtered or unexported fields }
func (*FareLegRule) ID ¶
func (f *FareLegRule) ID() string
func (*FareLegRule) SetAdditionalField ¶
func (fe *FareLegRule) SetAdditionalField(k, v string)
func (*FareLegRule) Validate ¶
func (f *FareLegRule) Validate(opts ...ValidationOpts) error
type FareLegRules ¶
type FareLegRules map[string]*FareLegRule
func (*FareLegRules) Validate ¶
func (f *FareLegRules) Validate(opts ...ValidationOpts) error
type FareMedia ¶
type FareMedia struct { Name string //Optional Name of the fare media. Type FareMediaType //Required The type of fare media. Valid options are: // contains filtered or unexported fields }
func (*FareMedia) SetAdditionalField ¶
func (fe *FareMedia) SetAdditionalField(k, v string)
func (*FareMedia) Validate ¶
func (fm *FareMedia) Validate(opts ...ValidationOpts) error
type FareMediaType ¶
type FareMediaType int8
const ( FareMediaTypeNone FareMediaType = iota FareMediaTypePaperTicket FareMediaTypeTransitCard FareMediaTypeCEMV FareMediaTypeMobileApp )
func (*FareMediaType) Parse ¶
func (fmt *FareMediaType) Parse(text string) error
func (FareMediaType) String ¶
func (fmt FareMediaType) String() string
func (FareMediaType) Validate ¶
func (fmt FareMediaType) Validate() error
type FareMedias ¶
func (*FareMedias) Validate ¶
func (fm *FareMedias) Validate(opts ...ValidationOpts) error
type FareProduct ¶
type FareProduct struct { Name string //Optional The name of the fare product as displayed to riders. ProductID string //Required Identifies a fare product. MediaID string //Optional Identifies a fare media that can be employed to use the fare product during the trip. When fare_media_id is empty, it is considered that the fare media is unknown. Amount Currency //Required The cost of the fare product. May be negative to represent transfer discounts. May be zero to represent a fare product that is free. Currency CurrencyCode //Required The currency of the cost of the fare product. // contains filtered or unexported fields }
func (*FareProduct) FareMedia ¶
func (fp *FareProduct) FareMedia() *FareMedia
func (*FareProduct) ID ¶
func (fp *FareProduct) ID() string
func (*FareProduct) SetAdditionalField ¶
func (fe *FareProduct) SetAdditionalField(k, v string)
func (*FareProduct) Validate ¶
func (fp *FareProduct) Validate(opts ...ValidationOpts) error
type FareProducts ¶
type FareProducts map[string]*FareProduct
func (*FareProducts) Validate ¶
func (fp *FareProducts) Validate(opts ...ValidationOpts) error
type FareRule ¶
type FareRule struct { FareID string //Required Identifies a fare class. RouteID string //Optional Identifies a route associated with the fare class. If several routes with the same fare attributes exist, create a record in fare_rules.txt for each route. OriginID string //Optional Identifies an origin zone. If a fare class has multiple origin zones, create a record in fare_rules.txt for each origin_id. DestinationID string //Optional Identifies a destination zone. If a fare class has multiple destination zones, create a record in fare_rules.txt for each destination_id. ContainsID string //Optional Identifies the zones that a rider will enter while using a given fare class. Used in some systems to calculate correct fare class. // contains filtered or unexported fields }
func (*FareRule) SetAdditionalField ¶
func (fe *FareRule) SetAdditionalField(k, v string)
func (*FareRule) Validate ¶
func (fr *FareRule) Validate(opts ...ValidationOpts) error
type FareRules ¶
func (*FareRules) Validate ¶
func (fr *FareRules) Validate(opts ...ValidationOpts) error
type FareTransferRule ¶
type FareTransferRule struct { FromLegGroupID string //Optional - Foreign ID referencing fare_leg_rules.leg_group_id ToLegGroupID string //Optional - Foreign ID referencing fare_leg_rules.leg_group_id TransferCount int //Conditionally Forbidden - Non-zero integer DurationLimit int //Optional - Positive integer DurationLimitType DurationLimitType //Conditionally Required - Enum FareTransferType FareTransferType //Required - Enum FareProductID string //Optional - Foreign ID referencing fare_products.fare_product_id // contains filtered or unexported fields }
func (*FareTransferRule) ID ¶
func (ftr *FareTransferRule) ID() string
ID built from from_leg_group_id, to_leg_group_id, fare_product_id, transfer_count, duration_limit
func (*FareTransferRule) SetAdditionalField ¶
func (fe *FareTransferRule) SetAdditionalField(k, v string)
func (*FareTransferRule) Validate ¶
func (ftr *FareTransferRule) Validate(opts ...ValidationOpts) error
type FareTransferRules ¶
type FareTransferRules map[string]*FareTransferRule
func (*FareTransferRules) Validate ¶
func (ftr *FareTransferRules) Validate(opts ...ValidationOpts) error
type FareTransferType ¶
type FareTransferType int
see https://org/schedule/reference/#fare_transfer_rulestxt
const ( FareTransferTypeAplusAB FareTransferType = iota FareTransferTypeAplusABplusB FareTransferTypeAB )
func (*FareTransferType) Parse ¶
func (ftt *FareTransferType) Parse(text string) error
func (FareTransferType) String ¶
func (ftt FareTransferType) String() string
func (FareTransferType) Validate ¶
func (ftt FareTransferType) Validate() error
type Feed ¶
type Feed struct { Agencies Agencies Attributions Attributions Areas Areas Stops Stops Routes Routes Trips Trips Levels Levels Shapes Shapes Services Services Patterns Patterns Pathways Pathways Networks Networks FareAttributes FareAttributes FareRules FareRules FareTransferRules FareTransferRules FareMedias FareMedias FareProducts FareProducts FareLegRules FareLegRules Transfers Transfers Timeframes Timeframes Translations Translations FeedInfo *FeedInfo }
func ReadGOBFile ¶
func ReadTxtarFile ¶
ReadTxtarFile reads a feed from a txtar file. Useful in unit tests.
func (*Feed) SetAttribution ¶
func (f *Feed) SetAttribution(id string, area *Attribution, opts ...Opts) (*Attribution, error)
func (*Feed) SetFareAttribute ¶
func (f *Feed) SetFareAttribute(id string, fareAttribute *FareAttribute, opts ...Opts) (*FareAttribute, error)
func (*Feed) SetFareLegRule ¶
func (f *Feed) SetFareLegRule(id string, fareLegRule *FareLegRule, opts ...Opts) (*FareLegRule, error)
func (*Feed) SetFareMedia ¶
func (*Feed) SetFareProduct ¶
func (f *Feed) SetFareProduct(id string, fareProduct *FareProduct, opts ...Opts) (*FareProduct, error)
func (*Feed) SetFareRule ¶
func (*Feed) SetFareTransferRule ¶
func (f *Feed) SetFareTransferRule(id string, fareTransferRule *FareTransferRule, opts ...Opts) (*FareTransferRule, error)
func (*Feed) SetNetwork ¶
func (*Feed) SetPathway ¶
func (*Feed) SetService ¶
func (*Feed) SetTimeframe ¶
func (*Feed) SetTransfer ¶
func (*Feed) SetTranslation ¶
func (f *Feed) SetTranslation(id string, translation *Translation, opts ...Opts) (*Translation, error)
func (*Feed) Validate ¶
func (f *Feed) Validate(opts ...ValidationOpts) error
type FeedErrors ¶
type FeedErrors map[string]EntitySetErrors
func (FeedErrors) Error ¶
func (r FeedErrors) Error() string
func (*FeedErrors) Set ¶
func (r *FeedErrors) Set(id string, err EntitySetErrors)
type FeedInfo ¶
type FeedInfo struct { PublisherName string // Required. Full name of the organization that publishes the dataset. This may be the same as one of the agency.agency_name values. PublisherURL string // Required. URL of the dataset publishing organization's website. This may be the same as one of the agency.agency_url values. Lang string // Required. Default language used for the text in this dataset. This setting helps GTFS consumers choose capitalization rules and other language-specific settings for the dataset. The file translations.txt can be used if the text needs to be translated into languages other than the default one. DefaultLang string // Optional. Defines the language that should be used when the data consumer doesn’t know the language of the rider. It will often be en (English). StartDate Date // Recommended. The dataset provides complete and reliable schedule information for service in the period from the beginning of the feed_start_date day to the end of the feed_end_date day. Both days may be left empty if unavailable. The feed_end_date date must not precede the feed_start_date date if both are given. It is recommended that dataset providers give schedule data outside this period to advise of likely future service, but dataset consumers should treat it mindful of its non-authoritative status. If feed_start_date or feed_end_date extend beyond the active calendar dates defined in calendar.txt and calendar_dates.txt, the dataset is making an explicit assertion that there is no service for dates within the feed_start_date or feed_end_date range but not included in the active calendar dates. EndDate Date // Recommended. (see above) Version string // Recommended. String that indicates the current version of their GTFS dataset. GTFS-consuming applications can display this value to help dataset publishers determine whether the latest dataset has been incorporated. ContactEmail string // Optional. Email address for communication regarding the GTFS dataset and data publishing practices. feed_contact_email is a technical contact for GTFS-consuming applications. Provide customer service contact information through agency.txt. It's recommended that at least one of feed_contact_email or feed_contact_url are provided. ContactURL string // Optional. URL for contact information, a web-form, support desk, or other tools for communication regarding the GTFS dataset and data publishing practices. feed_contact_url is a technical contact for GTFS-consuming applications. Provide customer service contact information through agency.txt. It's recommended that at least one of feed_contact_url or feed_contact_email are provided. }
func (*FeedInfo) Validate ¶
func (f *FeedInfo) Validate(opts ...ValidationOpts) error
type Frequencies ¶
type Frequencies []Frequency
func (*Frequencies) Validate ¶
func (f *Frequencies) Validate() error
type Frequency ¶
type Frequency struct { StartTime Time EndTime Time HeadwaySecs int ExactTimes ExactTimes }
type Level ¶
func (*Level) SetAdditionalField ¶
func (fe *Level) SetAdditionalField(k, v string)
func (*Level) Validate ¶
func (l *Level) Validate(opts ...ValidationOpts) error
type Network ¶
type Network struct { Name string // Optional // contains filtered or unexported fields }
func (*Network) SetAdditionalField ¶
func (fe *Network) SetAdditionalField(k, v string)
func (*Network) Validate ¶
func (n *Network) Validate(opts ...ValidationOpts) error
type Networks ¶
func (*Networks) Validate ¶
func (n *Networks) Validate(opts ...ValidationOpts) error
type Opts ¶
type Opts func(*setOpts)
func WithConflictBehaviour ¶
func WithConflictBehaviour(conflictBehaviour ConflictBehaviour) Opts
type Pathway ¶
type Pathway struct { FromStopID string // Required ToStopID string // Required PathwayMode PathwayMode // Required IsBidirectional PathwayBidirectional // Required Length float64 // Optional TraversalTime int // Optional StairCount int // Optional MaxSlope float64 // Optional MinWidth float64 // Optional SignpostedAs string // Optional ReversedSignpostedAs string // Optional // contains filtered or unexported fields }
func (*Pathway) SetAdditionalField ¶
func (fe *Pathway) SetAdditionalField(k, v string)
func (*Pathway) Validate ¶
func (p *Pathway) Validate(opts ...ValidationOpts) error
type PathwayBidirectional ¶
type PathwayBidirectional bool
func (*PathwayBidirectional) Parse ¶
func (p *PathwayBidirectional) Parse(text string) error
func (PathwayBidirectional) String ¶
func (p PathwayBidirectional) String() string
type PathwayMode ¶
type PathwayMode int
const ( PathwayModeWalkway PathwayMode = iota + 1 PathwayModeStairs PathwayModeMovingSidewalk PathwayModeEscalator PathwayModeElevator PathwayModeFareGate PathwayModeExitGate )
func (*PathwayMode) Parse ¶
func (p *PathwayMode) Parse(text string) error
func (PathwayMode) String ¶
func (p PathwayMode) String() string
func (PathwayMode) Validate ¶
func (p PathwayMode) Validate() error
type Pathways ¶
func (*Pathways) Validate ¶
func (p *Pathways) Validate(opts ...ValidationOpts) error
type Pattern ¶
type Pattern []RelativeStopTime
func (*Pattern) Validate ¶
func (p *Pattern) Validate(opts ...ValidationOpts) error
type Patterns ¶
func (*Patterns) Validate ¶
func (p *Patterns) Validate(opts ...ValidationOpts) error
type PaymentMethod ¶
type PaymentMethod int
const ( PaymentMethodOnBoard PaymentMethod = iota PaymentMethodBeforeBoarding )
func (*PaymentMethod) Parse ¶
func (m *PaymentMethod) Parse(text string) error
func (PaymentMethod) String ¶
func (m PaymentMethod) String() string
func (PaymentMethod) Validate ¶
func (m PaymentMethod) Validate() error
type ReadOpts ¶
type ReadOpts func(*csvReader)
func ContinueOnRecordError ¶
func ContinueOnRecordError() ReadOpts
func IncludeUnreferenced ¶
func IncludeUnreferenced() ReadOpts
IncludeUnreferenced includes records that are not referenced by any route or trip
func WithEntityFilter ¶
func WithEntityFilter(ef EntityFilter) ReadOpts
func WithErrorCollector ¶
func WithLogger ¶
func WithModeFilter ¶
func WithOptimseServices ¶
func WithOptimseShapes ¶
type ReadStreamProvider ¶
type ReadStreamProvider interface {
ReadStream(filename string) (io.ReadCloser, error)
}
type RelativeStopTime ¶
func (*RelativeStopTime) SetAdditionalField ¶
func (fe *RelativeStopTime) SetAdditionalField(k, v string)
func (*RelativeStopTime) Validate ¶
func (rst *RelativeStopTime) Validate() error
type RelativeStopTimes ¶
type RelativeStopTimes struct { ArrivalTime Time //the absolute start time of the trip StopTimes []RelativeStopTime }
type Route ¶
type Route struct { ShortName string // Conditionally Required Short name of a route. Often a short, abstract identifier (e.g., "32", "100X", "Green") that riders use to identify a route. Both route_short_name and route_long_name may be defined. LongName string // Conditionally Required Full name of a route. This name is generally more descriptive than the route_short_name and often includes the route's destination or stop. Both route_short_name and route_long_name may be defined. Desc string // Optional Description of a route that provides useful, quality information. Should not be a duplicate of route_short_name or route_long_name. Type RouteType // Required Indicates the type of transportation used on a route. Valid options are: 1 URL string // Optional URL of a web page about the particular route. Should be different from the agency.agency_url value. Color Color // Optional Route color designation that matches public facing material. Defaults to white (FFFFFF) when omitted or left empty. The color difference between route_color and route_text_color should provide sufficient contrast when viewed on a black and white screen. TextColor Color // Optional Legible color to use for text drawn against a background of route_color. Defaults to black (000000) when omitted or left empty. The color difference between route_color and route_text_color should provide sufficient contrast when viewed on a black and white screen. SortOrder uint // Optional Orders the routes in a way which is ideal for presentation to customers. Routes with smaller route_sort_order values should be displayed first. ContinuousPickup ContinuousPickup // Optional Indicates that the rider can board the transit vehicle at any point along the vehicle’s travel path as described by shapes.txt, on every trip of the route. ContinuousDropOff ContinuousDropOff // Optional Indicates that the rider can alight from the transit vehicle at any point along the vehicle’s travel path as described by shapes.txt, on every trip of the route. NetworkID string // Optional Identifies a group of routes. Multiple rows in routes.txt may have the same network_id. NetworkIDs []string AgencyID string // Optional // contains filtered or unexported fields }
func (*Route) SetAdditionalField ¶
func (fe *Route) SetAdditionalField(k, v string)
func (*Route) Validate ¶
func (r *Route) Validate(opts ...ValidationOpts) error
type Service ¶
type Service struct { DefaultService *DefaultService Exceptions []ServiceException // contains filtered or unexported fields }
func (*Service) IsActiveOn ¶
func (*Service) SetAdditionalField ¶
func (fe *Service) SetAdditionalField(k, v string)
func (*Service) Validate ¶
func (s *Service) Validate(opts ...ValidationOpts) error
type ServiceException ¶
type ServiceException struct { Date Date // Required The date field specifies a particular date when service availability is different than the norm. You can use the exception_type field to indicate whether service is available on the specified date. ExceptionType ServiceExceptionType }
func (*ServiceException) Validate ¶
func (se *ServiceException) Validate(opts ...ValidationOpts) error
type ServiceExceptionType ¶
type ServiceExceptionType uint8
const ( ServiceExceptionAdded ServiceExceptionType = iota + 1 ServiceExceptionRemoved )
func (*ServiceExceptionType) Parse ¶
func (s *ServiceExceptionType) Parse(text string) error
func (ServiceExceptionType) String ¶
func (s ServiceExceptionType) String() string
func (ServiceExceptionType) Validate ¶
func (s ServiceExceptionType) Validate() error
type Services ¶
func (*Services) Validate ¶
func (s *Services) Validate(opts ...ValidationOpts) error
type Shape ¶
type Shape struct { Points []Point // contains filtered or unexported fields }
func (*Shape) SetAdditionalField ¶
func (fe *Shape) SetAdditionalField(k, v string)
func (*Shape) Validate ¶
func (s *Shape) Validate(opts ...ValidationOpts) error
type Stop ¶
type Stop struct { Code string // Optional. Short text or a number that identifies the location for riders. These codes are often used in phone-based transit information systems or printed on signage to make it easier for riders to get information for a particular location. The stop_code may be the same as stop_id if it is public facing. This field should be left empty for locations without a code presented to riders. Name string // Required. Name of the location. The stop_name should match the name of the location displayed to riders. For translations into other languages, use translations.txt. TTSName string // Optional. Readable version of the stop_name. See "Text-to-speech field" in the Term Definitions for more. Desc string // Optional. Description of the location that provides useful, quality information. Should not be a duplicate of stop_name. Lat *float64 // Required. Latitude of the location. Lon *float64 // Required. Longitude of the location. ZoneID string // Optional. Identifies the fare zone for a stop. If this record represents a station or station entrance, the zone_id is ignored. URL string // Optional. URL of a web page about the location. This should be different from the agency.agency_url and the routes.route_url field values. LocationType Location // Optional. Location type. Valid options are: ParentStationID string // Optional. Defines hierarchy between the different locations defined in stops.txt. It contains the ID of the parent location, as followed: Timezone string // Optional. Timezone of the location. If the location has a parent station, it inherits the parent station’s timezone instead of applying its own. Stations and parentless stops with empty stop_timezone inherit the timezone specified by agency.agency_timezone. If stop_timezone values are provided, the times in stop_times.txt should be entered as the time since midnight in the timezone specified by agency.agency_timezone. This ensures that the time values in a trip always increase over the course of a trip, regardless of which timezones the trip crosses. WheelchairBoarding WheelchairInformation // Optional. Indicates whether wheelchair boardings are possible from the location. Valid options are: LevelID string // Optional. Level of the location. The same level may be used by multiple unlinked stations. PlatformCode string // Optional. Platform identifier for a platform stop (a stop belonging to a station). This should be just the platform identifier (eg. "G" or "3"). Words like “platform” or "track" (or the feed’s language-specific equivalent) should not be included. This allows feed consumers to more easily internationalize and localize the platform identifier into other languages. AreaIDs []string // Optional. List of child locations id's which belong to this location. A child location may belong to multiple parent locations. // contains filtered or unexported fields }
func (*Stop) ParentStation ¶
func (*Stop) SetAdditionalField ¶
func (fe *Stop) SetAdditionalField(k, v string)
func (*Stop) Validate ¶
func (s *Stop) Validate(opts ...ValidationOpts) error
type StopTime ¶
type StopTime struct { StopSequence int StopID string TripID string StopHeadsign string PickupType Pickup DropoffType DropOff ContinuousPickup ContinuousPickup ContinuousDropoff ContinuousDropOff ShapeDistTraveled float64 Timepoint TimingPoint // contains filtered or unexported fields }
func (*StopTime) SetAdditionalField ¶
func (fe *StopTime) SetAdditionalField(k, v string)
type Time ¶
func (Time) MarshalText ¶
type Timeframe ¶
type Timeframe struct { GroupID string //Required Identifies a timeframe or set of timeframes. StartTime Time //Conditionally Required Defines the beginning of a timeframe. The interval includes the start time. EndTime Time //Conditionally Required Defines the end of a timeframe. The interval does not include the end time. ServiceID string //Required Identifies a set of dates that a timeframe is in effect. // contains filtered or unexported fields }
func (*Timeframe) SetAdditionalField ¶
func (fe *Timeframe) SetAdditionalField(k, v string)
func (*Timeframe) Validate ¶
func (tf *Timeframe) Validate(opts ...ValidationOpts) error
type Timeframes ¶
func (*Timeframes) Validate ¶
func (tf *Timeframes) Validate(opts ...ValidationOpts) error
type TimingPoint ¶
type TimingPoint bool
func (*TimingPoint) Parse ¶
func (tp *TimingPoint) Parse(text string) error
func (TimingPoint) String ¶
func (tp TimingPoint) String() string
type Transfer ¶
type Transfer struct { FromStopID string // Conditionally Required ToStopID string // Conditionally Required FromRouteID string // Optional ToRouteID string // Optional FromTripID string // Conditionally Required ToTripID string // Conditionally Required TransferType TransferType // Required MinTransferTime int // Optional // contains filtered or unexported fields }
func (*Transfer) SetAdditionalField ¶
func (fe *Transfer) SetAdditionalField(k, v string)
func (*Transfer) Validate ¶
func (t *Transfer) Validate(opts ...ValidationOpts) error
type TransferLimit ¶
type TransferLimit int
const ( TransferLimitUnlimited TransferLimit = iota - 1 TransferLimitNone TransferLimitOnce TransferLimitTwice )
func (*TransferLimit) Parse ¶
func (tl *TransferLimit) Parse(text string) error
func (TransferLimit) String ¶
func (tl TransferLimit) String() string
func (TransferLimit) Validate ¶
func (tl TransferLimit) Validate() error
type TransferType ¶
type TransferType int
const ( TransferTypeRecommendedTransferPoint TransferType = iota TransferTypeTimedTransferPoint TransferTypeMinimumTransferTime TransferTypeNoTransfers TransferTypeInSeatTransfer TransferTypeNoInSeatTransfer )
func (*TransferType) Parse ¶
func (p *TransferType) Parse(text string) error
func (TransferType) String ¶
func (p TransferType) String() string
func (TransferType) Validate ¶
func (p TransferType) Validate() error
type Transfers ¶
func (*Transfers) Validate ¶
func (t *Transfers) Validate(opts ...ValidationOpts) error
type Translation ¶
type Translation struct { TableName TranslationTable // Required Defines the table that contains the field to be translated. Allowed values are: FieldName string // Required Name of the field to be translated. Fields with type Text may be translated, fields with type URL, Email and Phone number may also be “translated” to provide resources in the correct language. Fields with other types should not be translated. Language string // Required Language of translation. Translation string // Required Translated value. RecordID string // Conditionally Required Defines the record that corresponds to the field to be translated. The value in record_id must be the first or only field of a table's primary key, as defined in the primary key attribute for each table and below: RecordSubID string // Conditionally Required Helps the record that contains the field to be translated when the table doesn’t have a unique ID. Therefore, the value in record_sub_id is the secondary ID of the table, as defined by the table below: FieldValue string // Conditionally Required Instead of defining which record should be translated by using record_id and record_sub_id, this field can be used to define the value which should be translated. When used, the translation will be applied when the fields identified by table_name and field_name contains the exact same value defined in field_value. // contains filtered or unexported fields }
func (*Translation) ID ¶
func (t *Translation) ID() string
func (*Translation) SetAdditionalField ¶
func (fe *Translation) SetAdditionalField(k, v string)
func (*Translation) Validate ¶
func (t *Translation) Validate(opts ...ValidationOpts) error
type TranslationTable ¶
type TranslationTable string
const ( TranslationTableAgency TranslationTable = "agency" TranslationTableStops TranslationTable = "stops" TranslationTableRoutes TranslationTable = "routes" TranslationTableTrips TranslationTable = "trips" TranslationTableStopTimes TranslationTable = "stop_times" TranslationTablePathways TranslationTable = "pathways" TranslationTableLevels TranslationTable = "levels" TranslationTableFeedInfo TranslationTable = "feed_info" TranslationTableAttributions TranslationTable = "attributions" )
func (*TranslationTable) Parse ¶
func (t *TranslationTable) Parse(in string) error
func (TranslationTable) Validate ¶
func (t TranslationTable) Validate() error
type Translations ¶
type Translations map[string]*Translation
func (*Translations) Validate ¶
func (t *Translations) Validate(opts ...ValidationOpts) error
type Trip ¶
type Trip struct { RouteID string // Required Identifies a route. ServiceID string // Required Identifies a set of dates when service is available for one or more routes. Headsign string // Optional Text that appears on signage identifying the trip's destination to riders. Should be used to distinguish between different patterns of service on the same route. ShortName string // Optional Public facing text used to identify the trip to riders, for instance, to identify train numbers for commuter rail trips. If riders do not commonly rely on trip names, trip_short_name should be empty. A trip_short_name value, if provided, should uniquely identify a trip within a service day; it should not be used for destination names or limited/express designations. Direction Direction // Optional Indicates the direction of travel for a trip. This field should not be used in routing; it provides a way to separate trips by direction when publishing time tables. Valid options are: BlockID string // Optional Identifies the block to which the trip belongs. A block consists of a single trip or many sequential trips made using the same vehicle, defined by shared service days and block_id. A block_id may have trips with different service days, making distinct blocks. See the example below. To provide in-seat transfers information, transfers of transfer_type 4 should be provided instead. ShapeID string // Conditionally Required Identifies a geospatial shape describing the vehicle travel path for a trip. WheelchairAccessible WheelchairInformation // Optional Indicates wheelchair accessibility. Valid options are: BikesAllowed BikeInformation // Optional Indicates whether bikes are allowed. Valid options are: StartTime Time // Additonal The time at which the vehicle begins its trip. this is needed due to the way we store stop times internally. It shouln't be set directly and is populted via SetRelativeStopTimes() or SetAbsoluteStopTimes() Frequencies Frequencies PatternID string // contains filtered or unexported fields }
func (*Trip) AbsoluteStopTimes ¶
func (t *Trip) AbsoluteStopTimes() AbsoluteStopTimes
func (*Trip) Pattern ¶
should only be used by writers. to access trip stop times use AbsoluteStopTimes() or RelativeStopTimes()
func (*Trip) RelativeStopTimes ¶
func (t *Trip) RelativeStopTimes() RelativeStopTimes
func (*Trip) SetAbsoluteStopTimes ¶
func (t *Trip) SetAbsoluteStopTimes(ast AbsoluteStopTimes) error
func (*Trip) SetAdditionalField ¶
func (fe *Trip) SetAdditionalField(k, v string)
func (*Trip) SetRelativeStopTimes ¶
func (t *Trip) SetRelativeStopTimes(rst RelativeStopTimes) error
func (*Trip) Validate ¶
func (t *Trip) Validate(opts ...ValidationOpts) error
type Trips ¶
func (Trips) DeduplicateServices ¶
func (t Trips) DeduplicateServices()
Deduplicate removes duplicate services from the set.
func (Trips) DeduplicateShapes ¶
func (t Trips) DeduplicateShapes()
Deduplicate removes duplicate shapes from the set.
func (*Trips) Validate ¶
func (t *Trips) Validate(opts ...ValidationOpts) error
type ValidationOpts ¶
type ValidationOpts func(*setValidationOpts)
func WithStrict ¶
func WithStrict() ValidationOpts
func WithValidateRefs ¶
func WithValidateRefs() ValidationOpts
type WheelchairInformation ¶
type WheelchairInformation int8
const ( WheelchairNoInformation WheelchairInformation = iota WheelchairAccessible WheelchairNotAccessible )
func (*WheelchairInformation) Parse ¶
func (wi *WheelchairInformation) Parse(text string) error
func (WheelchairInformation) String ¶
func (wi WheelchairInformation) String() string
func (WheelchairInformation) Validate ¶
func (wi WheelchairInformation) Validate() error
type WriteStreamProvider ¶
type WriteStreamProvider interface {
WriteStream(filename string) (io.WriteCloser, error)
}
type ZipReadProvider ¶
type ZipReadProvider struct {
// contains filtered or unexported fields
}
func (*ZipReadProvider) ReadStream ¶
func (z *ZipReadProvider) ReadStream(filename string) (io.ReadCloser, error)
type ZipWriteProvider ¶
type ZipWriteProvider struct {
// contains filtered or unexported fields
}
func (*ZipWriteProvider) WriteStream ¶
func (z *ZipWriteProvider) WriteStream(filename string) (io.WriteCloser, error)
Source Files
¶
- agency.go
- area.go
- attribution.go
- bike_info.go
- calendar.go
- calendar_dates.go
- color.go
- currency.go
- direction.go
- drop_off.go
- duration_limit_type.go
- enum.go
- epochdate.go
- errors.go
- exact_times.go
- fare_attributes.go
- fare_leg_rules.go
- fare_media.go
- fare_media_type.go
- fare_product.go
- fare_rules.go
- fare_transfer_rules.go
- fare_transfer_type.go
- feed.go
- feed_entity.go
- feed_info.go
- frequency.go
- level.go
- location.go
- mode.go
- network.go
- pathway.go
- pathway_bidirectional.go
- pathway_mode.go
- payment_method.go
- pickup.go
- read_csv.go
- read_gob.go
- read_logger.go
- reader.go
- route.go
- service.go
- service_exception_type.go
- shape.go
- stop.go
- stop_area.go
- stop_time.go
- time.go
- timeframe.go
- timing_point.go
- transfer.go
- transfer_limit.go
- transfer_type.go
- translation.go
- translation_table.go
- trip.go
- txtar.go
- wheelchair_info.go
- write_feed_info.go
- write_field.go
- write_gob.go
- writer.go