Documentation
¶
Index ¶
- Variables
- func FeedVersionServiceBounds(reader Reader) (time.Time, time.Time, error)
- func ValidateShapes(shapes []Shape) []error
- func ValidateStopTimes(stoptimes []StopTime) []error
- type Agency
- type Area
- type Attribution
- type BaseEntity
- type Calendar
- type CalendarDate
- type DatabaseEntity
- type Date
- type Entity
- type EntityMap
- func (emap *EntityMap) Get(efn string, eid string) (string, bool)
- func (emap *EntityMap) GetEntity(ent Entity) (string, bool)
- func (emap *EntityMap) KeysFor(efn string) []string
- func (emap *EntityMap) Set(efn string, oldid string, newid string) error
- func (emap *EntityMap) SetEntity(ent Entity, oldid string, newid string) error
- func (emap *EntityMap) Update(other EntityMap)
- type EntityWithErrors
- type EntityWithExtra
- type EntityWithID
- type EntityWithReferences
- type ErrorEntity
- type ExtraEntity
- type FareAttribute
- type FareLegRule
- type FareMedia
- type FareProduct
- func (ent *FareProduct) EntityID() string
- func (ent *FareProduct) Errors() (errs []error)
- func (ent *FareProduct) Filename() string
- func (ent *FareProduct) GetValue(key string) (any, bool)
- func (ent *FareProduct) String() string
- func (ent *FareProduct) TableName() string
- func (ent *FareProduct) UpdateKeys(emap *EntityMap) error
- type FareRule
- type FareTransferRule
- type Feed
- type FeedAssociatedFeeds
- type FeedAuthorization
- type FeedInfo
- type FeedLanguages
- type FeedLicense
- type FeedUrls
- type FeedVersion
- type FeedVersionEntity
- type Float
- type Frequency
- type Geometry
- type Int
- type Ints
- type Key
- type Level
- type LineEntity
- type LineString
- type MinEntity
- type Operator
- type OperatorAssociatedFeed
- type OperatorAssociatedFeeds
- type Pathway
- type Point
- type Polygon
- type Reader
- type ReferenceEntity
- type RiderCategory
- type Route
- type Secret
- type Service
- func (s *Service) AddCalendarDate(cd CalendarDate) error
- func (s *Service) CalendarDates() []CalendarDate
- func (s *Service) Exception(t time.Time) (int, bool)
- func (s *Service) GetWeekday(dow int) (int, error)
- func (s *Service) HasAtLeastOneDay() bool
- func (s *Service) IsActive(t time.Time) bool
- func (s *Service) Reset()
- func (s *Service) ServicePeriod() (time.Time, time.Time)
- func (s *Service) SetWeekday(dow int, value int) error
- func (s *Service) Simplify() (*Service, error)
- type Shape
- type Stop
- func (ent *Stop) Coordinates() [2]float64
- func (ent *Stop) EntityID() string
- func (ent *Stop) EntityKey() string
- func (ent *Stop) Errors() (errs []error)
- func (ent *Stop) Filename() string
- func (ent *Stop) SetCoordinates(p [2]float64)
- func (ent *Stop) TableName() string
- func (ent *Stop) UpdateKeys(emap *EntityMap) error
- type StopArea
- type StopTime
- type String
- type Strings
- type Tags
- type Time
- type Timestamps
- type Transfer
- type Translation
- type Trip
- type WideTime
- type Writer
- type WriterWithExtraColumns
Constants ¶
This section is empty.
Variables ¶
var GTFSRTVERSION = "6fcc3800b15954227af7335d571791738afb1a67"
GTFSRTVERSION is the commit for the gtfs-realtime.proto file.
var GTFSVERSION = "11a49075c1f50d0130b934833b7eeb3fe518961c"
GTFSVERSION is the commit for the spec reference.md file.
var VERSION = "v0.16.0"
VERSION is the current software version.
Functions ¶
func FeedVersionServiceBounds ¶ added in v0.12.0
func ValidateShapes ¶
ValidateShapes returns errors for an array of shapes.
func ValidateStopTimes ¶
ValidateStopTimes checks if the trip follows GTFS rules.
Types ¶
type Agency ¶
type Agency struct {
AgencyID string
AgencyName string `csv:",required"`
AgencyURL string `csv:",required"`
AgencyTimezone string `csv:",required"`
AgencyLang string
AgencyPhone string
AgencyFareURL string
AgencyEmail string
BaseEntity
}
Agency agency.txt
type Area ¶ added in v0.11.0
type Area struct {
AreaID String
AreaName String
AgencyIDs Strings `csv:"-" db:"agency_ids"` // interline ext
Geometry tt.Polygon `csv:"-"` // interline ext
BaseEntity
}
Area fare_areas.txt
type Attribution ¶ added in v0.10.0
type Attribution struct {
OrganizationName String
AgencyID Key
RouteID Key
TripID Key
IsProducer Int
IsOperator Int
IsAuthority Int
AttributionID String
AttributionURL String
AttributionEmail String
AttributionPhone String
BaseEntity
}
func (*Attribution) Errors ¶ added in v0.10.0
func (ent *Attribution) Errors() (errs []error)
Errors for this Entity.
func (*Attribution) Filename ¶ added in v0.10.0
func (ent *Attribution) Filename() string
func (*Attribution) TableName ¶ added in v0.10.0
func (ent *Attribution) TableName() string
func (*Attribution) UpdateKeys ¶ added in v0.10.0
func (ent *Attribution) UpdateKeys(emap *EntityMap) error
UpdateKeys updates Entity references.
type BaseEntity ¶
type BaseEntity struct {
MinEntity
LineEntity
ExtraEntity
ErrorEntity
DatabaseEntity
FeedVersionEntity
Timestamps
}
type Calendar ¶
type Calendar struct {
ServiceID string `csv:",required"`
Monday int `csv:",required"`
Tuesday int `csv:",required"`
Wednesday int `csv:",required"`
Thursday int `csv:",required"`
Friday int `csv:",required"`
Saturday int `csv:",required"`
Sunday int `csv:",required"`
StartDate time.Time `csv:",required"`
EndDate time.Time `csv:",required"`
Generated bool `csv:"-" db:"generated"`
BaseEntity
}
Calendar calendars.txt
type CalendarDate ¶
type CalendarDate struct {
ServiceID string `csv:",required"`
Date time.Time `csv:",required"`
ExceptionType int `csv:",required"`
BaseEntity
}
CalendarDate calendar_dates.txt
func (*CalendarDate) Errors ¶
func (ent *CalendarDate) Errors() (errs []error)
Errors for this Entity.
func (*CalendarDate) Filename ¶
func (ent *CalendarDate) Filename() string
Filename calendar_dates.txt
func (*CalendarDate) TableName ¶
func (ent *CalendarDate) TableName() string
TableName gtfs_calendar_dates
func (*CalendarDate) UpdateKeys ¶
func (ent *CalendarDate) UpdateKeys(emap *EntityMap) error
UpdateKeys updates Entity references.
type DatabaseEntity ¶ added in v0.8.8
type DatabaseEntity struct {
ID int `csv:"-"`
}
func (DatabaseEntity) GetID ¶ added in v0.8.8
func (ent DatabaseEntity) GetID() int
GetID returns the integer ID.
func (*DatabaseEntity) SetID ¶ added in v0.8.8
func (ent *DatabaseEntity) SetID(id int)
SetID sets the integer ID.
type EntityMap ¶
type EntityMap struct {
// contains filtered or unexported fields
}
EntityMap stores correspondances between Entity IDs, e.g. StopID -> Stop's integer ID in a database.
type EntityWithErrors ¶ added in v0.11.0
type EntityWithExtra ¶ added in v0.11.0
type EntityWithID ¶ added in v0.11.0
type EntityWithID interface {
GetID() int
}
type EntityWithReferences ¶ added in v0.11.0
type ErrorEntity ¶ added in v0.11.0
type ErrorEntity struct {
// contains filtered or unexported fields
}
///////
func (*ErrorEntity) AddError ¶ added in v0.11.0
func (ent *ErrorEntity) AddError(err error)
AddError adds a loading error to the entity, e.g. from a CSV parse failure
func (*ErrorEntity) AddWarning ¶ added in v0.11.0
func (ent *ErrorEntity) AddWarning(err error)
AddWarning .
func (*ErrorEntity) Errors ¶ added in v0.11.0
func (ent *ErrorEntity) Errors() []error
Errors returns validation errors.
func (*ErrorEntity) Warnings ¶ added in v0.11.0
func (ent *ErrorEntity) Warnings() []error
Errors returns validation errors.
type ExtraEntity ¶ added in v0.11.0
type ExtraEntity struct {
// contains filtered or unexported fields
}
func (*ExtraEntity) ClearExtra ¶ added in v0.13.0
func (ent *ExtraEntity) ClearExtra()
func (*ExtraEntity) ExtraKeys ¶ added in v0.11.0
func (ent *ExtraEntity) ExtraKeys() []string
func (*ExtraEntity) GetExtra ¶ added in v0.11.0
func (ent *ExtraEntity) GetExtra(key string) (string, bool)
func (*ExtraEntity) SetExtra ¶ added in v0.11.0
func (ent *ExtraEntity) SetExtra(key string, value string)
SetExtra adds a string key, value pair to the entity's extra fields.
type FareAttribute ¶
type FareAttribute struct {
FareID string `csv:",required"`
Price float64 `csv:",required"`
CurrencyType string `csv:",required"`
PaymentMethod int `csv:",required"`
Transfers Int
AgencyID Key
TransferDuration int
BaseEntity
}
FareAttribute fare_attributes.txt
func (*FareAttribute) EntityID ¶
func (ent *FareAttribute) EntityID() string
EntityID returns the ID or FareID.
func (*FareAttribute) EntityKey ¶ added in v0.7.1
func (ent *FareAttribute) EntityKey() string
EntityKey returns the GTFS identifier.
func (*FareAttribute) Errors ¶
func (ent *FareAttribute) Errors() (errs []error)
Errors for this Entity.
func (*FareAttribute) Filename ¶
func (ent *FareAttribute) Filename() string
Filename fare_attributes.txt
func (*FareAttribute) TableName ¶
func (ent *FareAttribute) TableName() string
TableName gtfs_fare_attributes
func (*FareAttribute) UpdateKeys ¶
func (ent *FareAttribute) UpdateKeys(emap *EntityMap) error
UpdateKeys updates Entity references.
type FareLegRule ¶ added in v0.11.0
type FareLegRule struct {
LegGroupID String
FromAreaID String
ToAreaID String
NetworkID String
FareProductID String
TransferOnly tt.Int // interline ext
BaseEntity
}
FareLegRule fare_leg_rules.txt
func (*FareLegRule) EntityID ¶ added in v0.11.0
func (ent *FareLegRule) EntityID() string
func (*FareLegRule) Errors ¶ added in v0.11.0
func (ent *FareLegRule) Errors() (errs []error)
func (*FareLegRule) Filename ¶ added in v0.11.0
func (ent *FareLegRule) Filename() string
func (*FareLegRule) String ¶ added in v0.11.0
func (ent *FareLegRule) String() string
func (*FareLegRule) TableName ¶ added in v0.11.0
func (ent *FareLegRule) TableName() string
func (*FareLegRule) UpdateKeys ¶ added in v0.11.0
func (ent *FareLegRule) UpdateKeys(emap *EntityMap) error
type FareMedia ¶ added in v0.13.0
type FareMedia struct {
FareMediaID String
FareMediaName String
FareMediaType Int
BaseEntity
}
FareMedia fare_media.txt
type FareProduct ¶ added in v0.11.0
type FareProduct struct {
FareProductID String
FareProductName String
Amount tt.CurrencyAmount // Experimental formatting
Currency String
DurationStart Int // proposed extension
DurationAmount Float // proposed extension
DurationUnit Int // proposed extension
DurationType Int // proposed extension
RiderCategoryID Key // proposed extension
FareMediaID Key // proposed extension
BaseEntity
}
FareProduct fare_products.txt
func (*FareProduct) EntityID ¶ added in v0.11.0
func (ent *FareProduct) EntityID() string
func (*FareProduct) Errors ¶ added in v0.11.0
func (ent *FareProduct) Errors() (errs []error)
func (*FareProduct) Filename ¶ added in v0.11.0
func (ent *FareProduct) Filename() string
func (*FareProduct) GetValue ¶ added in v0.13.0
func (ent *FareProduct) GetValue(key string) (any, bool)
func (*FareProduct) String ¶ added in v0.11.0
func (ent *FareProduct) String() string
func (*FareProduct) TableName ¶ added in v0.11.0
func (ent *FareProduct) TableName() string
func (*FareProduct) UpdateKeys ¶ added in v0.11.0
func (ent *FareProduct) UpdateKeys(emap *EntityMap) error
type FareRule ¶
type FareRule struct {
FareID string `csv:",required"`
RouteID Key
OriginID string
DestinationID string
ContainsID string
BaseEntity
}
FareRule fare_rules.txt
func (*FareRule) UpdateKeys ¶
UpdateKeys updates Entity references.
type FareTransferRule ¶ added in v0.11.0
type FareTransferRule struct {
FromLegGroupID tt.String
ToLegGroupID tt.String
TransferCount tt.Int
DurationLimit tt.Int
DurationLimitType tt.Int
FareTransferType tt.Int
FareProductID tt.String
FilterFareProductID tt.String // proposed extension
BaseEntity
}
FareTransferRule fare_transfer_rules.txt
func (*FareTransferRule) Errors ¶ added in v0.11.0
func (ent *FareTransferRule) Errors() (errs []error)
func (*FareTransferRule) Filename ¶ added in v0.11.0
func (ent *FareTransferRule) Filename() string
func (*FareTransferRule) String ¶ added in v0.11.0
func (ent *FareTransferRule) String() string
func (*FareTransferRule) TableName ¶ added in v0.11.0
func (ent *FareTransferRule) TableName() string
func (*FareTransferRule) UpdateKeys ¶ added in v0.11.0
func (ent *FareTransferRule) UpdateKeys(emap *EntityMap) error
type Feed ¶
type Feed struct {
ID int `json:"-"`
FeedID string `json:"id" db:"onestop_id"`
SupersedesIDs Strings `json:"supersedes_ids,omitempty" db:"-"`
Name String `json:"name,omitempty"`
Description String `json:"description,omitempty"`
Spec string `json:"spec,omitempty"`
URLs FeedUrls `json:"urls,omitempty" db:"urls"`
Languages FeedLanguages `json:"languages,omitempty"`
License FeedLicense `json:"license,omitempty"`
Authorization FeedAuthorization `json:"authorization,omitempty" db:"auth"`
Tags Tags `json:"tags,omitempty" db:"feed_tags" `
File string `json:"-"` // internal
DeletedAt Time `json:"-"` // internal
Timestamps `json:"-"` // internal
}
Feed listed in a parsed DMFR file
func (*Feed) MatchSecrets ¶ added in v0.10.1
type FeedAssociatedFeeds ¶
type FeedAssociatedFeeds []string
FeedAssociatedFeeds .
func (*FeedAssociatedFeeds) Scan ¶
func (a *FeedAssociatedFeeds) Scan(value interface{}) error
Scan .
type FeedAuthorization ¶
type FeedAuthorization struct {
Type string `json:"type,omitempty"` // ["header", "basic_auth", "query_param", "path_segment", "replace_url"]
ParamName string `json:"param_name,omitempty"`
InfoURL string `json:"info_url,omitempty"`
}
FeedAuthorization contains details about how to access a Feed.
type FeedInfo ¶
type FeedInfo struct {
FeedPublisherName string `csv:",required"`
FeedPublisherURL string `csv:",required"`
FeedLang string `csv:",required"`
FeedVersion string `db:"feed_version_name"`
FeedStartDate Date
FeedEndDate Date
DefaultLang String
FeedContactEmail String
FeedContactURL String
BaseEntity
}
FeedInfo feed_info.txt
type FeedLicense ¶
type FeedLicense struct {
SpdxIdentifier string `json:"spdx_identifier,omitempty"`
URL string `json:"url,omitempty"`
UseWithoutAttribution string `json:"use_without_attribution,omitempty"`
CreateDerivedProduct string `json:"create_derived_product,omitempty"`
RedistributionAllowed string `json:"redistribution_allowed,omitempty"`
CommercialUseAllowed string `json:"commercial_use_allowed,omitempty"`
AttributionText string `json:"attribution_text,omitempty"`
AttributionInstructions string `json:"attribution_instructions,omitempty"`
}
FeedLicense describes the license and usage information for a Feed.
type FeedUrls ¶
type FeedUrls struct {
StaticCurrent string `json:"static_current,omitempty"`
StaticPlanned string `json:"static_planner,omitempty"`
StaticHistoric []string `json:"static_historic,omitempty"`
RealtimeVehiclePositions string `json:"realtime_vehicle_positions,omitempty"`
RealtimeTripUpdates string `json:"realtime_trip_updates,omitempty"`
RealtimeAlerts string `json:"realtime_alerts,omitempty"`
GbfsAutoDiscovery string `json:"gbfs_auto_discovery,omitempty"`
GbfsSystemAlerts string `json:"gbfs_system_alerts,omitempty"`
MdsProvider string `json:"mds_provider,omitempty"`
}
FeedUrls contains URL values for a Feed.
type FeedVersion ¶
type FeedVersion struct {
ID int
FeedID int
FeedType string
SHA1 string
SHA1Dir string
File string
URL string
EarliestCalendarDate Date
LatestCalendarDate Date
FetchedAt time.Time
Fragment String
Name String
Description String
CreatedBy String
UpdatedBy String
Timestamps
}
FeedVersion represents a single GTFS data source.
func NewFeedVersionFromReader ¶
func NewFeedVersionFromReader(reader Reader) (FeedVersion, error)
NewFeedVersionFromReader returns a FeedVersion from a Reader.
func (*FeedVersion) TableName ¶
func (ent *FeedVersion) TableName() string
TableName sets the table name prefix.
type FeedVersionEntity ¶ added in v0.8.8
type FeedVersionEntity struct {
FeedVersionID int `csv:"-"`
}
func (*FeedVersionEntity) GetFeedVersionID ¶ added in v0.16.0
func (ent *FeedVersionEntity) GetFeedVersionID() int
GetFeedVersionID returns the Entity's FeedVersionID.
func (*FeedVersionEntity) SetFeedVersionID ¶ added in v0.8.8
func (ent *FeedVersionEntity) SetFeedVersionID(fvid int)
SetFeedVersionID sets the Entity's FeedVersionID.
type Frequency ¶
type Frequency struct {
TripID string `csv:",required"`
HeadwaySecs int `csv:",required"`
StartTime WideTime
EndTime WideTime
ExactTimes int
BaseEntity
}
Frequency frequencies.txt
func (*Frequency) RepeatCount ¶ added in v0.7.1
RepeatCount returns the number of times this trip will be repeated.
func (*Frequency) UpdateKeys ¶
UpdateKeys updates Entity references.
type Level ¶
type Level struct {
LevelID string `csv:",required"`
LevelIndex float64 `csv:",required"`
LevelName string `csv:"level_name"`
BaseEntity
}
Level levels.txt
type LineEntity ¶ added in v0.16.0
type LineEntity struct {
// contains filtered or unexported fields
}
func (LineEntity) Line ¶ added in v0.16.0
func (ent LineEntity) Line() int
func (*LineEntity) SetLine ¶ added in v0.16.0
func (ent *LineEntity) SetLine(line int)
type LineString ¶
type LineString = tt.LineString
type MinEntity ¶ added in v0.8.8
type MinEntity struct {
}
MinEntity provides minimum set of default methods.
func (*MinEntity) UpdateKeys ¶ added in v0.8.8
UpdateKeys updates entity referencespdates foreign keys based on an EntityMap.
type Operator ¶ added in v0.8.5
type Operator struct {
ID int `json:"-"`
OnestopID String `json:"onestop_id"`
SupersedesIDs Strings `json:"supersedes_ids,omitempty" db:"-"`
Name String `json:"name,omitempty"`
ShortName String `json:"short_name,omitempty"`
Website String `json:"website,omitempty"`
AssociatedFeeds OperatorAssociatedFeeds `json:"associated_feeds,omitempty"`
Tags Tags `json:"tags,omitempty" db:"operator_tags"`
File String `json:"-"` // internal
DeletedAt Time `json:"-"` // internal
Timestamps `json:"-"`
}
type OperatorAssociatedFeed ¶ added in v0.8.5
type OperatorAssociatedFeed struct {
GtfsAgencyID String `json:"gtfs_agency_id,omitempty" db:"gtfs_agency_id"`
FeedOnestopID String `json:"feed_onestop_id,omitempty" db:"-"`
ResolvedOnestopID String `json:"-"` // internal
ResolvedGtfsAgencyID String `json:"-"` // internal
ResolvedName String `json:"-"` // internal
ResolvedShortName String `json:"-"` // internal
ResolvedPlaces String `json:"-"` // internal
OperatorID Int `json:"-"` // internal
ID int `json:"-"` // internal
FeedID int `json:"-"` // internal
}
func (OperatorAssociatedFeed) TableName ¶ added in v0.8.5
func (o OperatorAssociatedFeed) TableName() string
type OperatorAssociatedFeeds ¶ added in v0.8.5
type OperatorAssociatedFeeds []OperatorAssociatedFeed
OperatorAssociatedFeeds is necessary to scan correctly from database
func (OperatorAssociatedFeeds) MarshalGQL ¶ added in v0.8.5
func (r OperatorAssociatedFeeds) MarshalGQL(w io.Writer)
MarshalGQL implements the graphql.Marshaler interface
func (*OperatorAssociatedFeeds) Scan ¶ added in v0.8.5
func (a *OperatorAssociatedFeeds) Scan(value interface{}) error
Scan .
func (*OperatorAssociatedFeeds) UnmarshalGQL ¶ added in v0.8.5
func (r *OperatorAssociatedFeeds) UnmarshalGQL(v interface{}) error
UnmarshalGQL implements the graphql.Unmarshaler interface
type Pathway ¶
type Pathway struct {
PathwayID string `csv:",required"`
FromStopID string `csv:",required"`
ToStopID string `csv:",required"`
PathwayMode int `csv:",required"`
IsBidirectional int `csv:",required"`
Length float64 `csv:"length" min:"0"`
TraversalTime int `csv:"traversal_time" min:"0"`
StairCount int `csv:"stair_count"`
MaxSlope float64 `csv:"max_slope"`
MinWidth float64 `csv:"min_width"`
SignpostedAs string `csv:"signposted_as"`
ReverseSignpostedAs string `csv:"reversed_signposted_as"`
BaseEntity
}
Pathway pathways.txt
func (*Pathway) UpdateKeys ¶
UpdateKeys updates Entity references.
type Reader ¶
type Reader interface {
Open() error
Close() error
ValidateStructure() []error
StopTimesByTripID(...string) chan []StopTime
String() string
// Entities
ReadEntities(c interface{}) error
Stops() chan Stop
StopTimes() chan StopTime
Agencies() chan Agency
Calendars() chan Calendar
CalendarDates() chan CalendarDate
FareAttributes() chan FareAttribute
FareRules() chan FareRule
FeedInfos() chan FeedInfo
Frequencies() chan Frequency
Routes() chan Route
Shapes() chan Shape
Transfers() chan Transfer
Pathways() chan Pathway
Levels() chan Level
Trips() chan Trip
Translations() chan Translation
Attributions() chan Attribution
Areas() chan Area
StopAreas() chan StopArea
FareLegRules() chan FareLegRule
FareTransferRules() chan FareTransferRule
FareProducts() chan FareProduct
RiderCategories() chan RiderCategory
FareMedia() chan FareMedia
}
Reader defines an interface for reading entities from a GTFS feed.
type ReferenceEntity ¶ added in v0.11.0
type ReferenceEntity struct {
}
type RiderCategory ¶ added in v0.11.0
type RiderCategory struct {
RiderCategoryID string
RiderCategoryName string
MinAge Int
MaxAge Int
EligibilityURL String
BaseEntity
}
RiderCategory rider_categories.txt
func (*RiderCategory) Errors ¶ added in v0.11.0
func (ent *RiderCategory) Errors() (errs []error)
func (*RiderCategory) Filename ¶ added in v0.11.0
func (ent *RiderCategory) Filename() string
func (*RiderCategory) TableName ¶ added in v0.11.0
func (ent *RiderCategory) TableName() string
type Route ¶
type Route struct {
RouteID string `csv:",required"`
AgencyID string
RouteShortName string
RouteLongName string
RouteDesc string
RouteType int `csv:",required"`
RouteURL string
RouteColor string
RouteTextColor string
RouteSortOrder int
ContinuousPickup Int
ContinuousDropOff Int
NetworkID String
AsRoute Int
Geometry Geometry `csv:"-" db:"-"`
BaseEntity
}
Route routes.txt
func (*Route) UpdateKeys ¶
UpdateKeys updates Entity references.
type Secret ¶ added in v0.10.1
type Secret struct {
Key string `json:"key"`
Username string `json:"username"`
Password string `json:"password"`
AWSAccessKeyID string `json:"aws_access_key_id"`
AWSSecretAccessKey string `json:"aws_secret_access_key"`
FeedID string `json:"feed_id"`
Filename string `json:"filename"`
URLType string `json:"url_type"`
ReplaceUrl string `json:"replace_url"`
}
Secret .
func (Secret) MatchFilename ¶ added in v0.10.1
MatchFilename finds secrets associated with a DMFR filename.
type Service ¶
type Service struct {
Calendar
// contains filtered or unexported fields
}
Service is a Calendar / CalendarDate union.
func NewService ¶
func NewService(c Calendar, cds ...CalendarDate) *Service
NewService returns a new Service.
func NewServicesFromReader ¶
NewServicesFromReader returns the reader's Calendar and CalendarDate entities as a Service
func (*Service) AddCalendarDate ¶
func (s *Service) AddCalendarDate(cd CalendarDate) error
AddCalendarDate adds a service exception.
func (*Service) CalendarDates ¶ added in v0.8.0
func (s *Service) CalendarDates() []CalendarDate
CalendarDates returns CalendarDates for this service.
func (*Service) GetWeekday ¶ added in v0.8.0
GetWeekday returns the value fo the day of week.
func (*Service) HasAtLeastOneDay ¶ added in v0.8.0
HasAtLeastOneDay checks if the Service is active for at least one day.
func (*Service) Reset ¶ added in v0.8.8
func (s *Service) Reset()
Reset resets calendars, except ServiceID
func (*Service) ServicePeriod ¶
ServicePeriod returns the widest possible range of days with transit service, including service exceptions.
func (*Service) SetWeekday ¶ added in v0.8.0
SetWeekday sets the day of week.
type Shape ¶
type Shape struct {
ShapeID string `csv:",required"`
ShapePtLat float64 `db:"-" csv:",required"`
ShapePtLon float64 `db:"-" csv:",required"`
ShapePtSequence int `db:"-" csv:",required"`
ShapeDistTraveled float64 `db:"-"`
Geometry LineString `db:"geometry" csv:"-"`
Generated bool `db:"generated" csv:"-"`
BaseEntity
}
Shape shapes.txt
func NewShapeFromShapes ¶
NewShapeFromShapes takes Shapes with single points and returns a Shape with linestring geometry. Any errors from the input errors, or errors such as duplicate sequences, are added as entity errors.
type Stop ¶
type Stop struct {
StopID string `csv:",required" required:"true"`
StopName string
StopCode string
StopDesc string
StopLat float64 `db:"-"` // csv load to Geometry
StopLon float64 `db:"-"`
ZoneID string
StopURL string
TtsStopName String
PlatformCode String
LocationType int
ParentStation Key
StopTimezone string
WheelchairBoarding int
LevelID Key
Geometry Point `csv:"-" db:"geometry"`
BaseEntity
}
Stop stops.txt
func (*Stop) Coordinates ¶
Coordinates returns the stop lon,lat as a [2]float64
func (*Stop) SetCoordinates ¶
SetCoordinates takes a [2]float64 and sets the Stop's lon,lat
func (*Stop) UpdateKeys ¶
UpdateKeys updates Entity references.
type StopArea ¶ added in v0.11.0
type StopArea struct {
AreaID string
StopID string
BaseEntity
}
StopArea stop_areas.txt
func (*StopArea) UpdateKeys ¶ added in v0.11.0
type StopTime ¶
type StopTime struct {
TripID string
StopID string `csv:",required" required:"true"`
StopSequence int `csv:",required" required:"true"`
StopHeadsign String
ArrivalTime WideTime
DepartureTime WideTime
PickupType Int
DropOffType Int
ContinuousPickup Int
ContinuousDropOff Int
ShapeDistTraveled Float
Timepoint Int
Interpolated Int `csv:"-"` // interpolated times: 0 for provided, 1 interpolated // TODO: 1 for shape, 2 for straight-line
MinEntity
ErrorEntity
ExtraEntity
FeedVersionEntity
}
StopTime stop_times.txt
func (*StopTime) UpdateKeys ¶
UpdateKeys updates Entity references.
type Timestamps ¶
Timestamps .
func (*Timestamps) UpdateTimestamps ¶
func (ent *Timestamps) UpdateTimestamps()
UpdateTimestamps initializes or updates CreatedAt / UpdatedAt
type Transfer ¶
type Transfer struct {
FromStopID string
ToStopID string
FromRouteID Key
ToRouteID Key
FromTripID Key
ToTripID Key
TransferType int
MinTransferTime Int
BaseEntity
}
Transfer transfers.txt
func (*Transfer) UpdateKeys ¶
UpdateKeys updates entity references.
type Translation ¶ added in v0.10.0
type Translation struct {
// "TableNameValue" because TableName is a required interface method
TableNameValue String `db:"table_name" csv:"table_name"`
FieldName String
Language String
Translation String
RecordID String
RecordSubID String
FieldValue String
BaseEntity
}
func (*Translation) Errors ¶ added in v0.10.0
func (ent *Translation) Errors() (errs []error)
Errors for this Entity.
func (*Translation) Filename ¶ added in v0.10.0
func (ent *Translation) Filename() string
func (*Translation) TableName ¶ added in v0.10.0
func (ent *Translation) TableName() string
type Trip ¶
type Trip struct {
RouteID string `csv:",required"`
ServiceID string `csv:",required"`
TripID string `csv:",required"`
TripHeadsign string
TripShortName string
DirectionID int
BlockID string
ShapeID Key
WheelchairAccessible int
BikesAllowed int
StopTimes []StopTime `csv:"-" db:"-"` // for validation methods
StopPatternID int `csv:"-"`
JourneyPatternID string `csv:"-"`
JourneyPatternOffset int `csv:"-"`
BaseEntity
}
Trip trips.txt
func (*Trip) UpdateKeys ¶
UpdateKeys updates Entity references.
type Writer ¶
type Writer interface {
Open() error
Close() error
Create() error
Delete() error
NewReader() (Reader, error)
AddEntity(Entity) (string, error)
AddEntities([]Entity) ([]string, error)
String() string
}
Writer writes a GTFS feed.
type WriterWithExtraColumns ¶ added in v0.11.0
Source Files
¶
- entitymap.go
- feed.go
- feed_version.go
- gtfs_agency.go
- gtfs_area.go
- gtfs_attribution.go
- gtfs_calendar.go
- gtfs_calendar_date.go
- gtfs_entity.go
- gtfs_fare_attribute.go
- gtfs_fare_leg_rule.go
- gtfs_fare_media.go
- gtfs_fare_product.go
- gtfs_fare_rule.go
- gtfs_fare_transfer_rule.go
- gtfs_feed_info.go
- gtfs_frequency.go
- gtfs_level.go
- gtfs_pathway.go
- gtfs_rider_category.go
- gtfs_route.go
- gtfs_shape.go
- gtfs_stop.go
- gtfs_stop_area.go
- gtfs_stop_time.go
- gtfs_transfer.go
- gtfs_translation.go
- gtfs_trip.go
- operator.go
- reader.go
- secret.go
- service.go
- tl.go
- writer.go