model

package
v0.0.0-...-f63fcbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllDurationUnit = []DurationUnit{
	DurationUnitSeconds,
}

Functions

func AddConfig

func AddConfig(cfg Config) func(http.Handler) http.Handler

func AddConfigAndPerms

func AddConfigAndPerms(cfg Config, next http.Handler) http.Handler

func AddPerms

func AddPerms(checker Checker) func(http.Handler) http.Handler

func WithConfig

func WithConfig(ctx context.Context, cfg Config) context.Context

func WithPerms

func WithPerms(ctx context.Context, checker Checker) context.Context

Types

type Actions

type Agency

type Agency struct {
	OnestopID       string      `json:"onestop_id"`
	FeedOnestopID   string      `json:"feed_onestop_id"`
	FeedVersionSHA1 string      `json:"feed_version_sha1"`
	Geometry        *tt.Polygon `json:"geometry"`
	SearchRank      *string
	CoifID          *int
	gtfs.Agency
}

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"`
	// Search for agencies within this bounding box
	Bbox *BoundingBox `json:"bbox,omitempty"`
	// Search for agencies within this geographic polygon
	Within *tt.Polygon `json:"within,omitempty"`
	// Search for agencies within specified radius of a point
	Near *PointRadius `json:"near,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"`
}

Search options for agencies

type AgencyParam

type AgencyParam struct {
	FeedVersionID int
	Limit         *int
	OnestopID     *string
	Where         *AgencyFilter
}

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 AgencyPlaceParam

type AgencyPlaceParam struct {
	AgencyID int
	Limit    *int
	Where    *AgencyPlaceFilter
}

type Alert

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 BoundingBox

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 Calendar

type Calendar struct {
	gtfs.Calendar
}

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 CalendarDateParam

type CalendarDateParam struct {
	ServiceID int
	Limit     *int
	Where     *CalendarDateFilter
}

type CensusField

type CensusField struct {
	// Internal integer ID
	ID int `json:"id"`
	// Census field name
	FieldName string `json:"field_name"`
	// Census field title
	FieldTitle string `json:"field_title"`
	// Census field column order
	ColumnOrder *float64 `json:"column_order,omitempty"`
	TableID     int      `json:"-"`
}

type CensusFieldParam

type CensusFieldParam struct {
	Limit   *int
	TableID int
}

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"`
	// Land area, in square meters
	Aland *float64 `json:"aland,omitempty"`
	// Water area, in square meters
	Awater *float64 `json:"awater,omitempty"`
	// Census geography polygon
	Geometry *tt.Polygon `json:"geometry,omitempty"`
	// Census tables containing data for this geography
	Values        []*CensusValue `json:"values"`
	MatchEntityID int            `json:"-"`
}

Census geography data

type CensusGeographyFilter

type CensusGeographyFilter struct {
	Dataset *string  `json:"dataset,omitempty"`
	Layer   *string  `json:"layer,omitempty"`
	Radius  *float64 `json:"radius,omitempty"`
}

Search options for census geographies

type CensusGeographyParam

type CensusGeographyParam struct {
	EntityType string
	EntityID   int
	Limit      *int
	Where      *CensusGeographyFilter
}

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"`
}

Census table metadata

type CensusTableParam

type CensusTableParam struct {
	Limit *int
}

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 CensusValueParam

type CensusValueParam struct {
	Dataset    *string
	Geoid      string
	TableNames string // these have to be comma joined for now, []string cant be used as map key
	Limit      *int
}

type Checker

type Checker interface {
	authz.CheckerServer
}

type Config

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
	RestPrefix              string
	Storage                 string
	RTStorage               string
	LoaderBatchSize         int
	LoaderStopTimeBatchSize int
}

func ForContext

func ForContext(ctx context.Context) Config

type Cursor

type Cursor struct {
	FeedVersionID int
	ID            int
	Valid         bool
}

func NewCursor

func NewCursor(fvid int, id int) Cursor

func (Cursor) MarshalGQL

func (r Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Cursor) MarshalJSON

func (r *Cursor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.marshaler interface.

func (*Cursor) Scan

func (r *Cursor) Scan(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Cursor) UnmarshalGQL

func (r *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Cursor) UnmarshalJSON

func (r *Cursor) UnmarshalJSON(v []byte) error

UnmarshalJSON implements json.Marshaler interface.

type DirectionRequest

type DirectionRequest struct {
	To       *WaypointInput `json:"to"`
	From     *WaypointInput `json:"from"`
	Mode     StepMode       `json:"mode"`
	DepartAt *time.Time     `json:"depart_at,omitempty"`
}

type Directions

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

type Distance struct {
	Distance float64      `json:"distance"`
	Units    DistanceUnit `json:"units"`
}

type DistanceUnit

type DistanceUnit string
const (
	DistanceUnitKilometers DistanceUnit = "KILOMETERS"
	DistanceUnitMiles      DistanceUnit = "MILES"
)

func (DistanceUnit) IsValid

func (e DistanceUnit) IsValid() bool

func (DistanceUnit) MarshalGQL

func (e DistanceUnit) MarshalGQL(w io.Writer)

func (DistanceUnit) String

func (e DistanceUnit) String() string

func (*DistanceUnit) UnmarshalGQL

func (e *DistanceUnit) UnmarshalGQL(v interface{}) error

type Duration

type Duration struct {
	Duration float64      `json:"duration"`
	Units    DurationUnit `json:"units"`
}

type DurationUnit

type DurationUnit string
const (
	DurationUnitSeconds DurationUnit = "SECONDS"
)

func (DurationUnit) IsValid

func (e DurationUnit) IsValid() bool

func (DurationUnit) MarshalGQL

func (e DurationUnit) MarshalGQL(w io.Writer)

func (DurationUnit) String

func (e DurationUnit) String() string

func (*DurationUnit) UnmarshalGQL

func (e *DurationUnit) UnmarshalGQL(v interface{}) error

type EntityDeleteResult

type EntityDeleteResult struct {
	// ID of deleted entity
	ID int `json:"id"`
}

Result of entity delete operation

type EntityFinder

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)
	RouteStopBuffer(context.Context, *RouteStopBufferParam) ([]*RouteStopBuffer, error)
	FindFeedVersionServiceWindow(context.Context, int) (*ServiceWindow, error)
	DBX() sqlx.Ext // escape hatch, for now
}

Finder handles basic queries

type EntityLoader

type EntityLoader interface {
	// Simple ID loaders
	TripsByID(context.Context, []int) ([]*Trip, []error)
	LevelsByID(context.Context, []int) ([]*Level, []error)
	PathwaysByID(context.Context, []int) ([]*Pathway, []error)
	CalendarsByID(context.Context, []int) ([]*Calendar, []error)
	ShapesByID(context.Context, []int) ([]*Shape, []error)
	FeedVersionsByID(context.Context, []int) ([]*FeedVersion, []error)
	FeedsByID(context.Context, []int) ([]*Feed, []error)
	AgenciesByID(context.Context, []int) ([]*Agency, []error)
	StopsByID(context.Context, []int) ([]*Stop, []error)
	RoutesByID(context.Context, []int) ([]*Route, []error)
	LevelsByParentStationID(context.Context, []LevelParam) ([][]*Level, []error)
	StopExternalReferencesByStopID(context.Context, []int) ([]*StopExternalReference, []error)
	StopObservationsByStopID(context.Context, []StopObservationParam) ([][]*StopObservation, []error)
	TargetStopsByStopID(context.Context, []int) ([]*Stop, []error)
	RouteAttributesByRouteID(context.Context, []int) ([]*RouteAttribute, []error)
	FeedVersionGeometryByID(context.Context, []int) ([]*tt.Polygon, []error)
	CensusTableByID(context.Context, []int) ([]*CensusTable, []error)

	// Segments
	SegmentPatternsByRouteID(context.Context, []SegmentPatternParam) ([][]*SegmentPattern, []error)
	SegmentPatternsBySegmentID(context.Context, []SegmentPatternParam) ([][]*SegmentPattern, []error)
	SegmentsByID(context.Context, []int) ([]*Segment, []error)
	SegmentsByRouteID(context.Context, []SegmentParam) ([][]*Segment, []error)
	SegmentsByFeedVersionID(context.Context, []SegmentParam) ([][]*Segment, []error)

	// Other loaders
	FeedVersionGtfsImportByFeedVersionID(context.Context, []int) ([]*FeedVersionGtfsImport, []error)
	FeedVersionServiceWindowByFeedVersionID(context.Context, []int) ([]*FeedVersionServiceWindow, []error)
	FeedStatesByFeedID(context.Context, []int) ([]*FeedState, []error)
	OperatorsByFeedID(context.Context, []OperatorParam) ([][]*Operator, []error)
	OperatorsByCOIF(context.Context, []int) ([]*Operator, []error)
	OperatorsByAgencyID(context.Context, []int) ([]*Operator, []error)
	StopPlacesByStopID(context.Context, []StopPlaceParam) ([]*StopPlace, []error)

	// Param loaders
	FeedFetchesByFeedID(context.Context, []FeedFetchParam) ([][]*FeedFetch, []error)
	FeedsByOperatorOnestopID(context.Context, []FeedParam) ([][]*Feed, []error)
	FrequenciesByTripID(context.Context, []FrequencyParam) ([][]*Frequency, []error)
	StopTimesByTripID(context.Context, []TripStopTimeParam) ([][]*StopTime, []error)
	StopTimesByStopID(context.Context, []StopTimeParam) ([][]*StopTime, []error)
	RouteStopsByStopID(context.Context, []RouteStopParam) ([][]*RouteStop, []error)
	StopsByRouteID(context.Context, []StopParam) ([][]*Stop, []error)
	RouteStopsByRouteID(context.Context, []RouteStopParam) ([][]*RouteStop, []error)
	RouteHeadwaysByRouteID(context.Context, []RouteHeadwayParam) ([][]*RouteHeadway, []error)
	RouteStopPatternsByRouteID(context.Context, []RouteStopPatternParam) ([][]*RouteStopPattern, []error)
	FeedVersionFileInfosByFeedVersionID(context.Context, []FeedVersionFileInfoParam) ([][]*FeedVersionFileInfo, []error)
	StopsByParentStopID(context.Context, []StopParam) ([][]*Stop, []error)
	FeedVersionsByFeedID(context.Context, []FeedVersionParam) ([][]*FeedVersion, []error)
	AgencyPlacesByAgencyID(context.Context, []AgencyPlaceParam) ([][]*AgencyPlace, []error)
	RouteGeometriesByRouteID(context.Context, []RouteGeometryParam) ([][]*RouteGeometry, []error)
	TripsByRouteID(context.Context, []TripParam) ([][]*Trip, []error)
	RoutesByAgencyID(context.Context, []RouteParam) ([][]*Route, []error)
	AgenciesByFeedVersionID(context.Context, []AgencyParam) ([][]*Agency, []error)
	AgenciesByOnestopID(context.Context, []AgencyParam) ([][]*Agency, []error)
	StopsByFeedVersionID(context.Context, []StopParam) ([][]*Stop, []error)
	StopsByLevelID(context.Context, []StopParam) ([][]*Stop, []error)
	TripsByFeedVersionID(context.Context, []TripParam) ([][]*Trip, []error)
	FeedInfosByFeedVersionID(context.Context, []FeedInfoParam) ([][]*FeedInfo, []error)
	RoutesByFeedVersionID(context.Context, []RouteParam) ([][]*Route, []error)
	FeedVersionServiceLevelsByFeedVersionID(context.Context, []FeedVersionServiceLevelParam) ([][]*FeedVersionServiceLevel, []error)
	PathwaysByFromStopID(context.Context, []PathwayParam) ([][]*Pathway, []error)
	PathwaysByToStopID(context.Context, []PathwayParam) ([][]*Pathway, []error)
	CalendarDatesByServiceID(context.Context, []CalendarDateParam) ([][]*CalendarDate, []error)
	CensusGeographiesByEntityID(context.Context, []CensusGeographyParam) ([][]*CensusGeography, []error)
	CensusValuesByGeographyID(context.Context, []CensusValueParam) ([][]*CensusValue, []error)
	CensusFieldsByTableID(context.Context, []CensusFieldParam) ([][]*CensusField, []error)

	// Validation reports
	ValidationReportsByFeedVersionID(context.Context, []ValidationReportParam) ([][]*ValidationReport, []error)
	ValidationReportErrorGroupsByValidationReportID(context.Context, []ValidationReportErrorGroupParam) ([][]*ValidationReportErrorGroup, []error)
	ValidationReportErrorExemplarsByValidationReportErrorGroupID(context.Context, []ValidationReportErrorExemplarParam) ([][]*ValidationReportError, []error)
}

EntityLoader methods must return items in the same order as the input parameters

type EntityMutator

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 Feed

type Feed struct {
	SearchRank *string
	dmfr.Feed
}

type FeedAuthorization

type FeedAuthorization struct {
	dmfr.FeedAuthorization
}

type FeedFetch

type FeedFetch struct {
	ResponseSha1 tt.String // confusing but easier than alternative fixes
	dmfr.FeedFetch
}

type FeedFetchFilter

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 FeedFetchParam

type FeedFetchParam struct {
	FeedID int
	Limit  *int
	Where  *FeedFetchFilter
}

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 FeedInfo

type FeedInfo struct {
	gtfs.FeedInfo
}

type FeedInfoParam

type FeedInfoParam struct {
	FeedVersionID int
	Limit         *int
}

type FeedLicense

type FeedLicense struct {
	dmfr.FeedLicense
}

type FeedParam

type FeedParam struct {
	OperatorOnestopID string
	Limit             *int
	Where             *FeedFilter
}

type FeedSourceURL

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

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

func (e FeedSourceURLTypes) IsValid() bool

func (FeedSourceURLTypes) MarshalGQL

func (e FeedSourceURLTypes) MarshalGQL(w io.Writer)

func (FeedSourceURLTypes) String

func (e FeedSourceURLTypes) String() string

func (*FeedSourceURLTypes) UnmarshalGQL

func (e *FeedSourceURLTypes) UnmarshalGQL(v interface{}) error

type FeedSpecTypes

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

func (f FeedSpecTypes) FromDBString(s string) *FeedSpecTypes

func (FeedSpecTypes) IsValid

func (e FeedSpecTypes) IsValid() bool

func (FeedSpecTypes) MarshalGQL

func (e FeedSpecTypes) MarshalGQL(w io.Writer)

func (FeedSpecTypes) String

func (e FeedSpecTypes) String() string

func (FeedSpecTypes) ToDBString

func (f FeedSpecTypes) ToDBString() string

func (*FeedSpecTypes) UnmarshalGQL

func (e *FeedSpecTypes) UnmarshalGQL(v interface{}) error

type FeedState

type FeedState struct {
	dmfr.FeedState
}

type FeedUrls

type FeedUrls struct {
	dmfr.FeedUrls
}

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 FeedVersionFileInfoParam

type FeedVersionFileInfoParam struct {
	FeedVersionID int
	Limit         *int
}

type FeedVersionFilter

type FeedVersionFilter struct {
	// 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 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

type FeedVersionInput struct {
	// Feed version integer ID
	ID *int `json:"id,omitempty"`
}

Specify a feed version

type FeedVersionParam

type FeedVersionParam struct {
	FeedID int
	Limit  *int
	Where  *FeedVersionFilter
}

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 FeedVersionServiceLevelParam

type FeedVersionServiceLevelParam struct {
	FeedVersionID int
	Limit         *int
	Where         *FeedVersionServiceLevelFilter
}

type FeedVersionServiceWindow

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

Finder provides all necessary database methods

type Frequency

type Frequency struct {
	gtfs.Frequency
}

type FrequencyParam

type FrequencyParam struct {
	TripID int
	Limit  *int
}

type GbfsAlertTime

type GbfsAlertTime struct {
	*gbfs.AlertTime
}

type GbfsBikeRequest

type GbfsBikeRequest struct {
	Near *PointRadius `json:"near,omitempty"`
}

type GbfsBrandAsset

type GbfsBrandAsset struct {
	*gbfs.BrandAsset
}

type GbfsDockRequest

type GbfsDockRequest struct {
	Near *PointRadius `json:"near,omitempty"`
}

type GbfsFeed

type GbfsFeed struct {
	*gbfs.GbfsFeed
}

func (*GbfsFeed) Alerts

func (g *GbfsFeed) Alerts() []*GbfsSystemAlert

func (*GbfsFeed) Calendars

func (g *GbfsFeed) Calendars() []*GbfsSystemCalendar

func (*GbfsFeed) RentalHours

func (g *GbfsFeed) RentalHours() []*GbfsSystemHour

func (*GbfsFeed) StationInformation

func (g *GbfsFeed) StationInformation() []*GbfsStationInformation

func (*GbfsFeed) SystemInformation

func (g *GbfsFeed) SystemInformation() *GbfsSystemInformation

type GbfsFinder

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

type GbfsFreeBikeStatus struct {
	Feed *GbfsFeed
	*gbfs.FreeBikeStatus
}

func (*GbfsFreeBikeStatus) HomeStation

func (g *GbfsFreeBikeStatus) HomeStation() *GbfsStationInformation

func (*GbfsFreeBikeStatus) PricingPlan

func (g *GbfsFreeBikeStatus) PricingPlan() *GbfsSystemPricingPlan

func (*GbfsFreeBikeStatus) RentalUris

func (g *GbfsFreeBikeStatus) RentalUris() *GbfsRentalUris

func (*GbfsFreeBikeStatus) Station

func (*GbfsFreeBikeStatus) VehicleType

func (g *GbfsFreeBikeStatus) VehicleType() *GbfsVehicleType

type GbfsGeofenceFeature

type GbfsGeofenceFeature struct {
	*gbfs.GeofenceFeature
}

func (*GbfsGeofenceFeature) Properties

func (g *GbfsGeofenceFeature) Properties() []*GbfsGeofenceProperty

type GbfsGeofenceProperty

type GbfsGeofenceProperty struct {
	*gbfs.GeofenceProperty
}

func (*GbfsGeofenceProperty) Rules

func (g *GbfsGeofenceProperty) Rules() []*GbfsGeofenceRule

type GbfsGeofenceRule

type GbfsGeofenceRule struct {
	*gbfs.GeofenceRule
}

func (*GbfsGeofenceRule) VehicleType

func (g *GbfsGeofenceRule) VehicleType() *GbfsVehicleType

type GbfsGeofenceZone

type GbfsGeofenceZone struct {
	*gbfs.GeofenceZone
}

func (*GbfsGeofenceZone) Features

func (g *GbfsGeofenceZone) Features() []*GbfsGeofenceFeature

type GbfsPlanPrice

type GbfsPlanPrice struct {
	*gbfs.PlanPrice
}

type GbfsRentalApp

type GbfsRentalApp struct {
	*gbfs.RentalApp
}

type GbfsRentalApps

type GbfsRentalApps struct {
	*gbfs.RentalApps
}

func (*GbfsRentalApps) Android

func (g *GbfsRentalApps) Android() *GbfsRentalApp

func (*GbfsRentalApps) Ios

func (g *GbfsRentalApps) Ios() *GbfsRentalApp

type GbfsRentalUris

type GbfsRentalUris struct {
	*gbfs.RentalURIs
}

type GbfsStationInformation

type GbfsStationInformation struct {
	Feed *GbfsFeed
	*gbfs.StationInformation
}

func (*GbfsStationInformation) Region

func (*GbfsStationInformation) Status

type GbfsStationStatus

type GbfsStationStatus struct {
	Feed *GbfsFeed
	*gbfs.StationStatus
}

func (*GbfsStationStatus) VehicleDocksAvailable

func (g *GbfsStationStatus) VehicleDocksAvailable() []*GbfsVehicleDockAvailable

func (*GbfsStationStatus) VehicleTypesAvailable

func (g *GbfsStationStatus) VehicleTypesAvailable() []*GbfsVehicleTypeAvailable

type GbfsSystemAlert

type GbfsSystemAlert struct {
	*gbfs.SystemAlert
}

func (*GbfsSystemAlert) Times

func (g *GbfsSystemAlert) Times() []*GbfsAlertTime

type GbfsSystemCalendar

type GbfsSystemCalendar struct {
	*gbfs.SystemCalendar
}

type GbfsSystemHour

type GbfsSystemHour struct {
	*gbfs.SystemHour
}

type GbfsSystemInformation

type GbfsSystemInformation struct {
	Feed *GbfsFeed
	*gbfs.SystemInformation
}

func (*GbfsSystemInformation) BrandAssets

func (g *GbfsSystemInformation) BrandAssets() *GbfsBrandAsset

func (*GbfsSystemInformation) RentalApps

func (g *GbfsSystemInformation) RentalApps() *GbfsRentalApps

type GbfsSystemPricingPlan

type GbfsSystemPricingPlan struct {
	*gbfs.SystemPricingPlan
}

func (*GbfsSystemPricingPlan) PerKmPricing

func (g *GbfsSystemPricingPlan) PerKmPricing() []*GbfsPlanPrice

func (*GbfsSystemPricingPlan) PerMinPricing

func (g *GbfsSystemPricingPlan) PerMinPricing() []*GbfsPlanPrice

type GbfsSystemRegion

type GbfsSystemRegion struct {
	*gbfs.SystemRegion
}

type GbfsSystemVersion

type GbfsSystemVersion struct {
	*gbfs.SystemVersion
}

type GbfsVehicleAssets

type GbfsVehicleAssets struct {
	*gbfs.VehicleAssets
}

type GbfsVehicleDockAvailable

type GbfsVehicleDockAvailable struct {
	Feed *GbfsFeed
	*gbfs.VehicleDockAvailable
}

func (*GbfsVehicleDockAvailable) VehicleTypes

func (g *GbfsVehicleDockAvailable) VehicleTypes() []*GbfsVehicleType

type GbfsVehicleType

type GbfsVehicleType struct {
	Feed *GbfsFeed
	*gbfs.VehicleType
}

func (*GbfsVehicleType) DefaultPricingPlan

func (g *GbfsVehicleType) DefaultPricingPlan() *GbfsSystemPricingPlan

func (*GbfsVehicleType) PricingPlans

func (g *GbfsVehicleType) PricingPlans() []*GbfsSystemPricingPlan

func (*GbfsVehicleType) RentalUris

func (g *GbfsVehicleType) RentalUris() *GbfsRentalUris

func (*GbfsVehicleType) VehicleAssets

func (g *GbfsVehicleType) VehicleAssets() *GbfsVehicleAssets

type GbfsVehicleTypeAvailable

type GbfsVehicleTypeAvailable struct {
	Feed *GbfsFeed
	*gbfs.VehicleTypeAvailable
}

func (*GbfsVehicleTypeAvailable) VehicleType

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) String

func (e ImportStatus) String() string

func (*ImportStatus) UnmarshalGQL

func (e *ImportStatus) UnmarshalGQL(v interface{}) error

type Itinerary

type Itinerary 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"`
	To        *Waypoint `json:"to"`
	Legs      []*Leg    `json:"legs,omitempty"`
}

type Leg

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"`
	Steps     []*Step       `json:"steps,omitempty"`
	Geometry  tt.LineString `json:"geometry"`
}

type Level

type Level struct {
	Geometry      tt.Polygon
	ParentStation tt.Key
	gtfs.Level
}

type LevelParam

type LevelParam struct {
	ParentStationID int
	Limit           *int
}

type LevelSetInput

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.Polygon `json:"geometry,omitempty"`
	// Set level parent station to this stop
	Parent *StopSetInput `json:"parent,omitempty"`
}

Update a level entity

type LicenseFilter

type LicenseFilter struct {
	// Search for entities with this Share Alike license restriction
	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

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

func (e LicenseValue) IsValid() bool

func (LicenseValue) MarshalGQL

func (e LicenseValue) MarshalGQL(w io.Writer)

func (LicenseValue) String

func (e LicenseValue) String() string

func (*LicenseValue) UnmarshalGQL

func (e *LicenseValue) UnmarshalGQL(v interface{}) error

type Me

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 Mutation

type Mutation struct {
}

type Operator

type Operator struct {
	ID            int
	Generated     bool
	FeedID        int
	FeedOnestopID *string
	SearchRank    *string // internal
	AgencyID      int     // internal
	dmfr.Operator
}

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 OperatorParam

type OperatorParam struct {
	FeedID int
	Limit  *int
	Where  *OperatorFilter
}

type Pathway

type Pathway struct {
	gtfs.Pathway
}

type PathwayFilter

type PathwayFilter struct {
	// Search for pathways with this GTFS pathway_mode
	PathwayMode *int `json:"pathway_mode,omitempty"`
}

Search options for pathways

type PathwayParam

type PathwayParam struct {
	FeedVersionID int
	FromStopID    int
	ToStopID      int
	Limit         *int
	Where         *PathwayFilter
}

type PathwaySetInput

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

type PermFilter struct {
	AllowedFeeds        []int
	AllowedFeedVersions []int
}

func PermsForContext

func PermsForContext(ctx context.Context) *PermFilter

func (*PermFilter) GetAllowedFeedVersions

func (pf *PermFilter) GetAllowedFeedVersions() []int

func (*PermFilter) GetAllowedFeeds

func (pf *PermFilter) GetAllowedFeeds() []int

type PermFinder

type PermFinder interface {
	PermFilter(context.Context) *PermFilter
}

type Place

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

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

func (e PlaceAggregationLevel) IsValid() bool

func (PlaceAggregationLevel) MarshalGQL

func (e PlaceAggregationLevel) MarshalGQL(w io.Writer)

func (PlaceAggregationLevel) String

func (e PlaceAggregationLevel) String() string

func (*PlaceAggregationLevel) UnmarshalGQL

func (e *PlaceAggregationLevel) UnmarshalGQL(v interface{}) error

type PlaceFilter

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 Query

type Query struct {
}

type RTFinder

type RTFinder interface {
	AddData(string, []byte) error
	FindTrip(t *Trip) *pb.TripUpdate
	MakeTrip(t *Trip) (*Trip, error)
	FindAlertsForTrip(*Trip, *int, *bool) []*Alert
	FindAlertsForStop(*Stop, *int, *bool) []*Alert
	FindAlertsForRoute(*Route, *int, *bool) []*Alert
	FindAlertsForAgency(*Agency, *int, *bool) []*Alert
	GetAddedTripsForStop(*Stop) []*pb.TripUpdate
	FindStopTimeUpdate(*Trip, *StopTime) (*RTStopTimeUpdate, bool)
	// lookup cache methods
	StopTimezone(int, string) (*time.Location, bool)
	GetGtfsTripID(int) (string, bool)
	GetMessage(string, string) (*pb.FeedMessage, bool)
}

RTFinder manages and looks up RT data

type RTStopTimeUpdate

type RTStopTimeUpdate struct {
	LastDelay      *int32
	StopTimeUpdate *pb.TripUpdate_StopTimeUpdate
	TripUpdate     *pb.TripUpdate
}

type RTTimeRange

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

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

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

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

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

func (e RelativeDate) IsValid() bool

func (RelativeDate) MarshalGQL

func (e RelativeDate) MarshalGQL(w io.Writer)

func (RelativeDate) String

func (e RelativeDate) String() string

func (*RelativeDate) UnmarshalGQL

func (e *RelativeDate) UnmarshalGQL(v interface{}) error

type Route

type Route struct {
	FeedOnestopID                string
	FeedVersionSHA1              string
	OnestopID                    *string
	HeadwaySecondsWeekdayMorning *int
	SearchRank                   *string
	gtfs.Route
}

type RouteAttribute

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"`
	// Search for routes within this bounding box
	Bbox *BoundingBox `json:"bbox,omitempty"`
	// Search for routes within this geographic polygon
	Within *tt.Polygon `json:"within,omitempty"`
	// Search for routes within specified radius of a point
	Near *PointRadius `json:"near,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"`
}

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 RouteGeometryParam

type RouteGeometryParam struct {
	RouteID int
	Limit   *int
}

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 RouteHeadwayParam

type RouteHeadwayParam struct {
	RouteID int
	Limit   *int
}

type RouteParam

type RouteParam struct {
	AgencyID      int
	FeedVersionID int
	Limit         *int
	Where         *RouteFilter
}

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 RouteStopBufferParam

type RouteStopBufferParam struct {
	EntityID int
	Radius   *float64
	Limit    *int
}

type RouteStopParam

type RouteStopParam struct {
	RouteID int
	StopID  int
	Limit   *int
}

type RouteStopPattern

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 RouteStopPatternParam

type RouteStopPatternParam struct {
	RouteID int
}

type ScheduleRelationship

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

func (e ScheduleRelationship) IsValid() bool

func (ScheduleRelationship) MarshalGQL

func (e ScheduleRelationship) MarshalGQL(w io.Writer)

func (ScheduleRelationship) String

func (e ScheduleRelationship) String() string

func (*ScheduleRelationship) UnmarshalGQL

func (e *ScheduleRelationship) UnmarshalGQL(v interface{}) error

type Segment

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:"-"`
}

Normalized route segments

type SegmentFilter

type SegmentFilter struct {
	// Search for segments associated with this layer name
	Layer *string `json:"layer,omitempty"`
}

Search options for route segments

type SegmentParam

type SegmentParam struct {
	FeedVersionID int
	RouteID       int
	Layer         string
	Limit         *int
	Where         *SegmentFilter
}

type SegmentPattern

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

type SegmentPatternFilter struct {
	// Search for segments patterns associated with this layer name
	Layer *string `json:"layer,omitempty"`
}

Search options for route segment patterns

type SegmentPatternParam

type SegmentPatternParam struct {
	SegmentID int
	RouteID   int
	Limit     *int
	Where     *SegmentPatternFilter
}

type ServiceCoversFilter

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

type ServiceWindow struct {
	NowLocal     time.Time
	StartDate    time.Time
	EndDate      time.Time
	FallbackWeek time.Time
	Location     *time.Location
}

type Shape

type Shape struct {
	service.ShapeLine
}

type Step

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

type StepMode string
const (
	StepModeWalk    StepMode = "WALK"
	StepModeAuto    StepMode = "AUTO"
	StepModeBicycle StepMode = "BICYCLE"
	StepModeTransit StepMode = "TRANSIT"
	StepModeLine    StepMode = "LINE"
)

func (StepMode) IsValid

func (e StepMode) IsValid() bool

func (StepMode) MarshalGQL

func (e StepMode) MarshalGQL(w io.Writer)

func (StepMode) String

func (e StepMode) String() string

func (*StepMode) UnmarshalGQL

func (e *StepMode) UnmarshalGQL(v interface{}) error

type Stop

type Stop struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	OnestopID       *string
	SearchRank      *string
	gtfs.Stop
}

type StopExternalReference

type StopExternalReference struct {
	// Internal integer ID
	ID int `json:"id"`
	// Target stop's feed OnestopID
	TargetFeedOnestopID *string `json:"target_feed_onestop_id,omitempty"`
	// Target stop's stop_id
	TargetStopID *string `json:"target_stop_id,omitempty"`
	// Is this reference active
	Inactive *bool `json:"inactive,omitempty"`
	// Resolved target stop, if matched and available
	TargetActiveStop *Stop `json:"target_active_stop,omitempty"`
}

Additional metadata for a stop to reference an externally defined stop

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"`
	// Search for stops within this bounding box
	Bbox *BoundingBox `json:"bbox,omitempty"`
	// Search for stops within this geographic polygon
	Within *tt.Polygon `json:"within,omitempty"`
	// Search for stops within specified radius of a point
	Near *PointRadius `json:"near,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 options for stops

type StopObservation

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"`
}

Measurements of observed arrival times based on GTFS-RT data

type StopObservationFilter

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 StopObservationParam

type StopObservationParam struct {
	StopID int
	Limit  *int
	Where  *StopObservationFilter
}

type StopParam

type StopParam struct {
	FeedVersionID int
	ParentStopID  int
	AgencyID      int
	LevelID       int
	Limit         *int
	Where         *StopFilter
	RouteID       int
}

type StopPlace

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

type StopPlaceParam struct {
	ID    int
	Point tlxy.Point
}

type StopSetInput

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"`
}

Update a stop entity

type StopTime

type StopTime struct {
	ServiceDate      tt.Date
	Date             tt.Date
	RTTripID         string            // internal: for ADDED trips
	RTStopTimeUpdate *RTStopTimeUpdate // internal
	gtfs.StopTime
}

type StopTimeEvent

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 StopTimeParam

type StopTimeParam struct {
	TripID        int
	StopID        int
	FeedVersionID int
	Limit         *int
	Where         *StopTimeFilter
}

type Trip

type Trip struct {
	RTTripID string // internal: for ADDED trips
	gtfs.Trip
}

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 TripParam

type TripParam struct {
	FeedVersionID int
	RouteID       int
	Limit         *int
	ServiceWindow *ServiceWindow
	Where         *TripFilter
}

type TripStopTimeFilter

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 TripStopTimeParam

type TripStopTimeParam struct {
	TripID        int
	FeedVersionID int
	Limit         *int
	StartTime     *int
	EndTime       *int
	Where         *TripStopTimeFilter
}

type ValidationRealtimeResult

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

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

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

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 ValidationReportErrorExemplarParam

type ValidationReportErrorExemplarParam struct {
	ValidationReportGroupID int
	Limit                   *int
}

type ValidationReportErrorGroup

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 ValidationReportErrorGroupParam

type ValidationReportErrorGroupParam struct {
	ValidationReportID int
	Limit              *int
}

type ValidationReportFilter

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 ValidationReportParam

type ValidationReportParam struct {
	FeedVersionID int
	Limit         *int
	Where         *ValidationReportFilter
}

type VehiclePosition

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

type Waypoint struct {
	Lon  float64 `json:"lon"`
	Lat  float64 `json:"lat"`
	Name *string `json:"name,omitempty"`
}

type WaypointInput

type WaypointInput struct {
	Lon  float64 `json:"lon"`
	Lat  float64 `json:"lat"`
	Name *string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL