Documentation
¶
Index ¶
- Variables
- func AddConfig(cfg Config) func(http.Handler) http.Handler
- func AddConfigAndPerms(cfg Config, next http.Handler) http.Handler
- func AddPerms(checker Checker) func(http.Handler) http.Handler
- func WithConfig(ctx context.Context, cfg Config) context.Context
- func WithPerms(ctx context.Context, checker Checker) context.Context
- type Actions
- type Agency
- type AgencyFilter
- type AgencyLocationFilter
- type AgencyPlace
- type AgencyPlaceFilter
- type Alert
- type BookingRule
- type BookingRuleFilter
- type BoundingBox
- type Calendar
- type CalendarDate
- type CalendarDateFilter
- type CensusDataset
- type CensusDatasetFilter
- type CensusDatasetGeographyFilter
- type CensusDatasetGeographyLocationFilter
- type CensusField
- type CensusGeography
- type CensusGeographyFilter
- type CensusLayer
- type CensusSource
- type CensusSourceFilter
- type CensusSourceGeographyFilter
- type CensusTable
- type CensusTableFilter
- type CensusValue
- type Checker
- type Config
- type Cursor
- type DirectionRequest
- type Directions
- type Distance
- type DistanceUnit
- type Duration
- type DurationUnit
- type EntityDeleteResult
- type EntityFinder
- type EntityLoader
- type EntityMutator
- type FVPair
- type Feature
- type Feed
- type FeedAuthorization
- type FeedFetch
- type FeedFetchFilter
- type FeedFilter
- type FeedInfo
- type FeedLicense
- type FeedSourceURL
- type FeedSourceURLTypes
- func (e FeedSourceURLTypes) IsValid() bool
- func (e FeedSourceURLTypes) MarshalGQL(w io.Writer)
- func (e FeedSourceURLTypes) MarshalJSON() ([]byte, error)
- func (e FeedSourceURLTypes) String() string
- func (e *FeedSourceURLTypes) UnmarshalGQL(v any) error
- func (e *FeedSourceURLTypes) UnmarshalJSON(b []byte) error
- type FeedSpecTypes
- func (f FeedSpecTypes) FromDBString(s string) *FeedSpecTypes
- func (e FeedSpecTypes) IsValid() bool
- func (e FeedSpecTypes) MarshalGQL(w io.Writer)
- func (e FeedSpecTypes) MarshalJSON() ([]byte, error)
- func (e FeedSpecTypes) String() string
- func (f FeedSpecTypes) ToDBString() string
- func (e *FeedSpecTypes) UnmarshalGQL(v any) error
- func (e *FeedSpecTypes) UnmarshalJSON(b []byte) error
- type FeedState
- type FeedUrls
- type FeedVersion
- type FeedVersionDeleteResult
- type FeedVersionFetchResult
- type FeedVersionFileInfo
- type FeedVersionFilter
- type FeedVersionGtfsImport
- type FeedVersionImportResult
- type FeedVersionInput
- type FeedVersionServiceLevel
- type FeedVersionServiceLevelFilter
- type FeedVersionServiceWindow
- type FeedVersionSetInput
- type FeedVersionUnimportResult
- type Finder
- type FlexStopTime
- type FocusPoint
- type Frequency
- type GbfsAlertTime
- type GbfsBikeRequest
- type GbfsBrandAsset
- type GbfsDockRequest
- type GbfsFeed
- type GbfsFinder
- type GbfsFreeBikeStatus
- func (g *GbfsFreeBikeStatus) HomeStation() *GbfsStationInformation
- func (g *GbfsFreeBikeStatus) PricingPlan() *GbfsSystemPricingPlan
- func (g *GbfsFreeBikeStatus) RentalUris() *GbfsRentalUris
- func (g *GbfsFreeBikeStatus) Station() *GbfsStationInformation
- func (g *GbfsFreeBikeStatus) VehicleType() *GbfsVehicleType
- type GbfsGeofenceFeature
- type GbfsGeofenceProperty
- type GbfsGeofenceRule
- type GbfsGeofenceZone
- type GbfsPlanPrice
- type GbfsRentalApp
- type GbfsRentalApps
- type GbfsRentalUris
- type GbfsStationInformation
- type GbfsStationStatus
- type GbfsSystemAlert
- type GbfsSystemCalendar
- type GbfsSystemHour
- type GbfsSystemInformation
- type GbfsSystemPricingPlan
- type GbfsSystemRegion
- type GbfsSystemVersion
- type GbfsVehicleAssets
- type GbfsVehicleDockAvailable
- type GbfsVehicleType
- type GbfsVehicleTypeAvailable
- type ImportStatus
- type Itinerary
- type Leg
- type LegRoute
- type LegRouteAgency
- type LegTrip
- type Level
- type LevelSetInput
- type LicenseFilter
- type LicenseValue
- type Location
- type LocationFilter
- type LocationGroup
- type LocationGroupFilter
- type LocationGroupStop
- type Me
- type Mutation
- type Operator
- type OperatorFilter
- type Pathway
- type PathwayFilter
- type PathwaySetInput
- type PermFilter
- type PermFinder
- type Place
- type PlaceAggregationLevel
- func (e PlaceAggregationLevel) IsValid() bool
- func (e PlaceAggregationLevel) MarshalGQL(w io.Writer)
- func (e PlaceAggregationLevel) MarshalJSON() ([]byte, error)
- func (e PlaceAggregationLevel) String() string
- func (e *PlaceAggregationLevel) UnmarshalGQL(v any) error
- func (e *PlaceAggregationLevel) UnmarshalJSON(b []byte) error
- type PlaceFilter
- type PointRadius
- type Query
- type RTFinder
- type RTStopTimeUpdate
- type RTTimeRange
- type RTTranslation
- type RTTripDescriptor
- type RTVehicleDescriptor
- type RelativeDate
- type Route
- type RouteAttribute
- type RouteFilter
- type RouteGeometry
- type RouteHeadway
- type RouteLocationFilter
- type RouteStop
- type RouteStopBuffer
- type RouteStopPattern
- type ScheduleRelationship
- func (e ScheduleRelationship) IsValid() bool
- func (e ScheduleRelationship) MarshalGQL(w io.Writer)
- func (e ScheduleRelationship) MarshalJSON() ([]byte, error)
- func (e ScheduleRelationship) String() string
- func (e *ScheduleRelationship) UnmarshalGQL(v any) error
- func (e *ScheduleRelationship) UnmarshalJSON(b []byte) error
- type Segment
- type SegmentFilter
- type SegmentPattern
- type SegmentPatternFilter
- type ServiceCoversFilter
- type ServiceWindow
- type Shape
- type Step
- type StepMode
- type Stop
- type StopBuffer
- type StopExternalReference
- type StopExternalReferenceSetInput
- type StopFilter
- type StopLocationFilter
- type StopObservation
- type StopObservationFilter
- type StopPlace
- type StopPlaceParam
- type StopSetInput
- type StopTime
- type StopTimeEvent
- type StopTimeFilter
- type Trip
- type TripFilter
- type TripStopTimeFilter
- type ValidationRealtimeResult
- type ValidationReport
- type ValidationReportDetails
- type ValidationReportError
- type ValidationReportErrorGroup
- type ValidationReportFilter
- type VehiclePosition
- type Waypoint
- type WaypointDeparture
- type WaypointInput
- type WaypointStop
Constants ¶
This section is empty.
Variables ¶
var AllDistanceUnit = []DistanceUnit{ DistanceUnitKilometers, DistanceUnitMeters, DistanceUnitMiles, }
var AllDurationUnit = []DurationUnit{ DurationUnitSeconds, }
var AllFeedSourceURLTypes = []FeedSourceURLTypes{ FeedSourceURLTypesStaticCurrent, FeedSourceURLTypesStaticHistoric, FeedSourceURLTypesStaticPlanned, FeedSourceURLTypesStaticHypothetical, FeedSourceURLTypesRealtimeVehiclePositions, FeedSourceURLTypesRealtimeTripUpdates, FeedSourceURLTypesRealtimeAlerts, FeedSourceURLTypesGbfsAutoDiscovery, FeedSourceURLTypesMdsProvider, }
var AllFeedSpecTypes = []FeedSpecTypes{ FeedSpecTypesGtfs, FeedSpecTypesGtfsRt, FeedSpecTypesGbfs, FeedSpecTypesMds, }
var AllImportStatus = []ImportStatus{ ImportStatusSuccess, ImportStatusError, ImportStatusInProgress, }
var AllLicenseValue = []LicenseValue{ LicenseValueYes, LicenseValueNo, LicenseValueExcludeNo, LicenseValueUnknown, }
var AllPlaceAggregationLevel = []PlaceAggregationLevel{ PlaceAggregationLevelAdm0, PlaceAggregationLevelAdm0Adm1, PlaceAggregationLevelAdm0Adm1City, PlaceAggregationLevelAdm0City, PlaceAggregationLevelAdm1City, PlaceAggregationLevelCity, }
var AllRelativeDate = []RelativeDate{ RelativeDateToday, RelativeDateMonday, RelativeDateTuesday, RelativeDateWednesday, RelativeDateThursday, RelativeDateFriday, RelativeDateSaturday, RelativeDateSunday, RelativeDateNextMonday, RelativeDateNextTuesday, RelativeDateNextWednesday, RelativeDateNextThursday, RelativeDateNextFriday, RelativeDateNextSaturday, RelativeDateNextSunday, }
var AllScheduleRelationship = []ScheduleRelationship{ ScheduleRelationshipScheduled, ScheduleRelationshipAdded, ScheduleRelationshipUnscheduled, ScheduleRelationshipCanceled, ScheduleRelationshipStatic, ScheduleRelationshipSkipped, ScheduleRelationshipNoData, ScheduleRelationshipReplacement, ScheduleRelationshipDuplicated, ScheduleRelationshipDeleted, }
var AllStepMode = []StepMode{ StepModeWalk, StepModeAuto, StepModeBicycle, StepModeTransit, StepModeLine, }
Functions ¶
func AddConfigAndPerms ¶ added in v1.3.0
Types ¶
type Actions ¶ added in v1.3.0
type Actions interface {
StaticFetch(context.Context, string, io.Reader, string) (*FeedVersionFetchResult, error)
RTFetch(context.Context, string, string, string, string) error
GbfsFetch(context.Context, string, string) error
ValidateUpload(context.Context, io.Reader, *string, []string) (*ValidationReport, error)
FeedVersionUnimport(context.Context, int) (*FeedVersionUnimportResult, error)
FeedVersionImport(context.Context, int) (*FeedVersionImportResult, error)
FeedVersionUpdate(context.Context, FeedVersionSetInput) (int, error)
FeedVersionDelete(context.Context, int) (*FeedVersionDeleteResult, error)
}
type AgencyFilter ¶
type AgencyFilter struct {
// Search for agencies with this operator OnestopID
OnestopID *string `json:"onestop_id,omitempty"`
// Search for agencies with this feed version SHA1 hash
FeedVersionSha1 *string `json:"feed_version_sha1,omitempty"`
// Search for agencies with this feed OnestopID
FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
// Search for agencies with this GTFS agency_id
AgencyID *string `json:"agency_id,omitempty"`
// Search for records with this GTFS agency_name
AgencyName *string `json:"agency_name,omitempty"`
// Full text search
Search *string `json:"search,omitempty"`
// Search for agencies by city name (provided by Natural Earth)
CityName *string `json:"city_name,omitempty"`
// Search for agencies by country name (provided by Natural Earth)
Adm0Name *string `json:"adm0_name,omitempty"`
// Search for agencies by state/province/division name (provided by Natural Earth)
Adm1Name *string `json:"adm1_name,omitempty"`
// Search for agencies by country 2 letter ISO 3166 code (provided by Natural Earth)
Adm0Iso *string `json:"adm0_iso,omitempty"`
// Search for agencies by state/province/division ISO 3166-2 code (provided by Natural Earth)
Adm1Iso *string `json:"adm1_iso,omitempty"`
// Search for agencies with these license details
License *LicenseFilter `json:"license,omitempty"`
// Location
Location *AgencyLocationFilter `json:"location,omitempty"`
// Backwards compat: Search for agencies within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Backwards compat: Search for agencies within this geographic polygon
Within *tt.Polygon `json:"within,omitempty"`
// Backwards compat: Search for agencies within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
}
Search options for agencies
type AgencyLocationFilter ¶ added in v1.3.0
type AgencyLocationFilter struct {
// Search for agencies within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Search for agencies within this geographic polygon
Polygon *tt.Polygon `json:"polygon,omitempty"`
// Search for agencies within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
// Focus search on this point; results will be sorted by distance
Focus *FocusPoint `json:"focus,omitempty"`
}
type AgencyPlace ¶
type AgencyPlace struct {
// Best-matched city name
CityName *string `json:"city_name,omitempty"`
// Best-matched state or province name
Adm1Name *string `json:"adm1_name,omitempty"`
// Best-matched state or province ISO code
Adm1Iso *string `json:"adm1_iso,omitempty"`
// Best-matched country name
Adm0Name *string `json:"adm0_name,omitempty"`
// Best-mached country ISO code
Adm0Iso *string `json:"adm0_iso,omitempty"`
// Relative weight of this place association
Rank *float64 `json:"rank,omitempty"`
AgencyID int `json:"-"`
}
Place associated with an agency
type AgencyPlaceFilter ¶
type AgencyPlaceFilter struct {
// Search for associations with at least this rank value
MinRank *float64 `json:"min_rank,omitempty"`
}
Search options for agency associated places
type Alert ¶ added in v1.3.0
type Alert struct {
// GTFS-RT Alert active alert period. See https://gtfs.org/realtime/reference/#message-timerange
ActivePeriod []*RTTimeRange `json:"active_period,omitempty"`
// GTFS-RT Alert [cause](https://gtfs.org/realtime/reference/#enum-cause)
Cause *string `json:"cause,omitempty"`
// GTFS-RT Alert [effect](https://gtfs.org/realtime/reference/#enum-effect)
Effect *string `json:"effect,omitempty"`
// GTFS-RT Alert header text
HeaderText []*RTTranslation `json:"header_text"`
// GTFS-RT Alert description text
DescriptionText []*RTTranslation `json:"description_text"`
// GTFS-RT Alert TTS header text
TtsHeaderText []*RTTranslation `json:"tts_header_text,omitempty"`
// GTFS-RT Alert TTS description text
TtsDescriptionText []*RTTranslation `json:"tts_description_text,omitempty"`
// GTFS-RT Alert uRL for more information
URL []*RTTranslation `json:"url,omitempty"`
// GTFS-RT Alert severity level
SeverityLevel *string `json:"severity_level,omitempty"`
}
Alert(https://gtfs.org/reference/realtime/v2/#message-alert) message, also called a service alert, provided by a source GTFS Realtime feed.
type BookingRule ¶ added in v1.3.0
type BookingRule struct {
FeedOnestopID string
FeedVersionSHA1 string
gtfs.BookingRule
}
type BookingRuleFilter ¶ added in v1.3.0
type BoundingBox ¶ added in v1.3.0
type BoundingBox struct {
// Minimum longitude
MinLon float64 `json:"min_lon"`
// Minimum latitude
MinLat float64 `json:"min_lat"`
// Maximum longitude
MaxLon float64 `json:"max_lon"`
// Maximum latitude
MaxLat float64 `json:"max_lat"`
}
Search for entities within a specified bounding box
type CalendarDate ¶
type CalendarDate struct {
gtfs.CalendarDate
}
type CalendarDateFilter ¶
type CalendarDateFilter struct {
// Search for calendar date exceptions on this date
Date *tt.Date `json:"date,omitempty"`
// Search for calendar date exceptions with this GTFS exception_type
ExceptionType *int `json:"exception_type,omitempty"`
}
Search options for calendar dates
type CensusDataset ¶ added in v1.3.0
type CensusDataset struct {
// Internal integer ID
ID int `json:"id"`
// Dataset name, e.g. acsdt5y2022
Name string `json:"name"`
// Dataset description
Description *string `json:"description,omitempty"`
// Dataset url
URL *tt.Url `json:"url,omitempty"`
// Minimum year of data in this dataset
YearMin *int `json:"year_min,omitempty"`
// Maximum year of data in this dataset
YearMax *int `json:"year_max,omitempty"`
Sources []*CensusSource `json:"sources,omitempty"`
Geographies []*CensusGeography `json:"geographies,omitempty"`
Tables []*CensusTable `json:"tables,omitempty"`
Layers []*CensusLayer `json:"layers,omitempty"`
}
type CensusDatasetFilter ¶ added in v1.3.0
type CensusDatasetFilter struct {
// Search for datasets with this name
Name *string `json:"name,omitempty"`
// Search for datasets matching this string
Search *string `json:"search,omitempty"`
}
Search options for census datasets
type CensusDatasetGeographyFilter ¶ added in v1.3.0
type CensusDatasetGeographyFilter struct {
// Geographies with these integer IDs
Ids []int `json:"ids,omitempty"`
// Search within this dataset
Dataset *string `json:"dataset,omitempty"`
// Search within this layer
Layer *string `json:"layer,omitempty"`
// Search for geographies matching this string
Search *string `json:"search,omitempty"`
// Location search
Location *CensusDatasetGeographyLocationFilter `json:"location,omitempty"`
}
Search options for census geographies within a specific dataset
Note: please see the CensusDatasetGeographyLocationFilter documentation for details on how spatial searches may return duplicate geographies based on multiple intersections.
type CensusDatasetGeographyLocationFilter ¶ added in v1.3.0
type CensusDatasetGeographyLocationFilter struct {
// Search within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Search within this geographic polygon
Within *tt.Polygon `json:"within,omitempty"`
// Search within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
// Focus search on this point; results will be sorted by distance
Focus *FocusPoint `json:"focus,omitempty"`
// Search based on a buffer around these stop ids
StopBuffer *StopBuffer `json:"stop_buffer,omitempty"`
}
Search options for census geographies
Note: when using spatial searches (radius, stop_buffer, etc.), individual census geographies may appear multiple times in the result set, each representing a different intersection with the search area. For example: - Two stops with small radius buffers in the same census tract will return that tract twice, once for each buffer intersection - A complex polygon search that touches multiple disconnected areas of the same geography will return separate entries for each intersection - Each duplicate entry will have different `intersection_area` and `intersection_geometry` values representing the specific overlap
Clients should aggregate or de-duplicate results as needed based on the `geoid` field if a single entry per geography is desired.
type CensusField ¶ added in v1.3.0
type CensusGeography ¶
type CensusGeography struct {
// Internal integer ID
ID int `json:"id"`
// Dataset name, e.g. acsdt5y2022
DatasetName string `json:"dataset_name"`
// Source name, e.g. tl_2024_01_tract.zip
SourceName string `json:"source_name"`
// Census geography source layer
LayerName string `json:"layer_name"`
// Census geography GEOID
Geoid *string `json:"geoid,omitempty"`
// Census geography name
Name *string `json:"name,omitempty"`
// Geometry total area, in square meters
GeometryArea *float64 `json:"geometry_area,omitempty"`
// Land area, in square meters
Aland *float64 `json:"aland,omitempty"`
// Water area, in square meters
Awater *float64 `json:"awater,omitempty"`
// State or province name
Adm1Name *string `json:"adm1_name,omitempty"`
// State or province ISO code
Adm1Iso *string `json:"adm1_iso,omitempty"`
// Country name
Adm0Name *string `json:"adm0_name,omitempty"`
// Country ISO code
Adm0Iso *string `json:"adm0_iso,omitempty"`
// Census geography polygon
Geometry *tt.MultiPolygon `json:"geometry,omitempty"`
// Intersection area with a given geometry, in square meters
IntersectionArea *float64 `json:"intersection_area,omitempty"`
IntersectionGeometry *tt.Geometry `json:"intersection_geometry,omitempty"`
// Census tables containing data for this geography
Values []*CensusValue `json:"values"`
// Layer
Layer *CensusLayer `json:"layer,omitempty"`
// Source
Source *CensusSource `json:"source,omitempty"`
DatasetID int `json:"-"`
LayerID int `json:"-"`
MatchEntityID int `json:"-"`
SourceID int `json:"-"`
}
Census geography data
type CensusGeographyFilter ¶ added in v1.3.0
type CensusGeographyFilter struct {
Dataset *string `json:"dataset,omitempty"`
Layer *string `json:"layer,omitempty"`
Radius *float64 `json:"radius,omitempty"`
Search *string `json:"search,omitempty"`
}
Search options for census geographies
Note: please see the CensusDatasetGeographyLocationFilter documentation for details on how spatial searches may return duplicate geographies based on multiple intersections.
type CensusLayer ¶ added in v1.3.0
type CensusLayer struct {
// Internal integer ID
ID int `json:"id"`
// Layer name, e.g. tl_2024_01_tract
Name string `json:"name"`
// Layer description
Description *string `json:"description,omitempty"`
Geographies []*CensusGeography `json:"geographies,omitempty"`
DatasetID int `json:"-"`
}
"Census layer metadata
type CensusSource ¶ added in v1.3.0
type CensusSource struct {
// Internal integer ID
ID int `json:"id"`
// Source name, e.g. tl_2024_01_tract.zip
Name string `json:"name"`
// Source description
Description *string `json:"description,omitempty"`
// Source url
URL tt.Url `json:"url"`
// Source checksum
Sha1 string `json:"sha1"`
Geographies []*CensusGeography `json:"geographies,omitempty"`
Tables []*CensusTable `json:"tables,omitempty"`
Layers []*CensusLayer `json:"layers,omitempty"`
DatasetID int `json:"-"`
}
type CensusSourceFilter ¶ added in v1.3.0
type CensusSourceGeographyFilter ¶ added in v1.3.0
type CensusSourceGeographyFilter struct {
// Geographies with these integer IDs
Ids []int `json:"ids,omitempty"`
// Search for geographies matching this string
Search *string `json:"search,omitempty"`
// Location search
Location *CensusDatasetGeographyLocationFilter `json:"location,omitempty"`
}
Search options for census geography sources
Note: please see the CensusDatasetGeographyLocationFilter documentation for details on how spatial searches may return duplicate geographies based on multiple intersections.
type CensusTable ¶
type CensusTable struct {
// Internal integer ID
ID int `json:"id"`
// Census table name
TableName string `json:"table_name"`
// Census table title
TableTitle string `json:"table_title"`
// Census table group
TableGroup *string `json:"table_group,omitempty"`
// Additional details, e.g. population universe
TableDetails *string `json:"table_details,omitempty"`
// Individial field definitions for this table
Fields []*CensusField `json:"fields"`
DatasetID int `json:"-"`
}
Census table metadata
type CensusTableFilter ¶ added in v1.3.0
type CensusTableFilter struct {
Search *string `json:"search,omitempty"`
}
type CensusValue ¶
type CensusValue struct {
// Dataset name, e.g. acsdt5y2022
DatasetName string `json:"dataset_name"`
// Source name, e.g. tl_2024_01_tract.zip
SourceName string `json:"source_name"`
// Source table
Table *CensusTable `json:"table"`
// Column:Value for this table
Values tt.Map `json:"values"`
// GEOID of associated census geography
Geoid string `json:"geoid"`
GeographyID int `json:"-"`
TableID int `json:"-"`
}
Census values
type Checker ¶ added in v1.3.0
type Checker interface {
authz.CheckerServer
}
type Config ¶ added in v1.3.0
type Config struct {
Finder Finder
RTFinder RTFinder
GbfsFinder GbfsFinder
Checker Checker
Actions Actions
JobQueue jobs.JobQueue
Clock clock.Clock
Secrets []dmfr.Secret
ValidateLargeFiles bool
DisableImage bool
UseMaterialized bool
RestPrefix string
Storage string
RTStorage string
LoaderBatchSize int
LoaderStopTimeBatchSize int
MaxRadius float64
}
func ForContext ¶ added in v1.3.0
type Cursor ¶ added in v1.3.0
func (Cursor) MarshalGQL ¶ added in v1.3.0
MarshalGQL implements the graphql.Marshaler interface
func (*Cursor) MarshalJSON ¶ added in v1.3.0
MarshalJSON implements the json.marshaler interface.
func (*Cursor) UnmarshalGQL ¶ added in v1.3.0
UnmarshalGQL implements the graphql.Unmarshaler interface
func (*Cursor) UnmarshalJSON ¶ added in v1.3.0
UnmarshalJSON implements json.Marshaler interface.
type DirectionRequest ¶ added in v1.3.0
type DirectionRequest struct {
To *WaypointInput `json:"to"`
From *WaypointInput `json:"from"`
Mode StepMode `json:"mode"`
DepartAt *time.Time `json:"depart_at,omitempty"`
}
type Directions ¶ added in v1.3.0
type Directions struct {
Success bool `json:"success"`
Exception *string `json:"exception,omitempty"`
DataSource *string `json:"data_source,omitempty"`
Origin *Waypoint `json:"origin,omitempty"`
Destination *Waypoint `json:"destination,omitempty"`
Duration *Duration `json:"duration,omitempty"`
Distance *Distance `json:"distance,omitempty"`
StartTime *time.Time `json:"start_time,omitempty"`
EndTime *time.Time `json:"end_time,omitempty"`
Itineraries []*Itinerary `json:"itineraries,omitempty"`
}
type Distance ¶ added in v1.3.0
type Distance struct {
Distance float64 `json:"distance"`
Units DistanceUnit `json:"units"`
}
type DistanceUnit ¶ added in v1.3.0
type DistanceUnit string
const ( DistanceUnitKilometers DistanceUnit = "KILOMETERS" DistanceUnitMeters DistanceUnit = "METERS" DistanceUnitMiles DistanceUnit = "MILES" )
func (DistanceUnit) IsValid ¶ added in v1.3.0
func (e DistanceUnit) IsValid() bool
func (DistanceUnit) MarshalGQL ¶ added in v1.3.0
func (e DistanceUnit) MarshalGQL(w io.Writer)
func (DistanceUnit) MarshalJSON ¶ added in v1.3.0
func (e DistanceUnit) MarshalJSON() ([]byte, error)
func (DistanceUnit) String ¶ added in v1.3.0
func (e DistanceUnit) String() string
func (*DistanceUnit) UnmarshalGQL ¶ added in v1.3.0
func (e *DistanceUnit) UnmarshalGQL(v any) error
func (*DistanceUnit) UnmarshalJSON ¶ added in v1.3.0
func (e *DistanceUnit) UnmarshalJSON(b []byte) error
type Duration ¶ added in v1.3.0
type Duration struct {
Duration float64 `json:"duration"`
Units DurationUnit `json:"units"`
}
type DurationUnit ¶ added in v1.3.0
type DurationUnit string
const (
DurationUnitSeconds DurationUnit = "SECONDS"
)
func (DurationUnit) IsValid ¶ added in v1.3.0
func (e DurationUnit) IsValid() bool
func (DurationUnit) MarshalGQL ¶ added in v1.3.0
func (e DurationUnit) MarshalGQL(w io.Writer)
func (DurationUnit) MarshalJSON ¶ added in v1.3.0
func (e DurationUnit) MarshalJSON() ([]byte, error)
func (DurationUnit) String ¶ added in v1.3.0
func (e DurationUnit) String() string
func (*DurationUnit) UnmarshalGQL ¶ added in v1.3.0
func (e *DurationUnit) UnmarshalGQL(v any) error
func (*DurationUnit) UnmarshalJSON ¶ added in v1.3.0
func (e *DurationUnit) UnmarshalJSON(b []byte) error
type EntityDeleteResult ¶ added in v1.3.0
type EntityDeleteResult struct {
// ID of deleted entity
ID int `json:"id"`
}
Result of entity delete operation
type EntityFinder ¶ added in v1.3.0
type EntityFinder interface {
FindAgencies(context.Context, *int, *Cursor, []int, *AgencyFilter) ([]*Agency, error)
FindRoutes(context.Context, *int, *Cursor, []int, *RouteFilter) ([]*Route, error)
FindStops(context.Context, *int, *Cursor, []int, *StopFilter) ([]*Stop, error)
FindTrips(context.Context, *int, *Cursor, []int, *TripFilter) ([]*Trip, error)
FindFeedVersions(context.Context, *int, *Cursor, []int, *FeedVersionFilter) ([]*FeedVersion, error)
FindFeeds(context.Context, *int, *Cursor, []int, *FeedFilter) ([]*Feed, error)
FindOperators(context.Context, *int, *Cursor, []int, *OperatorFilter) ([]*Operator, error)
FindPlaces(context.Context, *int, *Cursor, []int, *PlaceAggregationLevel, *PlaceFilter) ([]*Place, error)
FindCensusDatasets(context.Context, *int, *Cursor, []int, *CensusDatasetFilter) ([]*CensusDataset, error)
RouteStopBuffer(context.Context, *int, *float64, int) ([]*RouteStopBuffer, error)
FindFeedVersionServiceWindow(context.Context, int) (*ServiceWindow, error)
DBX() tldb.Ext // escape hatch, for now
}
Finder handles basic queries
type EntityLoader ¶ added in v1.3.0
type EntityLoader interface {
AgenciesByFeedVersionIDs(ctx context.Context, limit *int, where *AgencyFilter, feedVersionIds []int) ([][]*Agency, error)
AgenciesByIDs(context.Context, []int) ([]*Agency, []error)
AgenciesByOnestopIDs(context.Context, *int, *AgencyFilter, []string) ([][]*Agency, error)
AgencyPlacesByAgencyIDs(context.Context, *int, *AgencyPlaceFilter, []int) ([][]*AgencyPlace, error)
BookingRulesByFeedVersionIDs(context.Context, *int, *BookingRuleFilter, []int) ([][]*BookingRule, error)
BookingRulesByIDs(context.Context, []int) ([]*BookingRule, []error)
CalendarDatesByServiceIDs(context.Context, *int, *CalendarDateFilter, []int) ([][]*CalendarDate, error)
CalendarsByIDs(context.Context, []int) ([]*Calendar, []error)
CensusDatasetLayersByDatasetIDs(context.Context, []int) ([][]*CensusLayer, []error)
CensusFieldsByTableIDs(context.Context, *int, []int) ([][]*CensusField, error)
CensusGeographiesByDatasetIDs(context.Context, *int, *CensusDatasetGeographyFilter, []int) ([][]*CensusGeography, error)
CensusGeographiesByEntityIDs(context.Context, *int, *CensusGeographyFilter, string, []int) ([][]*CensusGeography, error)
CensusGeographiesByLayerIDs(context.Context, *int, *CensusSourceGeographyFilter, []int) ([][]*CensusGeography, error)
CensusGeographiesBySourceIDs(context.Context, *int, *CensusSourceGeographyFilter, []int) ([][]*CensusGeography, error)
CensusLayersByIDs(context.Context, []int) ([]*CensusLayer, []error)
CensusSourcesByIDs(context.Context, []int) ([]*CensusSource, []error)
CensusSourceLayersBySourceIDs(context.Context, []int) ([][]*CensusLayer, []error)
CensusSourcesByDatasetIDs(context.Context, *int, *CensusSourceFilter, []int) ([][]*CensusSource, error)
CensusTableByIDs(context.Context, []int) ([]*CensusTable, []error)
CensusValuesByGeographyIDs(context.Context, *int, string, []string, []string) ([][]*CensusValue, error)
FeedFetchesByFeedIDs(context.Context, *int, *FeedFetchFilter, []int) ([][]*FeedFetch, error)
FeedInfosByFeedVersionIDs(context.Context, *int, []int) ([][]*FeedInfo, error)
FeedsByIDs(context.Context, []int) ([]*Feed, []error)
FeedsByOperatorOnestopIDs(context.Context, *int, *FeedFilter, []string) ([][]*Feed, error)
FeedStatesByFeedIDs(context.Context, []int) ([]*FeedState, []error)
FeedVersionFileInfosByFeedVersionIDs(context.Context, *int, []int) ([][]*FeedVersionFileInfo, error)
FeedVersionGeometryByIDs(context.Context, []int) ([]*tt.Polygon, []error)
FeedVersionGtfsImportByFeedVersionIDs(context.Context, []int) ([]*FeedVersionGtfsImport, []error)
FeedVersionsByFeedIDs(context.Context, *int, *FeedVersionFilter, []int) ([][]*FeedVersion, error)
FeedVersionsByIDs(context.Context, []int) ([]*FeedVersion, []error)
FeedVersionServiceLevelsByFeedVersionIDs(context.Context, *int, *FeedVersionServiceLevelFilter, []int) ([][]*FeedVersionServiceLevel, error)
FeedVersionServiceWindowByFeedVersionIDs(context.Context, []int) ([]*FeedVersionServiceWindow, []error)
FlexStopTimesByStopIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*FlexStopTime, error)
FlexStopTimesByLocationIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*FlexStopTime, error)
FlexStopTimesByLocationGroupIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*FlexStopTime, error)
FlexStopTimesByTripIDs(context.Context, *int, *TripStopTimeFilter, []FVPair) ([][]*FlexStopTime, error)
FrequenciesByTripIDs(context.Context, *int, []int) ([][]*Frequency, error)
LevelsByIDs(context.Context, []int) ([]*Level, []error)
LevelsByParentStationIDs(context.Context, *int, []int) ([][]*Level, error)
LocationGroupsByFeedVersionIDs(context.Context, *int, *LocationGroupFilter, []int) ([][]*LocationGroup, error)
LocationGroupsByIDs(context.Context, []int) ([]*LocationGroup, []error)
LocationGroupsByStopIDs(context.Context, *int, []int) ([][]*LocationGroup, error)
LocationsByFeedVersionIDs(context.Context, *int, *LocationFilter, []int) ([][]*Location, error)
LocationsByIDs(context.Context, []int) ([]*Location, []error)
OperatorsByAgencyIDs(context.Context, []int) ([]*Operator, []error)
OperatorsByCOIFs(context.Context, []int) ([]*Operator, []error)
OperatorsByFeedIDs(context.Context, *int, *OperatorFilter, []int) ([][]*Operator, error)
PathwaysByFromStopIDs(context.Context, *int, *PathwayFilter, []int) ([][]*Pathway, error)
PathwaysByIDs(context.Context, []int) ([]*Pathway, []error)
PathwaysByToStopIDs(context.Context, *int, *PathwayFilter, []int) ([][]*Pathway, error)
RouteAttributesByRouteIDs(context.Context, []int) ([]*RouteAttribute, []error)
RouteGeometriesByRouteIDs(context.Context, *int, []int) ([][]*RouteGeometry, error)
RouteHeadwaysByRouteIDs(context.Context, *int, []int) ([][]*RouteHeadway, error)
RoutesByAgencyIDs(context.Context, *int, *RouteFilter, []int) ([][]*Route, error)
RoutesByFeedVersionIDs(context.Context, *int, *RouteFilter, []int) ([][]*Route, error)
RoutesByIDs(context.Context, []int) ([]*Route, []error)
RouteStopPatternsByRouteIDs(context.Context, *int, []int) ([][]*RouteStopPattern, error)
RouteStopsByRouteIDs(context.Context, *int, []int) ([][]*RouteStop, error)
RouteStopsByStopIDs(context.Context, *int, []int) ([][]*RouteStop, error)
SegmentPatternsByRouteIDs(context.Context, *int, *SegmentPatternFilter, []int) ([][]*SegmentPattern, error)
SegmentPatternsBySegmentIDs(context.Context, *int, *SegmentPatternFilter, []int) ([][]*SegmentPattern, error)
SegmentsByFeedVersionIDs(context.Context, *int, *SegmentFilter, []int) ([][]*Segment, error)
SegmentsByIDs(context.Context, []int) ([]*Segment, []error)
SegmentsByRouteIDs(context.Context, *int, *SegmentFilter, []int) ([][]*Segment, error)
ShapesByIDs(context.Context, []int) ([]*Shape, []error)
StopExternalReferencesByStopIDs(context.Context, []int) ([]*StopExternalReference, []error)
StopObservationsByStopIDs(context.Context, *int, *StopObservationFilter, []int) ([][]*StopObservation, error)
StopPlacesByStopID(context.Context, []StopPlaceParam) ([]*StopPlace, []error)
StopsByFeedVersionIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)
StopsByIDs(context.Context, []int) ([]*Stop, []error)
StopsByLevelIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)
StopsByLocationGroupIDs(context.Context, *int, []int) ([][]*Stop, error)
StopsByParentStopIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)
StopsByRouteIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)
StopTimesByStopIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*StopTime, error)
StopTimesByTripIDs(context.Context, *int, *TripStopTimeFilter, []FVPair) ([][]*StopTime, error)
TargetStopsByStopIDs(context.Context, []int) ([]*Stop, []error)
TripsByFeedVersionIDs(context.Context, *int, *TripFilter, []int) ([][]*Trip, error)
TripsByIDs(context.Context, []int) ([]*Trip, []error)
TripsByRouteIDs(context.Context, *int, *TripFilter, []FVPair) ([][]*Trip, error)
ValidationReportErrorExemplarsByValidationReportErrorGroupIDs(context.Context, *int, []int) ([][]*ValidationReportError, error)
ValidationReportErrorGroupsByValidationReportIDs(context.Context, *int, []int) ([][]*ValidationReportErrorGroup, error)
ValidationReportsByFeedVersionIDs(context.Context, *int, *ValidationReportFilter, []int) ([][]*ValidationReport, error)
}
type EntityMutator ¶ added in v1.3.0
type EntityMutator interface {
StopCreate(ctx context.Context, input StopSetInput) (int, error)
StopUpdate(ctx context.Context, input StopSetInput) (int, error)
StopDelete(ctx context.Context, id int) error
PathwayCreate(ctx context.Context, input PathwaySetInput) (int, error)
PathwayUpdate(ctx context.Context, input PathwaySetInput) (int, error)
PathwayDelete(ctx context.Context, id int) error
LevelCreate(ctx context.Context, input LevelSetInput) (int, error)
LevelUpdate(ctx context.Context, input LevelSetInput) (int, error)
LevelDelete(ctx context.Context, id int) error
}
type FeedAuthorization ¶
type FeedAuthorization struct {
dmfr.FeedAuthorization
}
type FeedFetchFilter ¶ added in v1.3.0
type FeedFetchFilter struct {
// Search for feed fetches with success (true) or failure (false) or unspecified (null)
Success *bool `json:"success,omitempty"`
}
Search options for feed fetches
type FeedFilter ¶
type FeedFilter struct {
// Search for feed with a specific OnestopID
OnestopID *string `json:"onestop_id,omitempty"`
// Search for feeds of certain data types
Spec []FeedSpecTypes `json:"spec,omitempty"`
// Search for feeds with or without a fetch error
FetchError *bool `json:"fetch_error,omitempty"`
// Search for feeds by their import status
ImportStatus *ImportStatus `json:"import_status,omitempty"`
// Full text search
Search *string `json:"search,omitempty"`
// Search for feeds with a tag
Tags *tt.Tags `json:"tags,omitempty"`
// Search for feeds by their source URLs
SourceURL *FeedSourceURL `json:"source_url,omitempty"`
// Search for feeds with these license details
License *LicenseFilter `json:"license,omitempty"`
// Search for feeds within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Search for feeds within this geographic polygon
Within *tt.Polygon `json:"within,omitempty"`
// Search for feeds within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
}
Search options for feeds
type FeedLicense ¶
type FeedLicense struct {
dmfr.FeedLicense
}
type FeedSourceURL ¶ added in v1.3.0
type FeedSourceURL struct {
// URL
URL *string `json:"url,omitempty"`
// URL type
Type *FeedSourceURLTypes `json:"type,omitempty"`
// Case sensitive search (true) or case insensitive search (false or null)
CaseSensitive *bool `json:"case_sensitive,omitempty"`
}
Search options for searching by source URL
type FeedSourceURLTypes ¶ added in v1.3.0
type FeedSourceURLTypes string
Feed source URL types
const ( // URL to the current static GTFS FeedSourceURLTypesStaticCurrent FeedSourceURLTypes = "static_current" // URL to a previously used static GTFS FeedSourceURLTypesStaticHistoric FeedSourceURLTypes = "static_historic" // URL to a planned future static GTFS FeedSourceURLTypesStaticPlanned FeedSourceURLTypes = "static_planned" // URL to a proposed future static GTFS FeedSourceURLTypesStaticHypothetical FeedSourceURLTypes = "static_hypothetical" // URL to GTFS-RT vehicle positions FeedSourceURLTypesRealtimeVehiclePositions FeedSourceURLTypes = "realtime_vehicle_positions" // URL to GTFS-RT trip updates FeedSourceURLTypesRealtimeTripUpdates FeedSourceURLTypes = "realtime_trip_updates" // URL to GTFS-RT alerts FeedSourceURLTypesRealtimeAlerts FeedSourceURLTypes = "realtime_alerts" // URL to a GBFS service auto-discovery endpoint FeedSourceURLTypesGbfsAutoDiscovery FeedSourceURLTypes = "gbfs_auto_discovery" // URL to a MDS data set FeedSourceURLTypesMdsProvider FeedSourceURLTypes = "mds_provider" )
func (FeedSourceURLTypes) IsValid ¶ added in v1.3.0
func (e FeedSourceURLTypes) IsValid() bool
func (FeedSourceURLTypes) MarshalGQL ¶ added in v1.3.0
func (e FeedSourceURLTypes) MarshalGQL(w io.Writer)
func (FeedSourceURLTypes) MarshalJSON ¶ added in v1.3.0
func (e FeedSourceURLTypes) MarshalJSON() ([]byte, error)
func (FeedSourceURLTypes) String ¶ added in v1.3.0
func (e FeedSourceURLTypes) String() string
func (*FeedSourceURLTypes) UnmarshalGQL ¶ added in v1.3.0
func (e *FeedSourceURLTypes) UnmarshalGQL(v any) error
func (*FeedSourceURLTypes) UnmarshalJSON ¶ added in v1.3.0
func (e *FeedSourceURLTypes) UnmarshalJSON(b []byte) error
type FeedSpecTypes ¶ added in v1.3.0
type FeedSpecTypes string
Type of data contained in a source feed
const ( // Static data FeedSpecTypesGtfs FeedSpecTypes = "GTFS" // GTFS-RT data FeedSpecTypesGtfsRt FeedSpecTypes = "GTFS_RT" // GBFS data FeedSpecTypesGbfs FeedSpecTypes = "GBFS" // MDS data FeedSpecTypesMds FeedSpecTypes = "MDS" )
func (FeedSpecTypes) FromDBString ¶ added in v1.3.0
func (f FeedSpecTypes) FromDBString(s string) *FeedSpecTypes
func (FeedSpecTypes) IsValid ¶ added in v1.3.0
func (e FeedSpecTypes) IsValid() bool
func (FeedSpecTypes) MarshalGQL ¶ added in v1.3.0
func (e FeedSpecTypes) MarshalGQL(w io.Writer)
func (FeedSpecTypes) MarshalJSON ¶ added in v1.3.0
func (e FeedSpecTypes) MarshalJSON() ([]byte, error)
func (FeedSpecTypes) String ¶ added in v1.3.0
func (e FeedSpecTypes) String() string
func (FeedSpecTypes) ToDBString ¶ added in v1.3.0
func (f FeedSpecTypes) ToDBString() string
func (*FeedSpecTypes) UnmarshalGQL ¶ added in v1.3.0
func (e *FeedSpecTypes) UnmarshalGQL(v any) error
func (*FeedSpecTypes) UnmarshalJSON ¶ added in v1.3.0
func (e *FeedSpecTypes) UnmarshalJSON(b []byte) error
type FeedVersion ¶
type FeedVersion struct {
SHA1Dir tt.String `json:"sha1_dir"`
dmfr.FeedVersion
}
type FeedVersionDeleteResult ¶
type FeedVersionDeleteResult struct {
// Did the delete succeed
Success bool `json:"success"`
}
Result of feed version delete operation
type FeedVersionFetchResult ¶
type FeedVersionFetchResult struct {
// Details of fetched feed version, if successful
FeedVersion *FeedVersion `json:"feed_version,omitempty"`
// Exception log if fetch failed
FetchError *string `json:"fetch_error,omitempty"`
// Set if the fetched feed version is already present in the database with the same directory contents
FoundSha1 bool `json:"found_sha1"`
// Set if the fetched feed version is already present in the database with the same SHA1 hash
FoundDirSha1 bool `json:"found_dir_sha1"`
}
Result of a feed fetch operation
type FeedVersionFileInfo ¶
type FeedVersionFileInfo struct {
dmfr.FeedVersionFileInfo
}
type FeedVersionFilter ¶
type FeedVersionFilter struct {
// Restrict to specific ids
Ids []int `json:"ids,omitempty"`
// Search for feed versions with the specified import status
ImportStatus *ImportStatus `json:"import_status,omitempty"`
// Search for feed versions with this feed OnestopID
FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
// Search for feed versions with this SHA1 hash
Sha1 *string `json:"sha1,omitempty"`
// Search for feed versions with this file identifier
File *string `json:"file,omitempty"`
// Search for feed versions with the specified feed integer IDs
FeedIds []int `json:"feed_ids,omitempty"`
// Search for feed versions that cover the specified date range
Covers *ServiceCoversFilter `json:"covers,omitempty"`
// Search for feed versions within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Search for feed versions within this geographic polygon
Within *tt.Polygon `json:"within,omitempty"`
// Search for feed versions within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
// Search for stops with these license details
License *LicenseFilter `json:"license,omitempty"`
}
Search options for feed versions
type FeedVersionGtfsImport ¶
type FeedVersionGtfsImport struct {
WarningCount *json.RawMessage `json:"warning_count"`
EntityCount *json.RawMessage `json:"entity_count"`
SkipEntityErrorCount *json.RawMessage `json:"skip_entity_error_count"`
SkipEntityReferenceCount *json.RawMessage `json:"skip_entity_reference_count"`
SkipEntityFilterCount *json.RawMessage `json:"skip_entity_filter_count"`
SkipEntityMarkedCount *json.RawMessage `json:"skip_entity_marked_count"`
dmfr.FeedVersionImport
}
type FeedVersionImportResult ¶
type FeedVersionImportResult struct {
// Did the import succeed
Success bool `json:"success"`
}
Result of feed version import operation
type FeedVersionInput ¶ added in v1.3.0
type FeedVersionInput struct {
// Feed version integer ID
ID *int `json:"id,omitempty"`
}
Specify a feed version
type FeedVersionServiceLevel ¶
type FeedVersionServiceLevel struct {
dmfr.FeedVersionServiceLevel
}
type FeedVersionServiceLevelFilter ¶
type FeedVersionServiceLevelFilter struct {
// Search for service level summaries starting on or after this date
StartDate *tt.Date `json:"start_date,omitempty"`
// Search for service level summaries ending on or before this date
EndDate *tt.Date `json:"end_date,omitempty"`
}
Search options for feed version service level summaries
type FeedVersionServiceWindow ¶ added in v1.3.0
type FeedVersionServiceWindow struct {
// Internal integer ID
ID int `json:"id"`
// Feed start date from feed_info.txt, if available
FeedStartDate *tt.Date `json:"feed_start_date,omitempty"`
// Feed end date from feed_info.txt, if available
FeedEndDate *tt.Date `json:"feed_end_date,omitempty"`
// Calculated earliest calendar date in service schedule
EarliestCalendarDate *tt.Date `json:"earliest_calendar_date,omitempty"`
// Calculated latest calendar date in service schedule
LatestCalendarDate *tt.Date `json:"latest_calendar_date,omitempty"`
// Week with most typical service patterns inside the service window
FallbackWeek *tt.Date `json:"fallback_week,omitempty"`
// Default timezone for this feed version
DefaultTimezone *string `json:"default_timezone,omitempty"`
FeedVersionID int `json:"-"`
}
Summary details on service dates in a feed version
type FeedVersionSetInput ¶
type FeedVersionSetInput struct {
// Entity ID to update
ID *int `json:"id,omitempty"`
// Set entity name to this value
Name *string `json:"name,omitempty"`
// Set entity description to this value
Description *string `json:"description,omitempty"`
}
Update a feed version entity
type FeedVersionUnimportResult ¶
type FeedVersionUnimportResult struct {
// Did the unimport succeed
Success bool `json:"success"`
}
Result of feed version unimport operation
type Finder ¶ added in v1.3.0
type Finder interface {
PermFinder
EntityFinder
EntityLoader
EntityMutator
}
Finder provides all necessary database methods
type FlexStopTime ¶ added in v1.3.0
type FlexStopTime = StopTime
FlexStopTime is an alias for StopTime. Both types represent stop_times records and share the same underlying model (gtfs.StopTime). The separation exists only for GraphQL schema purposes where they have different resolvers.
type FocusPoint ¶ added in v1.3.0
type GbfsAlertTime ¶ added in v1.3.0
type GbfsBikeRequest ¶ added in v1.3.0
type GbfsBikeRequest struct {
Near *PointRadius `json:"near,omitempty"`
}
type GbfsBrandAsset ¶ added in v1.3.0
type GbfsBrandAsset struct {
*gbfs.BrandAsset
}
type GbfsDockRequest ¶ added in v1.3.0
type GbfsDockRequest struct {
Near *PointRadius `json:"near,omitempty"`
}
type GbfsFeed ¶ added in v1.3.0
func (*GbfsFeed) Alerts ¶ added in v1.3.0
func (g *GbfsFeed) Alerts() []*GbfsSystemAlert
func (*GbfsFeed) Calendars ¶ added in v1.3.0
func (g *GbfsFeed) Calendars() []*GbfsSystemCalendar
func (*GbfsFeed) RentalHours ¶ added in v1.3.0
func (g *GbfsFeed) RentalHours() []*GbfsSystemHour
func (*GbfsFeed) StationInformation ¶ added in v1.3.0
func (g *GbfsFeed) StationInformation() []*GbfsStationInformation
func (*GbfsFeed) SystemInformation ¶ added in v1.3.0
func (g *GbfsFeed) SystemInformation() *GbfsSystemInformation
type GbfsFinder ¶ added in v1.3.0
type GbfsFinder interface {
AddData(context.Context, string, gbfs.GbfsFeed) error
FindBikes(context.Context, *int, *GbfsBikeRequest) ([]*GbfsFreeBikeStatus, error)
FindDocks(context.Context, *int, *GbfsDockRequest) ([]*GbfsStationInformation, error)
}
GbfsFinder manages and looks up GBFS data
type GbfsFreeBikeStatus ¶ added in v1.3.0
type GbfsFreeBikeStatus struct {
Feed *GbfsFeed
*gbfs.FreeBikeStatus
}
func (*GbfsFreeBikeStatus) HomeStation ¶ added in v1.3.0
func (g *GbfsFreeBikeStatus) HomeStation() *GbfsStationInformation
func (*GbfsFreeBikeStatus) PricingPlan ¶ added in v1.3.0
func (g *GbfsFreeBikeStatus) PricingPlan() *GbfsSystemPricingPlan
func (*GbfsFreeBikeStatus) RentalUris ¶ added in v1.3.0
func (g *GbfsFreeBikeStatus) RentalUris() *GbfsRentalUris
func (*GbfsFreeBikeStatus) Station ¶ added in v1.3.0
func (g *GbfsFreeBikeStatus) Station() *GbfsStationInformation
func (*GbfsFreeBikeStatus) VehicleType ¶ added in v1.3.0
func (g *GbfsFreeBikeStatus) VehicleType() *GbfsVehicleType
type GbfsGeofenceFeature ¶ added in v1.3.0
type GbfsGeofenceFeature struct {
*gbfs.GeofenceFeature
}
func (*GbfsGeofenceFeature) Properties ¶ added in v1.3.0
func (g *GbfsGeofenceFeature) Properties() []*GbfsGeofenceProperty
type GbfsGeofenceProperty ¶ added in v1.3.0
type GbfsGeofenceProperty struct {
*gbfs.GeofenceProperty
}
func (*GbfsGeofenceProperty) Rules ¶ added in v1.3.0
func (g *GbfsGeofenceProperty) Rules() []*GbfsGeofenceRule
type GbfsGeofenceRule ¶ added in v1.3.0
type GbfsGeofenceRule struct {
*gbfs.GeofenceRule
}
func (*GbfsGeofenceRule) VehicleType ¶ added in v1.3.0
func (g *GbfsGeofenceRule) VehicleType() *GbfsVehicleType
type GbfsGeofenceZone ¶ added in v1.3.0
type GbfsGeofenceZone struct {
*gbfs.GeofenceZone
}
func (*GbfsGeofenceZone) Features ¶ added in v1.3.0
func (g *GbfsGeofenceZone) Features() []*GbfsGeofenceFeature
type GbfsPlanPrice ¶ added in v1.3.0
type GbfsRentalApp ¶ added in v1.3.0
type GbfsRentalApps ¶ added in v1.3.0
type GbfsRentalApps struct {
*gbfs.RentalApps
}
func (*GbfsRentalApps) Android ¶ added in v1.3.0
func (g *GbfsRentalApps) Android() *GbfsRentalApp
func (*GbfsRentalApps) Ios ¶ added in v1.3.0
func (g *GbfsRentalApps) Ios() *GbfsRentalApp
type GbfsRentalUris ¶ added in v1.3.0
type GbfsRentalUris struct {
*gbfs.RentalURIs
}
type GbfsStationInformation ¶ added in v1.3.0
type GbfsStationInformation struct {
Feed *GbfsFeed
*gbfs.StationInformation
}
func (*GbfsStationInformation) Region ¶ added in v1.3.0
func (g *GbfsStationInformation) Region() *GbfsSystemRegion
func (*GbfsStationInformation) Status ¶ added in v1.3.0
func (g *GbfsStationInformation) Status() *GbfsStationStatus
type GbfsStationStatus ¶ added in v1.3.0
type GbfsStationStatus struct {
Feed *GbfsFeed
*gbfs.StationStatus
}
func (*GbfsStationStatus) VehicleDocksAvailable ¶ added in v1.3.0
func (g *GbfsStationStatus) VehicleDocksAvailable() []*GbfsVehicleDockAvailable
func (*GbfsStationStatus) VehicleTypesAvailable ¶ added in v1.3.0
func (g *GbfsStationStatus) VehicleTypesAvailable() []*GbfsVehicleTypeAvailable
type GbfsSystemAlert ¶ added in v1.3.0
type GbfsSystemAlert struct {
*gbfs.SystemAlert
}
func (*GbfsSystemAlert) Times ¶ added in v1.3.0
func (g *GbfsSystemAlert) Times() []*GbfsAlertTime
type GbfsSystemCalendar ¶ added in v1.3.0
type GbfsSystemCalendar struct {
*gbfs.SystemCalendar
}
type GbfsSystemHour ¶ added in v1.3.0
type GbfsSystemHour struct {
*gbfs.SystemHour
}
type GbfsSystemInformation ¶ added in v1.3.0
type GbfsSystemInformation struct {
Feed *GbfsFeed
*gbfs.SystemInformation
}
func (*GbfsSystemInformation) BrandAssets ¶ added in v1.3.0
func (g *GbfsSystemInformation) BrandAssets() *GbfsBrandAsset
func (*GbfsSystemInformation) RentalApps ¶ added in v1.3.0
func (g *GbfsSystemInformation) RentalApps() *GbfsRentalApps
type GbfsSystemPricingPlan ¶ added in v1.3.0
type GbfsSystemPricingPlan struct {
*gbfs.SystemPricingPlan
}
func (*GbfsSystemPricingPlan) PerKmPricing ¶ added in v1.3.0
func (g *GbfsSystemPricingPlan) PerKmPricing() []*GbfsPlanPrice
func (*GbfsSystemPricingPlan) PerMinPricing ¶ added in v1.3.0
func (g *GbfsSystemPricingPlan) PerMinPricing() []*GbfsPlanPrice
type GbfsSystemRegion ¶ added in v1.3.0
type GbfsSystemRegion struct {
*gbfs.SystemRegion
}
type GbfsSystemVersion ¶ added in v1.3.0
type GbfsSystemVersion struct {
*gbfs.SystemVersion
}
type GbfsVehicleAssets ¶ added in v1.3.0
type GbfsVehicleAssets struct {
*gbfs.VehicleAssets
}
type GbfsVehicleDockAvailable ¶ added in v1.3.0
type GbfsVehicleDockAvailable struct {
Feed *GbfsFeed
*gbfs.VehicleDockAvailable
}
func (*GbfsVehicleDockAvailable) VehicleTypes ¶ added in v1.3.0
func (g *GbfsVehicleDockAvailable) VehicleTypes() []*GbfsVehicleType
type GbfsVehicleType ¶ added in v1.3.0
type GbfsVehicleType struct {
Feed *GbfsFeed
*gbfs.VehicleType
}
func (*GbfsVehicleType) DefaultPricingPlan ¶ added in v1.3.0
func (g *GbfsVehicleType) DefaultPricingPlan() *GbfsSystemPricingPlan
func (*GbfsVehicleType) PricingPlans ¶ added in v1.3.0
func (g *GbfsVehicleType) PricingPlans() []*GbfsSystemPricingPlan
func (*GbfsVehicleType) RentalUris ¶ added in v1.3.0
func (g *GbfsVehicleType) RentalUris() *GbfsRentalUris
func (*GbfsVehicleType) VehicleAssets ¶ added in v1.3.0
func (g *GbfsVehicleType) VehicleAssets() *GbfsVehicleAssets
type GbfsVehicleTypeAvailable ¶ added in v1.3.0
type GbfsVehicleTypeAvailable struct {
Feed *GbfsFeed
*gbfs.VehicleTypeAvailable
}
func (*GbfsVehicleTypeAvailable) VehicleType ¶ added in v1.3.0
func (g *GbfsVehicleTypeAvailable) VehicleType() *GbfsVehicleType
type ImportStatus ¶
type ImportStatus string
Import status for a feed version
const ( // Imported successfully ImportStatusSuccess ImportStatus = "SUCCESS" // Did not import successfully ImportStatusError ImportStatus = "ERROR" // Import is currently in progress ImportStatusInProgress ImportStatus = "IN_PROGRESS" )
func (ImportStatus) IsValid ¶
func (e ImportStatus) IsValid() bool
func (ImportStatus) MarshalGQL ¶
func (e ImportStatus) MarshalGQL(w io.Writer)
func (ImportStatus) MarshalJSON ¶ added in v1.3.0
func (e ImportStatus) MarshalJSON() ([]byte, error)
func (ImportStatus) String ¶
func (e ImportStatus) String() string
func (*ImportStatus) UnmarshalGQL ¶
func (e *ImportStatus) UnmarshalGQL(v any) error
func (*ImportStatus) UnmarshalJSON ¶ added in v1.3.0
func (e *ImportStatus) UnmarshalJSON(b []byte) error
type Leg ¶ added in v1.3.0
type Leg struct {
Duration *Duration `json:"duration"`
Distance *Distance `json:"distance"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
From *Waypoint `json:"from,omitempty"`
To *Waypoint `json:"to,omitempty"`
Mode *StepMode `json:"mode,omitempty"`
Steps []*Step `json:"steps,omitempty"`
Stops []*WaypointDeparture `json:"stops,omitempty"`
Geometry tt.LineString `json:"geometry"`
Trip *LegTrip `json:"trip,omitempty"`
}
type LegRoute ¶ added in v1.3.0
type LegRoute struct {
RouteID string `json:"route_id"`
RouteShortName string `json:"route_short_name"`
RouteLongName string `json:"route_long_name"`
RouteOnestopID string `json:"route_onestop_id"`
RouteType int `json:"route_type"`
RouteColor *string `json:"route_color,omitempty"`
RouteTextColor *string `json:"route_text_color,omitempty"`
Agency *LegRouteAgency `json:"agency"`
}
type LegRouteAgency ¶ added in v1.3.0
type LevelSetInput ¶ added in v1.3.0
type LevelSetInput struct {
// Entity ID to update
ID *int `json:"id,omitempty"`
// Feed version of entity to update
FeedVersion *FeedVersionInput `json:"feed_version,omitempty"`
// Set GTFS level_id to this value
LevelID *string `json:"level_id,omitempty"`
// Set GTFS level_name to this value
LevelName *string `json:"level_name,omitempty"`
// Set GTFS level_index to this value
LevelIndex *float64 `json:"level_index,omitempty"`
// Set level geometry to this value
Geometry *tt.MultiPolygon `json:"geometry,omitempty"`
// Set level parent station to this stop
Parent *StopSetInput `json:"parent,omitempty"`
}
Update a level entity
type LicenseFilter ¶ added in v1.3.0
type LicenseFilter struct {
ShareAlikeOptional *LicenseValue `json:"share_alike_optional,omitempty"`
// Search for entities with this Create Derived Product license restriction
CreateDerivedProduct *LicenseValue `json:"create_derived_product,omitempty"`
// Search for entities with this Commercial Use Allowed restriction
CommercialUseAllowed *LicenseValue `json:"commercial_use_allowed,omitempty"`
// Search for entities with this Use Without Attribution restriction
UseWithoutAttribution *LicenseValue `json:"use_without_attribution,omitempty"`
// Search for entities with this Redistribution Allowed restriction
RedistributionAllowed *LicenseValue `json:"redistribution_allowed,omitempty"`
}
Search for entities with these license requirements. See feed license documentation.
type LicenseValue ¶ added in v1.3.0
type LicenseValue string
Permissable and impermissable actions for a given license use
const ( // Use is allowed LicenseValueYes LicenseValue = "YES" // Use is not allowed LicenseValueNo LicenseValue = "NO" // Use is YES or UNKNOWN LicenseValueExcludeNo LicenseValue = "EXCLUDE_NO" // Use is not known LicenseValueUnknown LicenseValue = "UNKNOWN" )
func (LicenseValue) IsValid ¶ added in v1.3.0
func (e LicenseValue) IsValid() bool
func (LicenseValue) MarshalGQL ¶ added in v1.3.0
func (e LicenseValue) MarshalGQL(w io.Writer)
func (LicenseValue) MarshalJSON ¶ added in v1.3.0
func (e LicenseValue) MarshalJSON() ([]byte, error)
func (LicenseValue) String ¶ added in v1.3.0
func (e LicenseValue) String() string
func (*LicenseValue) UnmarshalGQL ¶ added in v1.3.0
func (e *LicenseValue) UnmarshalGQL(v any) error
func (*LicenseValue) UnmarshalJSON ¶ added in v1.3.0
func (e *LicenseValue) UnmarshalJSON(b []byte) error
type LocationFilter ¶ added in v1.3.0
type LocationFilter struct {
// Restrict to specific ids
Ids []int `json:"ids,omitempty"`
// Search for locations with this location_id
LocationID *string `json:"location_id,omitempty"`
}
Search options for locations
type LocationGroup ¶ added in v1.3.0
type LocationGroup struct {
FeedOnestopID string
FeedVersionSHA1 string
gtfs.LocationGroup
}
type LocationGroupFilter ¶ added in v1.3.0
type LocationGroupFilter struct {
// Restrict to specific ids
Ids []int `json:"ids,omitempty"`
// Search for location groups with this location_group_id
LocationGroupID *string `json:"location_group_id,omitempty"`
}
Search options for location groups
type LocationGroupStop ¶ added in v1.3.0
type LocationGroupStop struct {
gtfs.LocationGroupStop
}
type Me ¶ added in v1.3.0
type Me struct {
// Internal identifier
ID string `json:"id"`
// User name
Name *string `json:"name,omitempty"`
// User email
Email *string `json:"email,omitempty"`
// User associated roles
Roles []string `json:"roles,omitempty"`
// User associated external data, e.g. metering service identifiers
ExternalData tt.Map `json:"external_data"`
}
Current user metadata
type OperatorFilter ¶
type OperatorFilter struct {
// Merge multiple agency-operator associations into single operator results
Merged *bool `json:"merged,omitempty"`
// Search for operators with this OnestopID
OnestopID *string `json:"onestop_id,omitempty"`
// Search for operators with this feed OnestopID
FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
// Search for operators with agencies having this GTFS agency_id
AgencyID *string `json:"agency_id,omitempty"`
// Full-text search string
Search *string `json:"search,omitempty"`
// Search for operators with this set of tag key/values
Tags *tt.Tags `json:"tags,omitempty"`
// Search for operators by city name (provided by Natural Earth)
CityName *string `json:"city_name,omitempty"`
// Search for operators by country name (provided by Natural Earth)
Adm0Name *string `json:"adm0_name,omitempty"`
// Search for operators by state/province/division name (provided by Natural Earth)
Adm1Name *string `json:"adm1_name,omitempty"`
// Search for operators by country 2 letter ISO 3166 code (provided by Natural Earth)
Adm0Iso *string `json:"adm0_iso,omitempty"`
// Search for operators by state/province/division ISO 3166-2 code (provided by Natural Earth)
Adm1Iso *string `json:"adm1_iso,omitempty"`
// Search for operators with these license details
License *LicenseFilter `json:"license,omitempty"`
// Search for operators within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Search for operators within this geographic polygon
Within *tt.Polygon `json:"within,omitempty"`
// Search for operators within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
}
Search options for operators
type PathwayFilter ¶
type PathwayFilter struct {
// Search for pathways with this GTFS pathway_mode
PathwayMode *int `json:"pathway_mode,omitempty"`
}
Search options for pathways
type PathwaySetInput ¶ added in v1.3.0
type PathwaySetInput struct {
// Entity ID to update
ID *int `json:"id,omitempty"`
// Feed version of entity to update
FeedVersion *FeedVersionInput `json:"feed_version,omitempty"`
// Set GTFS pathway_id to this value
PathwayID *string `json:"pathway_id,omitempty"`
// Set GTFS pathway_mode to this value
PathwayMode *int `json:"pathway_mode,omitempty"`
// Set GTFS is_bidirectional to this value
IsBidirectional *int `json:"is_bidirectional,omitempty"`
// Set GTFS length to this value
Length *float64 `json:"length,omitempty"`
// Set GTFS traversal_time to this value
TraversalTime *int `json:"traversal_time,omitempty"`
// Set GTFS stair_count to this value
StairCount *int `json:"stair_count,omitempty"`
// Set GTFS max_slope to this value
MaxSlope *float64 `json:"max_slope,omitempty"`
// Set GTFS min_width to this value
MinWidth *float64 `json:"min_width,omitempty"`
// Set GTFS signposted_as to this value
SignpostedAs *string `json:"signposted_as,omitempty"`
// Set GTFS reverse_signposted_as to this value
ReverseSignpostedAs *string `json:"reverse_signposted_as,omitempty"`
// Set pathway origin to this stop
FromStop *StopSetInput `json:"from_stop,omitempty"`
// Set pathway destination to this stop
ToStop *StopSetInput `json:"to_stop,omitempty"`
}
Update a pathway entity
type PermFilter ¶ added in v1.3.0
func PermsForContext ¶ added in v1.3.0
func PermsForContext(ctx context.Context) *PermFilter
func (*PermFilter) GetAllowedFeedVersions ¶ added in v1.3.0
func (pf *PermFilter) GetAllowedFeedVersions() []int
func (*PermFilter) GetAllowedFeeds ¶ added in v1.3.0
func (pf *PermFilter) GetAllowedFeeds() []int
type PermFinder ¶ added in v1.3.0
type PermFinder interface {
PermFilter(context.Context) *PermFilter
}
type Place ¶ added in v1.3.0
type Place struct {
// Country name
Adm0Name *string `json:"adm0_name,omitempty"`
// State or province name
Adm1Name *string `json:"adm1_name,omitempty"`
// City name
CityName *string `json:"city_name,omitempty"`
// Number of associated operators
Count int `json:"count"`
// Operators associated with this place
Operators []*Operator `json:"operators,omitempty"`
AgencyIDs tt.Ints `db:"agency_ids"`
}
Place name and associated operators
type PlaceAggregationLevel ¶ added in v1.3.0
type PlaceAggregationLevel string
PlaceAggregationLevel controls the level of aggregation in a places query
const ( // Aggregate places based on country PlaceAggregationLevelAdm0 PlaceAggregationLevel = "ADM0" // Aggregate places based on country and state/province PlaceAggregationLevelAdm0Adm1 PlaceAggregationLevel = "ADM0_ADM1" // Aggregate places based on country, state/province, and city PlaceAggregationLevelAdm0Adm1City PlaceAggregationLevel = "ADM0_ADM1_CITY" // Aggregate places based on country and city PlaceAggregationLevelAdm0City PlaceAggregationLevel = "ADM0_CITY" // Aggregate places based on state/province and city PlaceAggregationLevelAdm1City PlaceAggregationLevel = "ADM1_CITY" // Aggregate places based on city PlaceAggregationLevelCity PlaceAggregationLevel = "CITY" )
func (PlaceAggregationLevel) IsValid ¶ added in v1.3.0
func (e PlaceAggregationLevel) IsValid() bool
func (PlaceAggregationLevel) MarshalGQL ¶ added in v1.3.0
func (e PlaceAggregationLevel) MarshalGQL(w io.Writer)
func (PlaceAggregationLevel) MarshalJSON ¶ added in v1.3.0
func (e PlaceAggregationLevel) MarshalJSON() ([]byte, error)
func (PlaceAggregationLevel) String ¶ added in v1.3.0
func (e PlaceAggregationLevel) String() string
func (*PlaceAggregationLevel) UnmarshalGQL ¶ added in v1.3.0
func (e *PlaceAggregationLevel) UnmarshalGQL(v any) error
func (*PlaceAggregationLevel) UnmarshalJSON ¶ added in v1.3.0
func (e *PlaceAggregationLevel) UnmarshalJSON(b []byte) error
type PlaceFilter ¶ added in v1.3.0
type PlaceFilter struct {
// Search for place associations with at least this rank value
MinRank *float64 `json:"min_rank,omitempty"`
// Search for place associations by country name (provided by Natural Earth)
Adm0Name *string `json:"adm0_name,omitempty"`
// Search for place associations by state/province/division name (provided by Natural Earth)
Adm1Name *string `json:"adm1_name,omitempty"`
// Search for place associations by city name (provided by Natural Earth)
CityName *string `json:"city_name,omitempty"`
}
Search options for associated places
type PointRadius ¶
type PointRadius struct {
// Latitude
Lat float64 `json:"lat"`
// Longitude
Lon float64 `json:"lon"`
// Radius around specified point
Radius float64 `json:"radius"`
}
Search for entities within specified radius of a point
type RTFinder ¶ added in v1.3.0
type RTFinder interface {
AddData(context.Context, string, []byte) error
FindTrip(context.Context, *Trip) *pb.TripUpdate
MakeTrip(context.Context, *Trip) (*Trip, error)
FindAlertsForTrip(context.Context, *Trip, *int, *bool) []*Alert
FindAlertsForStop(context.Context, *Stop, *int, *bool) []*Alert
FindAlertsForRoute(context.Context, *Route, *int, *bool) []*Alert
FindAlertsForAgency(context.Context, *Agency, *int, *bool) []*Alert
GetAddedTripsForStop(context.Context, *Stop) []*pb.TripUpdate
FindStopTimeUpdate(context.Context, *Trip, *StopTime) (*RTStopTimeUpdate, bool)
// lookup cache methods
StopTimezone(context.Context, int, string) (*time.Location, bool)
FeedVersionTimezone(context.Context, int) (*time.Location, bool)
GetGtfsTripID(context.Context, int) (string, bool)
GetMessage(context.Context, string, string) (*pb.FeedMessage, bool)
}
RTFinder manages and looks up RT data
type RTStopTimeUpdate ¶ added in v1.3.0
type RTStopTimeUpdate struct {
LastDelay *int32
StopTimeUpdate *pb.TripUpdate_StopTimeUpdate
TripUpdate *pb.TripUpdate
}
type RTTimeRange ¶ added in v1.3.0
type RTTimeRange struct {
// GTFS-RT TimeRange start time, in Unix epoch seconds
Start *int `json:"start,omitempty"`
// GTFS-RT TimeRange end time, in Unix epoch seconds
End *int `json:"end,omitempty"`
}
See https://gtfs.org/reference/realtime/v2/#message-timerange
type RTTranslation ¶ added in v1.3.0
type RTTranslation struct {
// GTFS-RT TranslatedString translated text
Text string `json:"text"`
// GTFS-RT TranslatedString language for this translation
Language *string `json:"language,omitempty"`
}
See https://gtfs.org/reference/realtime/v2/#message-translatedstring
type RTTripDescriptor ¶ added in v1.3.0
type RTTripDescriptor struct {
// GTFS-RT TripDescriptor trip ID
TripID *string `json:"trip_id,omitempty"`
// GTFS-RT TripDescriptor route ID
RouteID *string `json:"route_id,omitempty"`
// GTFS-RT TripDescriptor trip direction
DirectionID *int `json:"direction_id,omitempty"`
// GTFS-RT TripDescriptor trip start time, in local time HH:MM:SS
StartTime *tt.Seconds `json:"start_time,omitempty"`
// GTFS-RT TripDescriptor trip start time, in local date
StartDate *tt.Date `json:"start_date,omitempty"`
// GTFS-RT TripDescriptor schedule relationship. See https://gtfs.org/realtime/reference/#enum-schedulerelationship-1
ScheduleRelationship *string `json:"schedule_relationship,omitempty"`
}
See https://gtfs.org/reference/realtime/v2/#message-tripdescriptor
type RTVehicleDescriptor ¶ added in v1.3.0
type RTVehicleDescriptor struct {
// GTFS-RT VehicleDescriptor vehicle ID
ID *string `json:"id,omitempty"`
// GTFS-RT VehicleDescriptor vehicle label
Label *string `json:"label,omitempty"`
// GTFS-RT VehicleDescriptor vehicle license plate
LicensePlate *string `json:"license_plate,omitempty"`
}
See https://gtfs.org/reference/realtime/v2/#message-vehicledescriptor
type RelativeDate ¶ added in v1.3.0
type RelativeDate string
RelativeDate specifies a calendar date relative to the current local time
const ( // The current date RelativeDateToday RelativeDate = "TODAY" // Next Monday, or today if it is currently Monday RelativeDateMonday RelativeDate = "MONDAY" // Next Tuesday, or today if it is currently Tuesday RelativeDateTuesday RelativeDate = "TUESDAY" // Next Wednesday, or today if it is currently Wednesday RelativeDateWednesday RelativeDate = "WEDNESDAY" // Next Thursday, or today if it is currently Thursday RelativeDateThursday RelativeDate = "THURSDAY" // Next Friday, or today if it is currently Friday RelativeDateFriday RelativeDate = "FRIDAY" // Next Saturday, or today if it is currently Saturday RelativeDateSaturday RelativeDate = "SATURDAY" // Next Sunday, or today if it is currently Sunday RelativeDateSunday RelativeDate = "SUNDAY" // Next Monday, not inclusive of today RelativeDateNextMonday RelativeDate = "NEXT_MONDAY" // Next Tuesday, not inclusive of today RelativeDateNextTuesday RelativeDate = "NEXT_TUESDAY" // Next Wednesday, not inclusive of today RelativeDateNextWednesday RelativeDate = "NEXT_WEDNESDAY" // Next Thursday, not inclusive of today RelativeDateNextThursday RelativeDate = "NEXT_THURSDAY" // Next Friday, not inclusive of today RelativeDateNextFriday RelativeDate = "NEXT_FRIDAY" // Next Saturday, not inclusive of today RelativeDateNextSaturday RelativeDate = "NEXT_SATURDAY" // Next Sunday, not inclusive of today RelativeDateNextSunday RelativeDate = "NEXT_SUNDAY" )
func (RelativeDate) IsValid ¶ added in v1.3.0
func (e RelativeDate) IsValid() bool
func (RelativeDate) MarshalGQL ¶ added in v1.3.0
func (e RelativeDate) MarshalGQL(w io.Writer)
func (RelativeDate) MarshalJSON ¶ added in v1.3.0
func (e RelativeDate) MarshalJSON() ([]byte, error)
func (RelativeDate) String ¶ added in v1.3.0
func (e RelativeDate) String() string
func (*RelativeDate) UnmarshalGQL ¶ added in v1.3.0
func (e *RelativeDate) UnmarshalGQL(v any) error
func (*RelativeDate) UnmarshalJSON ¶ added in v1.3.0
func (e *RelativeDate) UnmarshalJSON(b []byte) error
type RouteAttribute ¶ added in v1.3.0
type RouteAttribute struct {
// Route category
Category *int `json:"category,omitempty"`
// Route subcategory
Subcategory *int `json:"subcategory,omitempty"`
// Route running way category
RunningWay *int `json:"running_way,omitempty"`
RouteID int `json:"-"`
}
MTC GTFS+ Extension: route_attributes.txt
type RouteFilter ¶
type RouteFilter struct {
// Search for routes with this OnestopID
OnestopID *string `json:"onestop_id,omitempty"`
// Search for routes with these OnestopIDs
OnestopIds []string `json:"onestop_ids,omitempty"`
// Include previously used OnestopIDs that match the same (feed,route_id)
AllowPreviousOnestopIds *bool `json:"allow_previous_onestop_ids,omitempty"`
// Search for routes with this feed version SHA1 hash
FeedVersionSha1 *string `json:"feed_version_sha1,omitempty"`
// Search for routes with this feed OnestopID
FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
// Search for routes with this GTFS route_id
RouteID *string `json:"route_id,omitempty"`
// Search for routes with this GTFS route_type
RouteType *int `json:"route_type,omitempty"`
// Search for routes with any of these GTFS route_types
RouteTypes []int `json:"route_types,omitempty"`
// Search for routes with 1 or more trips (true) or 0 or more trips (false or null)
Serviced *bool `json:"serviced,omitempty"`
// Full text search
Search *string `json:"search,omitempty"`
// Search for routes operated by operators with this OnestopID
OperatorOnestopID *string `json:"operator_onestop_id,omitempty"`
// Search for routes with these license details
License *LicenseFilter `json:"license,omitempty"`
// Search for routes with these agency integer IDs. Deprecated.
AgencyIds []int `json:"agency_ids,omitempty"`
// Location
Location *RouteLocationFilter `json:"location,omitempty"`
// Backwards compat:Search for routes within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Backwards compat: Search for routes within this geographic polygon
Within *tt.Polygon `json:"within,omitempty"`
// Backwards compat: Search for routes within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
}
Search options for routes
type RouteGeometry ¶
type RouteGeometry struct {
// If true, the source GTFS feed provides no shapes. This route geometry is based on straight lines between stop points.
Generated bool `json:"generated"`
// A single LineString of this most common shape
Geometry *tt.LineString `json:"geometry,omitempty"`
// MultiLineString ensemble of the most common shapes for each direction
CombinedGeometry *tt.Geometry `json:"combined_geometry,omitempty"`
// Length (in meters) of the simple geometry
Length *float64 `json:"length,omitempty"`
// Maximum point-to-point distance in the geometry
MaxSegmentLength *float64 `json:"max_segment_length,omitempty"`
// First point max distance
FirstPointMaxDistance *float64 `json:"first_point_max_distance,omitempty"`
RouteID int `json:"-"`
}
Representative route geometries
type RouteHeadway ¶
type RouteHeadway struct {
// Stop used for the headway calculation
Stop *Stop `json:"stop"`
// Day of week category; 1=Weekday, 6=Saturday, 7=Sunday
DowCategory *int `json:"dow_category,omitempty"`
// Trip direction
DirectionID *int `json:"direction_id,omitempty"`
// Typical number of seconds between departing trips at this stop in this direction on this day of the week
HeadwaySecs *int `json:"headway_secs,omitempty"`
// Date used for the headway calculation
ServiceDate *tt.Date `json:"service_date,omitempty"`
// Number of departures on this stop, day, and direction
StopTripCount *int `json:"stop_trip_count,omitempty"`
// Actual departure times on this stop, day, and direction
DeparturesUnused []*tt.Seconds `json:"departures,omitempty"`
DepartureInts tt.Ints `db:"departures"`
RouteID int `json:"-"`
SelectedStopID int `json:"-"`
}
Calculated route headways
type RouteLocationFilter ¶ added in v1.3.0
type RouteLocationFilter struct {
// Search for routes within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Search for routes within this geographic polygon
Polygon *tt.Polygon `json:"polygon,omitempty"`
// Search for routes within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
// Focus search on this point; results will be sorted by distance
Focus *FocusPoint `json:"focus,omitempty"`
}
type RouteStop ¶
type RouteStop struct {
// Internal integer ID
ID int `json:"id"`
// Internal integer ID for this associated stop
StopID int `json:"stop_id"`
// Internal integer ID for this associated route
RouteID int `json:"route_id"`
// Internal integer ID for this associated agency
AgencyID int `json:"agency_id"`
// Associated route
Route *Route `json:"route"`
// Associated stop
Stop *Stop `json:"stop"`
// Associated agency
Agency *Agency `json:"agency"`
}
RouteStops describe associations between stops, routes, and agencies.
type RouteStopBuffer ¶
type RouteStopBuffer struct {
// Geographic buffer around route, based on requested meters
StopBuffer *tt.Geometry `json:"stop_buffer,omitempty"`
// Matching set of points (e.g. stops) found inside buffer
StopPoints *tt.Geometry `json:"stop_points,omitempty"`
// Convex hull of matching points
StopConvexhull *tt.Polygon `json:"stop_convexhull,omitempty"`
}
Geographic buffer around a route
type RouteStopPattern ¶ added in v1.3.0
type RouteStopPattern struct {
// An identifier for this stop pattern; an integer scoped to this particular feed version
StopPatternID int `json:"stop_pattern_id"`
// Direction ID of the trip
DirectionID int `json:"direction_id"`
// Count of trips for this stop pattern
Count int `json:"count"`
// Trips for this stop pattern
Trips []*Trip `json:"trips,omitempty"`
RouteID int `json:"-"`
}
RouteStopPattern describes a unique pattern of stops for a route
type ScheduleRelationship ¶ added in v1.3.0
type ScheduleRelationship string
GTFS-RT TripUpdate and StopTimeEvent schedule relationship.
This enum combines possible values from both schedule relationship types, plus an additional STATIC value.
See: - ScheduleRelationship(https://gtfs.org/realtime/reference/#enum-schedulerelationship) - ScheduleRelationship(https://gtfs.org/realtime/reference/#enum-schedulerelationship-1)
const ( ScheduleRelationshipScheduled ScheduleRelationship = "SCHEDULED" ScheduleRelationshipAdded ScheduleRelationship = "ADDED" ScheduleRelationshipUnscheduled ScheduleRelationship = "UNSCHEDULED" ScheduleRelationshipCanceled ScheduleRelationship = "CANCELED" ScheduleRelationshipStatic ScheduleRelationship = "STATIC" ScheduleRelationshipSkipped ScheduleRelationship = "SKIPPED" ScheduleRelationshipNoData ScheduleRelationship = "NO_DATA" ScheduleRelationshipReplacement ScheduleRelationship = "REPLACEMENT" ScheduleRelationshipDuplicated ScheduleRelationship = "DUPLICATED" ScheduleRelationshipDeleted ScheduleRelationship = "DELETED" )
func (ScheduleRelationship) IsValid ¶ added in v1.3.0
func (e ScheduleRelationship) IsValid() bool
func (ScheduleRelationship) MarshalGQL ¶ added in v1.3.0
func (e ScheduleRelationship) MarshalGQL(w io.Writer)
func (ScheduleRelationship) MarshalJSON ¶ added in v1.3.0
func (e ScheduleRelationship) MarshalJSON() ([]byte, error)
func (ScheduleRelationship) String ¶ added in v1.3.0
func (e ScheduleRelationship) String() string
func (*ScheduleRelationship) UnmarshalGQL ¶ added in v1.3.0
func (e *ScheduleRelationship) UnmarshalGQL(v any) error
func (*ScheduleRelationship) UnmarshalJSON ¶ added in v1.3.0
func (e *ScheduleRelationship) UnmarshalJSON(b []byte) error
type Segment ¶ added in v1.3.0
type Segment struct {
// Internal integer ID
ID int `json:"id"`
// OSM Way ID, if any, associated with this segment
WayID int `json:"way_id"`
// Geometry for this segment
Geometry tt.LineString `json:"geometry"`
// Routes and stop patterns associated with this segment
SegmentPatterns []*SegmentPattern `json:"segment_patterns,omitempty"`
FeedVersionID int `json:"-"`
WithRouteID int `json:"-"`
}
Normalized route segments
type SegmentFilter ¶ added in v1.3.0
type SegmentFilter struct {
// Search for segments associated with this layer name
Layer *string `json:"layer,omitempty"`
}
Search options for route segments
type SegmentPattern ¶ added in v1.3.0
type SegmentPattern struct {
// Internal integer ID
ID int `json:"id"`
// Route for this segment pattern
Route *Route `json:"route"`
// Stop pattern for this segment pattern
StopPatternID int `json:"stop_pattern_id"`
// Segment geometry for this pattern
Segment *Segment `json:"segment"`
RouteID int `json:"-"`
SegmentID int `json:"-"`
}
Normalized route segment patterns
type SegmentPatternFilter ¶ added in v1.3.0
type SegmentPatternFilter struct {
// Search for segments patterns associated with this layer name
Layer *string `json:"layer,omitempty"`
}
Search options for route segment patterns
type ServiceCoversFilter ¶ added in v1.3.0
type ServiceCoversFilter struct {
// Search for feed versions fetched after this time
FetchedAfter *time.Time `json:"fetched_after,omitempty"`
// Search for feed versions fetched before this time
FetchedBefore *time.Time `json:"fetched_before,omitempty"`
// Search using only feed_info.txt values
FeedStartDate *tt.Date `json:"feed_start_date,omitempty"`
// Search using only feed_info.txt values
FeedEndDate *tt.Date `json:"feed_end_date,omitempty"`
// Search using feed_info.txt values or calendar maximum service extent
StartDate *tt.Date `json:"start_date,omitempty"`
// Search using feed_info.txt values or calendar maximum service extent
EndDate *tt.Date `json:"end_date,omitempty"`
// Search using calendar maximum service extent
EarliestCalendarDate *tt.Date `json:"earliest_calendar_date,omitempty"`
// Search using calendar maximum service extent
LatestCalendarDate *tt.Date `json:"latest_calendar_date,omitempty"`
}
Search options for feed version date range coverage
type ServiceWindow ¶ added in v1.3.0
type Step ¶ added in v1.3.0
type Step struct {
Duration *Duration `json:"duration"`
Distance *Distance `json:"distance"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
To *Waypoint `json:"to,omitempty"`
Mode StepMode `json:"mode"`
Instruction string `json:"instruction"`
GeometryOffset int `json:"geometry_offset"`
}
type StepMode ¶ added in v1.3.0
type StepMode string
func (StepMode) MarshalGQL ¶ added in v1.3.0
func (StepMode) MarshalJSON ¶ added in v1.3.0
func (*StepMode) UnmarshalGQL ¶ added in v1.3.0
func (*StepMode) UnmarshalJSON ¶ added in v1.3.0
type StopBuffer ¶ added in v1.3.0
type StopBuffer struct {
// Search for geographies with these stop IDs
StopIds []int `json:"stop_ids,omitempty"`
// Stop ID search radius, in meters
Radius *float64 `json:"radius,omitempty"`
}
Search options for census geographies based on stop IDs
type StopExternalReference ¶ added in v1.3.0
type StopExternalReference struct {
dmfr.StopExternalReference
}
type StopExternalReferenceSetInput ¶ added in v1.3.0
type StopFilter ¶
type StopFilter struct {
// Search for stops with this OnestopID
OnestopID *string `json:"onestop_id,omitempty"`
// Search for stops with these OnestopIDs
OnestopIds []string `json:"onestop_ids,omitempty"`
// Include previous used OnestopIDs that match the same (feed,stop_id)
AllowPreviousOnestopIds *bool `json:"allow_previous_onestop_ids,omitempty"`
// Search for stops with this feed version SHA1 hash
FeedVersionSha1 *string `json:"feed_version_sha1,omitempty"`
// Search for stops with this feed OnestopID
FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
// Search for stops with this GTFS stop_id
StopID *string `json:"stop_id,omitempty"`
// Search for stops with this GTFS stop_code
StopCode *string `json:"stop_code,omitempty"`
// Search for stops with this GTFS location_type
LocationType *int `json:"location_type,omitempty"`
// Search for stops with 1 or more trips (true) or 0 or more trips (false or null)
Serviced *bool `json:"serviced,omitempty"`
// Full text search
Search *string `json:"search,omitempty"`
// Search for stops with these license details
License *LicenseFilter `json:"license,omitempty"`
// Search for stops with service by routes or operators with these OnestopIDs
ServedByOnestopIds []string `json:"served_by_onestop_ids,omitempty"`
// Search for stopswith service by routes with the specified GTFS route_type
ServedByRouteType *int `json:"served_by_route_type,omitempty"`
// Search for stopswith service by routes with any of the specified GTFS route_types
ServedByRouteTypes []int `json:"served_by_route_types,omitempty"`
// Search for stops with these agency integer IDs. Deprecated.
AgencyIds []int `json:"agency_ids,omitempty"`
// Search geographically
Location *StopLocationFilter `json:"location,omitempty"`
// Backwards compat: Search for stops within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Backwards compat: Search for stops within this geographic polygon
Within *tt.Polygon `json:"within,omitempty"`
// Backwards compat: Search for stops within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
}
Search options for stops
type StopLocationFilter ¶ added in v1.3.0
type StopLocationFilter struct {
// Search for stops within this bounding box
Bbox *BoundingBox `json:"bbox,omitempty"`
// Search for stops within this geographic polygon
Polygon *tt.Polygon `json:"polygon,omitempty"`
// Search within these enclosing features, and return the matching feature ids
Features []*Feature `json:"features,omitempty"`
// Search for stops within specified radius of a point
Near *PointRadius `json:"near,omitempty"`
// Search within these geography ids
GeographyIds []*int `json:"geography_ids,omitempty"`
// Focus search on this point; results will be sorted by distance
Focus *FocusPoint `json:"focus,omitempty"`
}
type StopObservation ¶ added in v1.3.0
type StopObservation struct {
// GTFS-RT TripUpdate schedule relationship
ScheduleRelationship *string `json:"schedule_relationship,omitempty"`
// GTFS-RT TripUpdate trip start date
TripStartDate *tt.Date `json:"trip_start_date,omitempty"`
// GTFS-RT TripUpdate trip start time
TripStartTime *tt.Seconds `json:"trip_start_time,omitempty"`
// GTFS static origin stop id
FromStopID *string `json:"from_stop_id,omitempty"`
// GTFS static destination stop id
ToStopID *string `json:"to_stop_id,omitempty"`
// Agency ID for route
AgencyID *string `json:"agency_id,omitempty"`
// Route ID for trip
RouteID *string `json:"route_id,omitempty"`
// Trip ID
TripID *string `json:"trip_id,omitempty"`
// Stop sequence for origin stop
StopSequence *int `json:"stop_sequence,omitempty"`
// Source data used to calculate this stop observation. Can be trip update or vehicle positions.
Source *string `json:"source,omitempty"`
// GTFS static scheduled arrival time
ScheduledArrivalTime *tt.Seconds `json:"scheduled_arrival_time,omitempty"`
// GTFS static scheduled departure time
ScheduledDepartureTime *tt.Seconds `json:"scheduled_departure_time,omitempty"`
// GTFS-RT calculated arrival time
ObservedArrivalTime *tt.Seconds `json:"observed_arrival_time,omitempty"`
// GTFS-RT calculated departure time
ObservedDepartureTime *tt.Seconds `json:"observed_departure_time,omitempty"`
StopID int `json:"-"`
}
Measurements of observed arrival times based on GTFS-RT data
type StopObservationFilter ¶ added in v1.3.0
type StopObservationFilter struct {
// Search for stop observations derived from the specified source
Source string `json:"source"`
// Search for stop observations associated with this feed version integer ID
FeedVersionID int `json:"feed_version_id"`
// Search for stop observations made on this trip start date
TripStartDate tt.Date `json:"trip_start_date"`
}
Search options for stop observations
type StopPlace ¶ added in v1.3.0
type StopPlace struct {
// Best-matched state or province name
Adm1Name *string `json:"adm1_name,omitempty"`
// Best-matched state or province ISO code
Adm1Iso *string `json:"adm1_iso,omitempty"`
// Best-matched country name
Adm0Name *string `json:"adm0_name,omitempty"`
// Best-mached country ISO code
Adm0Iso *string `json:"adm0_iso,omitempty"`
}
Place associated with a stop
type StopPlaceParam ¶ added in v1.3.0
type StopSetInput ¶ added in v1.3.0
type StopSetInput struct {
// Entity ID to update
ID *int `json:"id,omitempty"`
// Feed version of entity to update
FeedVersion *FeedVersionInput `json:"feed_version,omitempty"`
// Set GTFS location_type to this value
LocationType *int `json:"location_type,omitempty"`
// Set GTFS stop_code to this value
StopCode *string `json:"stop_code,omitempty"`
// Set GTFS stop_desc to this value
StopDesc *string `json:"stop_desc,omitempty"`
// Set GTFS stop_id to this value
StopID *string `json:"stop_id,omitempty"`
// Set GTFS stop_name to this value
StopName *string `json:"stop_name,omitempty"`
// Set GTFS stop_timezone to this value
StopTimezone *string `json:"stop_timezone,omitempty"`
// Set GTFS stop_url to this value
StopURL *string `json:"stop_url,omitempty"`
// Set GTFS wheelchair_boarding to this value
WheelchairBoarding *int `json:"wheelchair_boarding,omitempty"`
// Set GTFS zone_id to this value
ZoneID *string `json:"zone_id,omitempty"`
// Set GTFS platform_code to this value
PlatformCode *string `json:"platform_code,omitempty"`
// Set GTFS tts_stop_name to this value
TtsStopName *string `json:"tts_stop_name,omitempty"`
// Set stop geometry to this value
Geometry *tt.Point `json:"geometry,omitempty"`
// Set stop parent station to this stop
Parent *StopSetInput `json:"parent,omitempty"`
// Set stop level to this level
Level *LevelSetInput `json:"level,omitempty"`
// Set or update external reference for this stop
ExternalReference *StopExternalReferenceSetInput `json:"external_reference,omitempty"`
}
Update a stop entity
type StopTimeEvent ¶ added in v1.3.0
type StopTimeEvent struct {
// Local time for stop
StopTimezone string `json:"stop_timezone"`
// Estimated time in UTC
EstimatedUtc *time.Time `json:"estimated_utc,omitempty"`
// Estimated time in Unix epoch seconds
EstimatedUnix *int `json:"estimated_unix,omitempty"`
// Estimated time in the local time zone
EstimatedLocal *time.Time `json:"estimated_local,omitempty"`
// Estimated schedule delay, in seconds, based on either a timestamp or overall trip delay.
//
// This value can be set directly from a matching GTFS-RT StopTimeUpdate timestamp or delay value or set via an estimated overall trip delay. The value is capped at +/- 86,400 seconds (24 hours). Values larger than that are are likely erroneous and will be set to null.
EstimatedDelay *int `json:"estimated_delay,omitempty"`
// Estimated time in local time HH:MM:SS
Estimated *tt.Seconds `json:"estimated,omitempty"`
// Scheduled time in UTC
ScheduledUtc *time.Time `json:"scheduled_utc,omitempty"`
// Scheduled time in Unix epoch seconds
ScheduledUnix *int `json:"scheduled_unix,omitempty"`
// Sceduled time in the local time zone
ScheduledLocal *time.Time `json:"scheduled_local,omitempty"`
// Scheduled time local time HH:MM:SS
Scheduled *tt.Seconds `json:"scheduled,omitempty"`
// Estimated time in UTC, source directly from matching GTFS-RT StopTimeUpdate. See https://gtfs.org/realtime/reference/#message-stoptimeevent
TimeUtc *time.Time `json:"time_utc,omitempty"`
// Estimated time in Unix epoch seconds, source directly from matching GTFS-RT StopTimeUpdate. See https://gtfs.org/realtime/reference/#message-stoptimeevent
TimeUnix *int `json:"time_unix,omitempty"`
// Estimated schedule delay, in seconds. This value is set when there is a directly matching GTFS-RT StopTimeUpdate for this stop and passed through as-is. See GTFS Realtime documentation. See https://gtfs.org/realtime/reference/#message-stoptimeevent
Delay *int `json:"delay,omitempty"`
// Estimation uncertainty. This value is set when there is a directly matching GTFS-RT StopTimeUpdate for this stop and passed through as-is. See https://gtfs.org/realtime/reference/#message-stoptimeevent
Uncertainty *int `json:"uncertainty,omitempty"`
}
StopTimeEvent combines scheduled arrival/departure data with data sourced from GTFS-RT
Each scheduled StopTime will try to be matched with a relevant GTFS-RT TripUpdate and StopTimeUpdate. If the StopTime has a matching TripUpdate (based on trip_id) and StopTimeUpdate (stop_sequence and/or stop_id), the estimated times will be used directly. If a TripUpdate is matched, but no StopTimeUpdate, the last available delay value in the trip will be applied to later StopTimes in that trip. If the Trip is ADDED and does not match a static schedule StopTime, the scheduled times will be absent.
See: - https://gtfs.org/realtime/reference/#message-tripupdate - https://gtfs.org/realtime/reference/#message-stoptimeupdate - https://gtfs.org/realtime/reference/#message-stoptimeevent
type StopTimeFilter ¶
type StopTimeFilter struct {
// Search for trips scheduled on the specified calendar date
Date *tt.Date `json:"date,omitempty"`
// Search for trips scheduled on the specified relative date
RelativeDate *RelativeDate `json:"relative_date,omitempty"`
// Search for trips scheduled on the specified GTFS calendar service date
ServiceDate *tt.Date `json:"service_date,omitempty"`
// Use the feed version fallback week for dates outside the normal service window for that feed version
UseServiceWindow *bool `json:"use_service_window,omitempty"`
// Search for stop times with departure times later than the specified time, in seconds since midnight
StartTime *int `json:"start_time,omitempty"`
// Search for stop times with arrival times before the specified time, in seconds since midnight
EndTime *int `json:"end_time,omitempty"`
// Search for stop times with departure times later than the specified time, in local time HH:MM:SS
Start *tt.Seconds `json:"start,omitempty"`
// Search for stop times with arrival times before the specified time, in local time HH:MM:SS
End *tt.Seconds `json:"end,omitempty"`
// Search for stop times with departures within the specified number of seconds (in local time)
Next *int `json:"next,omitempty"`
// Search for stop times with service by routes with the specified route OnestopIDs
RouteOnestopIds []string `json:"route_onestop_ids,omitempty"`
// Include previously used route OnestopIDs that match the same (feed,route_id)
AllowPreviousRouteOnestopIds *bool `json:"allow_previous_route_onestop_ids,omitempty"`
// Exclude the first stop_time in a trip
ExcludeFirst *bool `json:"exclude_first,omitempty"`
// Exclude the last stop_time in a trip
ExcludeLast *bool `json:"exclude_last,omitempty"`
}
Search options for stop times, optionally on a given date
type TripFilter ¶
type TripFilter struct {
// Search for trips scheduled on the specified GTFS calendar service date
ServiceDate *tt.Date `json:"service_date,omitempty"`
// Search for trips scheduled on the specified relative date
RelativeDate *RelativeDate `json:"relative_date,omitempty"`
// Use the feed version fallback week for dates outside the normal service window for that feed version
UseServiceWindow *bool `json:"use_service_window,omitempty"`
// Search for trips with this GTFS trip_id
TripID *string `json:"trip_id,omitempty"`
// Search for trips with this stop pattern ID
StopPatternID *int `json:"stop_pattern_id,omitempty"`
// Search for trips with these license details
License *LicenseFilter `json:"license,omitempty"`
// Search for trips associated with these route integer IDs. Deprecated.
RouteIds []int `json:"route_ids,omitempty"`
// Search for trips associated with these route OnestopIDs
RouteOnestopIds []string `json:"route_onestop_ids,omitempty"`
// Search for trips with this feed version SHA1 hash
FeedVersionSha1 *string `json:"feed_version_sha1,omitempty"`
// Search for trips with this feed OnestopID
FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
}
Search options for trips
type TripStopTimeFilter ¶ added in v1.3.0
type TripStopTimeFilter struct {
// Search for stop times with departure times later than the specified time, in local time HH:MM:SS
Start *tt.Seconds `json:"start,omitempty"`
// Search for stop times with arrival times before the specified time, in local time HH:MM:SS
End *tt.Seconds `json:"end,omitempty"`
}
Search options for stop times for a trip with no date specified
type ValidationRealtimeResult ¶ added in v1.3.0
type ValidationRealtimeResult struct {
// Source URL
URL string `json:"url"`
// JSON representation of GTFS-RT data
JSON tt.Map `json:"json"`
}
Source URL and JSON representation of GTFS-RT data used for validation
type ValidationReport ¶ added in v1.3.0
type ValidationReport struct {
// Internal integer ID
ID int `json:"id"`
// Time the report was generated, in UTC
ReportedAt *time.Time `json:"reported_at,omitempty"`
// Time the reported was generated, in feed local time
ReportedAtLocal *time.Time `json:"reported_at_local,omitempty"`
// Time the report was generated, local timezone
ReportedAtLocalTimezone *string `json:"reported_at_local_timezone,omitempty"`
// Validation completed successfully
Success bool `json:"success"`
// Exception log if feed failed to validate
FailureReason *string `json:"failure_reason,omitempty"`
// The report includes GTFS static data
IncludesStatic *bool `json:"includes_static,omitempty"`
// The report includes GTFS-RT data
IncludesRt *bool `json:"includes_rt,omitempty"`
// Name of validator used
Validator *string `json:"validator,omitempty"`
// Version of validator used
ValidatorVersion *string `json:"validator_version,omitempty"`
// Validation errors, grouped by filename, if present
Errors []*ValidationReportErrorGroup `json:"errors"`
// Validation warnings, grouped by filename, if present
Warnings []*ValidationReportErrorGroup `json:"warnings"`
// Details about the validated feed
Details *ValidationReportDetails `json:"details,omitempty"`
FeedVersionID int `json:"-"`
}
Validation report for GTFS static and/or GTFS-RT data
type ValidationReportDetails ¶ added in v1.3.0
type ValidationReportDetails struct {
// SHA1 hash of the validated feed
Sha1 string `json:"sha1"`
// Calculated earliest calendar date in service schedule
EarliestCalendarDate *tt.Date `json:"earliest_calendar_date,omitempty"`
// Calculated latest calendar date in service schedule
LatestCalendarDate *tt.Date `json:"latest_calendar_date,omitempty"`
// Details for each file contained in the feed
Files []*FeedVersionFileInfo `json:"files"`
// Calculated service levels for feed
ServiceLevels []*FeedVersionServiceLevel `json:"service_levels"`
// Selected agencies contained in feed
Agencies []*Agency `json:"agencies"`
// Selected routes contained in feed
Routes []*Route `json:"routes"`
// Selected stops contained in feed
Stops []*Stop `json:"stops"`
// Feed info data contained in feed
FeedInfos []*FeedInfo `json:"feed_infos"`
// Detailed information about GTFS-RT sources used in validation
Realtime []*ValidationRealtimeResult `json:"realtime,omitempty"`
}
Details about the validated feed, including selected entities, metadata of contained files, calendar extent, etc.
type ValidationReportError ¶ added in v1.3.0
type ValidationReportError struct {
// Source filename
Filename string `json:"filename"`
// Error type
ErrorType string `json:"error_type"`
// Error code (for GTFS-RT)
ErrorCode string `json:"error_code"`
// Key for this error group
GroupKey string `json:"group_key"`
// Affected entity ID
EntityID string `json:"entity_id"`
// Affected entity field
Field string `json:"field"`
// Affected entity line number (for static)
Line int `json:"line"`
// Value of affected field
Value string `json:"value"`
// Error message describing problem
Message string `json:"message"`
// Entity geometry, if available
Geometry *tt.Geometry `json:"geometry,omitempty"`
// JSON representation of entity, if available
EntityJSON tt.Map `json:"entity_json"`
ID int `json:"-"`
ValidationReportErrorGroupID int `json:"-"`
}
An individual validation error or warning.
type ValidationReportErrorGroup ¶ added in v1.3.0
type ValidationReportErrorGroup struct {
// Filename for error group
Filename string `json:"filename"`
// Error type
ErrorType string `json:"error_type"`
// Error code (for GTFS-RT)
ErrorCode string `json:"error_code"`
// Key for this error group
GroupKey string `json:"group_key"`
// Affected entity field for this error group
Field string `json:"field"`
// Number of affected entities for this error group
Count int `json:"count"`
// Examples of this error
Errors []*ValidationReportError `json:"errors"`
ID int `json:"-"`
ValidationReportID int `json:"-"`
}
Validation errors and warnings for a particular file or RT source
type ValidationReportFilter ¶ added in v1.3.0
type ValidationReportFilter struct {
// Search for validation reports with the following integer IDs
ReportIds []int `json:"report_ids,omitempty"`
// Search for successful validation reports
Success *bool `json:"success,omitempty"`
// Search for validation reports generated by the specified validator
Validator *string `json:"validator,omitempty"`
// Search for validation reports generated using the specified validator version
ValidatorVersion *string `json:"validator_version,omitempty"`
// Search for validation reports that include/exclude GTFS-RT data
IncludesRt *bool `json:"includes_rt,omitempty"`
// Search for validation reports that include/exclude GTFS static data
IncludesStatic *bool `json:"includes_static,omitempty"`
}
Search options for validation reports
type VehiclePosition ¶ added in v1.3.0
type VehiclePosition struct {
// GTFS-RT VehiclePosition vehicle. See https://gtfs.org/realtime/reference/#message-vehicledescriptor
Vehicle *RTVehicleDescriptor `json:"vehicle,omitempty"`
// GTFS-RT VehiclePosition current vehicle position
Position *tt.Point `json:"position,omitempty"`
// GTFS-RT VehiclePosition current stop sequence in trip
CurrentStopSequence *int `json:"current_stop_sequence,omitempty"`
// GTFS-RT VehiclePosition current stop in trip
StopID *Stop `json:"stop_id,omitempty"`
// GTFS-RT VehiclePosition current status string
CurrentStatus *string `json:"current_status,omitempty"`
// GTFS-RT VehiclePosition timestamp
Timestamp *time.Time `json:"timestamp,omitempty"`
// GTFS-RT VehiclePosition congestion level estimate
CongestionLevel *string `json:"congestion_level,omitempty"`
}
[Vehicle Position](https://gtfs.org/reference/realtime/v2/#message-vehicleposition) message provided by a source GTFS Realtime feed.
type Waypoint ¶ added in v1.3.0
type Waypoint struct {
Lon float64 `json:"lon"`
Lat float64 `json:"lat"`
Name *string `json:"name,omitempty"`
Stop *WaypointStop `json:"stop,omitempty"`
}
type WaypointDeparture ¶ added in v1.3.0
type WaypointDeparture struct {
Lon float64 `json:"lon"`
Lat float64 `json:"lat"`
Departure time.Time `json:"departure"`
StopID string `json:"stop_id"`
StopName string `json:"stop_name"`
StopCode string `json:"stop_code"`
StopOnestopID string `json:"stop_onestop_id"`
StopIndex *int `json:"stop_index,omitempty"`
StopSequence *int `json:"stop_sequence,omitempty"`
}