model

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllDurationUnit = []DurationUnit{
	DurationUnitSeconds,
}
View Source
var ErrArtifactNotFound = errors.New("artifact not found")

ErrArtifactNotFound is returned by ArtifactReader.GetByID when no row matches.

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is returned by UnimplementedFinder methods.

Functions

func AddConfig added in v1.3.0

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

func AddConfigAndPerms added in v1.3.0

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

func AddPerms added in v1.3.0

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

func NewConfigMiddleware added in v1.4.0

func NewConfigMiddleware(cfg Config) jobs.Middleware

NewConfigMiddleware installs cfg into the job context, the jobs-side analogue of AddConfig. Register it on a Runner (runner.Use) so background workers can resolve the Config via ForContext. Always overwrites any inbound cfg.

func WithConfig added in v1.3.0

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

WithConfig stores cfg in ctx for non-HTTP entry points (background jobs, tests). Unlike AddConfig, this does not enforce a non-nil Checker — test scaffolding (testconfig) is responsible for providing one.

func WithPermFilter added in v1.3.2

func WithPermFilter(ctx context.Context, pf *PermFilter) context.Context

WithPermFilter stores a PermFilter directly in context. Use this when you need to set permissions without going through a Checker, such as when populating AllowedFeeds from an external source like gatekeeper.

Note: The provided PermFilter will NOT be mutated by subsequent calls to WithPerms. WithPerms creates a new merged PermFilter if it needs to combine permissions.

To grant unrestricted access, pass a PermFilter with IsGlobalAdmin=true.

func WithPerms added in v1.3.0

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

WithPerms populates permission filters in the context using the provided Checker. If an existing PermFilter is already set in context (e.g., via WithPermFilter), the checker's results are merged into a new PermFilter (the original is not mutated).

Merge behavior:

  • No existing filter: checker results are used directly
  • Existing filter + checker results: creates new filter with merged, deduplicated IDs
  • Either filter has IsGlobalAdmin=true: resulting filter has IsGlobalAdmin=true

Returns an error if the Checker fails to resolve the caller's permissions. The returned context still has the original PermFilter (if any) untouched.

Types

type Actions added in v1.3.0

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 by resolved Onestop ID (operator's when associated, else agency's)
	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 Onestop ID
	FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
	// Search for agencies with this GTFS agency_id
	AgencyID *string `json:"agency_id,omitempty"`
	// Search for agencies 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"`
	// Geographic search options
	Location *AgencyLocationFilter `json:"location,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"`
}

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

Geographic search options for agencies

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-matched country ISO code
	Adm0Iso *string `json:"adm0_iso,omitempty"`
	// Relative weight of this place association; higher values indicate stronger association (e.g. greater stop overlap)
	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 AgencyStopFilter added in v1.4.0

type AgencyStopFilter struct {
	// 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; defaults to 0 (platforms), and null is treated as 0. Only 0 and 1 can match: the relation contains served platforms and their stations, nothing else
	LocationType *int `json:"location_type,omitempty"`
	// Full text search
	Search *string `json:"search,omitempty"`
	// Search for stops served by the agency's routes with any of the specified GTFS route_types
	ServedByRouteTypes []int `json:"served_by_route_types,omitempty"`
	// Search for stops served by the agency's routes with any of these Onestop IDs
	ServedByRouteOnestopIds []string `json:"served_by_route_onestop_ids,omitempty"`
	// Geographic search options
	Location *StopLocationFilter `json:"location,omitempty"`
}

Search options for stops reached through `Agency.stops`, scoped to the parent agency: the served-by filters match against the agency's own routes and apply to the served platform, so with `location_type: 1` they select the platforms' stations; the remaining options describe the returned stop (no feed or feed version options apply, since the parent agency determines them)

type Alert added in v1.3.0

type Alert struct {
	// Id of the GTFS-RT FeedEntity that carried this alert, as published by its realtime feed. This is the realtime message's own entity id, not a GTFS static id like those in `informed_entity`. It should be unique within one realtime feed but not across feeds, so identify an alert by `rt_feed_onestop_id` and `entity_id` together, for example to merge the copies of an alert reached through a stop, its routes and their agency. Producers are not required to keep it the same between fetches
	EntityID string `json:"entity_id"`
	// Onestop ID of the feed whose GTFS-RT data this alert came from. A feed may carry both static and realtime URLs, so this can be the same feed as a `feed_onestop_id` elsewhere in the schema
	RtFeedOnestopID string `json:"rt_feed_onestop_id"`
	// Time ranges during which this alert is active. 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"`
	// Header text optimized for text-to-speech (TTS) systems
	TtsHeaderText []*RTTranslation `json:"tts_header_text,omitempty"`
	// Description text optimized for text-to-speech (TTS) systems
	TtsDescriptionText []*RTTranslation `json:"tts_description_text,omitempty"`
	// URL for more information
	URL []*RTTranslation `json:"url,omitempty"`
	// Alert severity: `UNKNOWN_SEVERITY`, `INFO`, `WARNING`, or `SEVERE`
	SeverityLevel *string `json:"severity_level,omitempty"`
	// Entities this alert applies to, as published. See https://gtfs.org/realtime/reference/#message-entityselector
	InformedEntity []*RTEntitySelector `json:"informed_entity,omitempty"`
}

Alert(https://gtfs.org/reference/realtime/v2/#message-alert) message, also called a service alert, provided by a source GTFS Realtime feed.

type Area added in v1.4.0

type Area struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	WithStopID      tt.Int
	gtfs.Area
}

type ArtifactDeleter added in v1.4.0

type ArtifactDeleter interface {
	SoftDelete(ctx context.Context, artifactID int) error
}

ArtifactDeleter is the optional capability to soft-delete an artifact: the row is flagged (deleted_at) and hidden from reads, but its stored bytes are left for a later blob-culling pass. Callers type-assert an ArtifactReader to it.

type ArtifactOpts added in v1.3.4

type ArtifactOpts struct {
	Filename    string
	ContentType string
}

ArtifactOpts are the caller-supplied fields when a worker publishes an artifact. JobID, StorageKey, SizeBytes and SHA1 are filled in by the store.

type ArtifactReader added in v1.3.4

type ArtifactReader interface {
	// ListByJob returns jobID's artifacts, newest first.
	ListByJob(ctx context.Context, jobID string) ([]*JobArtifact, error)
	// GetByID returns one row, or ErrArtifactNotFound.
	GetByID(ctx context.Context, artifactID int) (*JobArtifact, error)
}

ArtifactReader is the read side used by the jobserver to list and look up artifacts. It is not scoped to a single job; callers pass the job id / row id.

type ArtifactStore added in v1.3.4

type ArtifactStore interface {
	CreateFile(ctx context.Context, opts ArtifactOpts, localPath string) (*JobArtifact, error)
	CreateReader(ctx context.Context, opts ArtifactOpts, r io.Reader) (*JobArtifact, error)
}

ArtifactStore is the per-job handle a worker uses to publish files. A scoped instance (bound to the executing job's id/user/kind) is resolved by JobArtifacts(ctx) from the job's JobMeta and Config.ArtifactStoreFactory.

func JobArtifacts added in v1.3.4

func JobArtifacts(ctx context.Context) ArtifactStore

JobArtifacts returns an ArtifactStore scoped to the executing job, or nil when there is no job on the context (e.g. an HTTP request) or no artifact storage is configured for this deployment. Workers call this to publish files attributed to the job they are running; the scope (id/user/kind) comes from the runner-stamped JobMeta, so a worker cannot misattribute a file to another job. A non-nil return means "in a job AND artifacts are available here."

type ArtifactStoreFactory added in v1.3.4

type ArtifactStoreFactory interface {
	ArtifactReader
	For(jobID, userID, kind string) ArtifactStore
}

ArtifactStoreFactory produces a per-job ArtifactStore and also serves the read API. The job middleware calls For(...) once per execution to bind the artifact identity; the jobserver uses the read methods directly.

type Attribution added in v1.4.0

type Attribution struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.Attribution
}

Attribution is an attributions.txt record.

type AttributionFilter added in v1.4.0

type AttributionFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
	// Search for an attribution with this GTFS attribution_id
	AttributionID *string `json:"attribution_id,omitempty"`
}

Search options for attributions

type BookingRule added in v1.3.0

type BookingRule struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.BookingRule
}

type BookingRuleFilter added in v1.3.0

type BookingRuleFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
	// Search for booking rules with this booking_rule_id
	BookingRuleID *string `json:"booking_rule_id,omitempty"`
}

Search options for GTFS Flex booking rules

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 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 [1=service added, 2=service removed]
	ExceptionType *int `json:"exception_type,omitempty"`
}

Search options for calendar dates

type CensusCursor added in v1.3.2

type CensusCursor struct {
	Geoid   string
	TableID int
	Valid   bool
}

CensusCursor encodes pagination state for census values using composite key (geoid, table_id)

func DecodeCensusCursor added in v1.3.2

func DecodeCensusCursor(cursor string) (CensusCursor, error)

DecodeCensusCursor decodes a cursor string

func NewCensusCursor added in v1.3.2

func NewCensusCursor(geoid string, tableID int) CensusCursor

NewCensusCursor creates a new census cursor

func (*CensusCursor) Encode added in v1.3.2

func (c *CensusCursor) Encode() string

Encode returns a base64-encoded cursor string

type CensusDataset added in v1.3.0

type CensusDataset struct {
	// Internal integer ID
	ID int `json:"id"`
	// Dataset name (e.g. `acsdt5y2022`, `tiger2021`, `ntd-annual-2024`)
	Name string `json:"name"`
	// Human-readable description
	Description *string `json:"description,omitempty"`
	// URL to the source or documentation
	URL *tt.Url `json:"url,omitempty"`
	// Earliest year of data coverage
	YearMin *int `json:"year_min,omitempty"`
	// Latest year of data coverage
	YearMax *int `json:"year_max,omitempty"`
	// Source files or archives that make up this dataset
	Sources []*CensusSource `json:"sources,omitempty"`
	// Geographic units in this dataset
	Geographies []*CensusGeography `json:"geographies,omitempty"`
	// Data table definitions available in this dataset
	Tables []*CensusTable `json:"tables,omitempty"`
	// Geographic layers (boundary types) available in this dataset, e.g. `tract`, `blockgroup`, `state`
	Layers []*CensusLayer `json:"layers,omitempty"`
	// Cursor-paginated data values for this dataset.
	// Use for large datasets (e.g. NTD) where result sets exceed practical limits for the per-geography `CensusGeography.values` field.
	// Filter by `geoid`, `geoid_prefix`, or `table`.
	ValuesRelay *CensusValueConnection `json:"values_relay,omitempty"`
}

A named collection of geographic and/or statistical data from a single source.

Datasets currently include: - **US Census Bureau ACS** (e.g. `acsdt5y2022`): American Community Survey 5-year estimates; contains demographic and socioeconomic data (population, income, etc.) keyed to standard FIPS geographic identifiers - **US Census Bureau TIGER/Line** (e.g. `tiger2021`): geographic boundary files for census tracts, block groups, states, and other administrative units - **US Federal Transit Administration NTD** (e.g. `ntd-annual-2024`): National Transit Database annual reporting data; contains operational metrics (vehicle revenue miles, operating expenses) by agency and mode

Each dataset contains one or more `CensusLayer`s (geographic boundary types), `CensusSource`s (individual source files), `CensusTable`s (data table definitions), and queryable `CensusGeography` records with associated `CensusValue` data.

type CensusDatasetFilter added in v1.3.0

type CensusDatasetFilter struct {
	// Search for the dataset with this exact name (e.g. `acsdt5y2022`)
	Name *string `json:"name,omitempty"`
	// Full-text search across dataset name and description
	Search *string `json:"search,omitempty"`
}

Search options for census datasets

type CensusDatasetGeographyFilter added in v1.3.0

type CensusDatasetGeographyFilter struct {
	// Restrict to geographies with these integer IDs
	Ids []int `json:"ids,omitempty"`
	// Search within this dataset (e.g. `tiger2021`)
	Dataset *string `json:"dataset,omitempty"`
	// Search within this layer (e.g. `tract`, `state`)
	Layer *string `json:"layer,omitempty"`
	// Search for geographies matching this string (matches on name)
	Search *string `json:"search,omitempty"`
	// Geographic search options
	Location *CensusDatasetGeographyLocationFilter `json:"location,omitempty"`
}

Search options for census geographies within a specific dataset

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 the union of the `CensusGeography` entities with these integer IDs
	GeographyIds []int `json:"geography_ids,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

The query area is the first of `bbox`, `within` and `geography_ids` that is set. It composes with `stop_buffer`: the search area is their intersection, so `intersection_area` reports the overlap inside both. A geography inside the query area but outside every stop buffer is not returned. With `stop_buffer.exclude`, the search area is instead the query area minus the stop buffers, and a geography wholly inside the buffers is not returned. `near` does not compose and takes effect only when no other filter applies.

Each geography appears once in the result set, and its `intersection_area` and `intersection_geometry` cover its whole overlap with the search area, even where the search area has several separate parts. A `bbox`, `within` polygon or `near` circle that crosses the antimeridian returns an error.

type CensusDatasetValueFilter added in v1.3.2

type CensusDatasetValueFilter struct {
	// Filter by table name
	Table *string `json:"table,omitempty"`
	// Filter by exact geoid
	Geoid *string `json:"geoid,omitempty"`
	// Filter by geoid prefix (e.g. 'ntd:00001' to find all values for NTD agency 00001)
	GeoidPrefix *string `json:"geoid_prefix,omitempty"`
}

Search options for census values within a dataset

type CensusField added in v1.3.0

type CensusField struct {
	// Internal integer ID
	ID int `json:"id"`
	// Column name as it appears in `CensusValue.values` (e.g. `b01001_001`)
	FieldName string `json:"field_name"`
	// Human-readable label for this column (e.g. `Total`)
	FieldTitle string `json:"field_title"`
	// Display order of this column within the table
	ColumnOrder *float64 `json:"column_order,omitempty"`
	TableID     int      `json:"-"`
}

Schema definition for a single column within a `CensusTable`. Field names from this type correspond to keys in the `CensusValue.values` map.

type CensusGeography

type CensusGeography struct {
	// Internal integer ID
	ID int `json:"id"`
	// Name of the parent dataset (e.g. `tiger2021`)
	DatasetName string `json:"dataset_name"`
	// Name of the source file this geography was loaded from (e.g. `tl_2024_01_tract.zip`)
	SourceName string `json:"source_name"`
	// Name of the layer this geography belongs to (e.g. `tract`, `state`)
	LayerName string `json:"layer_name"`
	// Standard identifier for this geography.
	// For ACS/TIGER geographies this is the FIPS code (e.g. `06075` for San Francisco County).
	// For NTD geographies this is the NTD agency ID.
	Geoid *string `json:"geoid,omitempty"`
	// Human-readable name of this geography (e.g. a county or tract name)
	Name *string `json:"name,omitempty"`
	// Geometry area in square meters, measured in the equal-area projection EPSG:6933
	GeometryArea *float64 `json:"geometry_area,omitempty"`
	// Land area, in square meters (from TIGER/Line `ALAND` field)
	Aland *float64 `json:"aland,omitempty"`
	// Water area, in square meters (from TIGER/Line `AWATER` field)
	Awater *float64 `json:"awater,omitempty"`
	// State or province name
	Adm1Name *string `json:"adm1_name,omitempty"`
	// State or province ISO 3166-2 code (e.g. `US-CA`)
	Adm1Iso *string `json:"adm1_iso,omitempty"`
	// Country name
	Adm0Name *string `json:"adm0_name,omitempty"`
	// Country ISO 3166-1 alpha-2 code (e.g. `US`)
	Adm0Iso *string `json:"adm0_iso,omitempty"`
	// Boundary geometry for this geography as a MultiPolygon
	Geometry *tt.MultiPolygon `json:"geometry,omitempty"`
	// When this geography was returned by a spatial query, the area of overlap between this geography and the search area, in square meters.
	// Measured the same way as `geometry_area`, so a geography inside the search area reports the same value for both.
	// Divide by `geometry_area` to get the fraction of the geography covered by the search area, then apply that fraction to a population value to estimate the population inside the search area.
	IntersectionArea *float64 `json:"intersection_area,omitempty"`
	// When this geography was returned by a spatial query, the geometry of the intersection between this geography and the search area.
	// Only populated when explicitly requested; may be expensive to compute.
	IntersectionGeometry *tt.Geometry `json:"intersection_geometry,omitempty"`
	// Statistical data values for this geography from the specified tables
	Values []*CensusValue `json:"values"`
	// The layer this geography belongs to
	Layer *CensusLayer `json:"layer,omitempty"`
	// The source file this geography was loaded from
	Source        *CensusSource `json:"source,omitempty"`
	DatasetID     int           `json:"-"`
	LayerID       int           `json:"-"`
	MatchEntityID int           `json:"-"`
	SourceID      int           `json:"-"`
}

A single spatial unit within a layer — for example, a specific Census Tract, a US State, or an NTD agency record.

Geographies are the primary unit of analysis: they carry geometry, administrative context, and can be linked to statistical data via `values`. When queried with a spatial filter, the `intersection_area` and `intersection_geometry` fields are populated to describe the overlap between the geography and the search area — useful for calculating what fraction of a geography (and its population) is covered by a transit service area.

A spatial query returns each geography once, with `intersection_area` and `intersection_geometry` covering its whole overlap with the search area, even where the search area has several separate parts.

type CensusGeographyFilter added in v1.3.0

type CensusGeographyFilter struct {
	// Search within this dataset
	Dataset *string `json:"dataset,omitempty"`
	// Search within this layer
	Layer *string `json:"layer,omitempty"`
	// Buffer radius in meters around the parent entity's geometry (e.g. stop or route stops). With no radius, or a radius of 0, matches the geographies containing the stops.
	Radius *float64 `json:"radius,omitempty"`
	// Search for geographies matching this string
	Search *string `json:"search,omitempty"`
}

Search options for census geographies

type CensusGeographySelect added in v1.4.0

type CensusGeographySelect struct {
	Geometry             bool
	GeometryArea         bool
	IntersectionArea     bool
	IntersectionGeometry bool
}

CensusGeographySelect chooses which geometry columns a census geography query returns. Each is expensive on every row, so a query returns only the ones its field selects.

type CensusLayer added in v1.3.0

type CensusLayer struct {
	// Internal integer ID
	ID int `json:"id"`
	// Layer name used as a filter key (e.g. `tract`, `blockgroup`, `state`)
	Name string `json:"name"`
	// Human-readable description of this layer
	Description *string `json:"description,omitempty"`
	// Geographic units belonging to this layer
	Geographies []*CensusGeography `json:"geographies,omitempty"`
	DatasetID   int                `json:"-"`
}

A named category of geographic boundaries within a dataset, grouping geometries of the same type (e.g. all census tracts, all states).

Common layer names include `tract` (census tracts), `blockgroup` (block groups), and `state`. Layers are used as the primary filter when querying `CensusGeography` records to select the desired level of geographic aggregation.

type CensusSource added in v1.3.0

type CensusSource struct {
	// Internal integer ID
	ID int `json:"id"`
	// Source file name (e.g. `tl_2024_01_tract.zip`)
	Name string `json:"name"`
	// Description of this source file
	Description *string `json:"description,omitempty"`
	// URL to the original source file
	URL tt.Url `json:"url"`
	// SHA1 checksum of the source file
	Sha1 string `json:"sha1"`
	// Geographic units loaded from this source file
	Geographies []*CensusGeography `json:"geographies,omitempty"`
	// Data tables loaded from this source file
	Tables []*CensusTable `json:"tables,omitempty"`
	// Geographic layers defined by this source file
	Layers    []*CensusLayer `json:"layers,omitempty"`
	DatasetID int            `json:"-"`
}

A specific source file or archive that was imported to populate part of a dataset (e.g. a single state's TIGER/Line shapefile, or one year's ACS data release).

type CensusSourceFilter added in v1.3.0

type CensusSourceFilter struct {
	// Search for sources with this exact name
	Name *string `json:"name,omitempty"`
	// Search for sources matching this string
	Search *string `json:"search,omitempty"`
}

Search options for census source files

type CensusSourceGeographyFilter added in v1.3.0

type CensusSourceGeographyFilter struct {
	// Restrict to geographies with these integer IDs
	Ids []int `json:"ids,omitempty"`
	// Search for geographies matching this string (matches on name)
	Search *string `json:"search,omitempty"`
	// Geographic search options
	Location *CensusDatasetGeographyLocationFilter `json:"location,omitempty"`
}

Search options for census geography sources

type CensusTable

type CensusTable struct {
	// Internal integer ID
	ID int `json:"id"`
	// Table identifier used when querying values (e.g. `b01001`, `service_data_and_operating_expenses_by_mode`)
	TableName string `json:"table_name"`
	// Human-readable title of this table (e.g. `Sex By Age`)
	TableTitle string `json:"table_title"`
	// Grouping category for this table within the dataset
	TableGroup *string `json:"table_group,omitempty"`
	// Additional descriptive details, such as the population universe (e.g. `Total population`)
	TableDetails *string `json:"table_details,omitempty"`
	// Field (column) definitions for this table
	Fields    []*CensusField `json:"fields"`
	DatasetID int            `json:"-"`
}

Schema definition for a data table within a dataset. Describes the available columns and their metadata; the actual data is returned via `CensusValue`.

type CensusTableFilter added in v1.3.0

type CensusTableFilter struct {
	// Search for tables matching this string (matches on table name and title)
	Search *string `json:"search,omitempty"`
}

Search options for census tables

type CensusValue

type CensusValue struct {
	// Name of the dataset this value belongs to (e.g. `acsdt5y2022`)
	DatasetName string `json:"dataset_name"`
	// Name of the source file this value was loaded from
	SourceName string `json:"source_name"`
	// Table definition describing the columns in `values`
	Table *CensusTable `json:"table"`
	// Map of column names to their values for this geography and table
	Values tt.Map `json:"values"`
	// GEOID of the associated geography (FIPS code, NTD ID, etc.)
	Geoid       string `json:"geoid"`
	GeographyID int    `json:"-"`
	TableID     int    `json:"-"`
}

Statistical data values for a specific geography and table row.

The `values` field is an unstructured map of column names to their values for this geography. Column names and types vary by dataset and table — consult the associated `CensusTable` and `CensusField` records for schema information.

Examples: - ACS table `b01001`: `{ "b01001_001": 42381 }` (total population estimate) - NTD table `service_data_and_operating_expenses_by_mode`: `{ "Vehicle Revenue Miles": 1234567, "Operating Expenses": 9876543, "mode": "MB", "ntd_id": "90001" }`

type CensusValueConnection added in v1.3.2

type CensusValueConnection struct {
	Edges    []*CensusValueEdge
	PageInfo *PageInfo
}

CensusValueConnection represents a Relay-style connection for census values

type CensusValueEdge added in v1.3.2

type CensusValueEdge struct {
	Node   *CensusValue
	Cursor string
}

CensusValueEdge represents an edge in the census values connection

type Checker added in v1.3.0

type Checker = authz.Checker

type Config added in v1.3.0

type Config struct {
	Finder     Finder
	RTFinder   RTFinder
	GbfsFinder GbfsFinder
	Checker    Checker
	Actions    Actions
	// Adapter is the DB handle for the operations that are inherently
	// database-backed (editor entity CRUD, feed-version DB readers, fleet
	// maintenance) and the FeedManager for the import/fetch bookkeeping flows.
	// Both are set only in DB-backed deployments; an in-memory finder leaves
	// them nil and those operations are simply unavailable. This replaces the
	// former Finder.DBX() escape hatch, which forced every Finder (including the
	// in-memory one) to expose a DB handle it might not have.
	Adapter     tldb.Adapter
	FeedManager feedmanager.FeedManager
	Jobs        jobs.Backend
	JobRunner   *jobs.Runner
	// JobPolicy gates the synchronous /run endpoint (which doesn't go
	// through a Queue). Nil means no kind-level RBAC on /run.
	JobPolicy          jobs.AccessPolicy
	Clock              clock.Clock
	Secrets            []dmfr.Secret
	ValidateLargeFiles bool
	UseMaterialized    bool
	// UseMaterializedDepartures plans departure queries from a materialized
	// CTE of the requested entities' stop_times.
	UseMaterializedDepartures bool
	UseGeohashFilter          bool
	AllowHTTPFetchUnfiltered  bool
	// RestPrefix is the public prefix of the REST mount's *parent*, e.g.
	// https://transit.land/api/v2 for a server reachable at .../api/v2/rest. The
	// mount segment is not known at config time; the server recovers it from the
	// request path. Empty yields host-relative links.
	RestPrefix string
	// LinkURL rewrites a public URL this server generated for a client to
	// follow, such as the REST pagination link. Hosts set it to re-add
	// parameters the caller must present again — an API key that arrived in the
	// query string and was taken off the request before it reached a handler.
	// Nil leaves generated URLs unchanged.
	//
	// This package deliberately sees only the URL: how a caller authenticated
	// is not something it should know.
	LinkURL func(ctx context.Context, u string) string
	// JobsPrefix is the public prefix of the jobserver mount (analogue of
	// RestPrefix for the REST mount), used to build absolute artifact download
	// links that are correct behind a path-rewriting ingress. Empty yields
	// host-relative links.
	JobsPrefix      string
	Storage         string
	RTStorage       string
	ArtifactStorage string // job-artifact storage URL; no fallback to Storage
	// ArtifactStoreFactory is the unscoped read/serve side (jobserver) and the
	// producer of per-job scoped handles (see JobArtifacts). The per-job handle
	// is intentionally NOT a Config field: it is execution-scoped, resolved from
	// the job's JobMeta rather than stored on this process-wide struct.
	ArtifactStoreFactory    ArtifactStoreFactory
	LoaderBatchSize         int
	LoaderStopTimeBatchSize int
	MaxRadius               float64
}

func ForContext added in v1.3.0

func ForContext(ctx context.Context) Config
func (cfg Config) Link(ctx context.Context, u string) string

Link applies LinkURL to a generated URL, or returns it unchanged when no host rewriter is set.

type Cursor added in v1.3.0

type Cursor struct {
	FeedVersionID int
	ID            int
	Valid         bool
}

func NewCursor added in v1.3.0

func NewCursor(fvid int, id int) Cursor

func (Cursor) MarshalGQL added in v1.3.0

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

MarshalGQL implements the graphql.Marshaler interface

func (*Cursor) MarshalJSON added in v1.3.0

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

MarshalJSON implements the json.marshaler interface.

func (*Cursor) Scan added in v1.3.0

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

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Cursor) UnmarshalGQL added in v1.3.0

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

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Cursor) UnmarshalJSON added in v1.3.0

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

UnmarshalJSON implements json.Marshaler interface.

type DirectionRequest added in v1.3.0

type DirectionRequest struct {
	// Destination waypoint
	To *WaypointInput `json:"to"`
	// Origin waypoint
	From *WaypointInput `json:"from"`
	// Travel mode: `WALK`, `AUTO`, `BICYCLE`, `TRANSIT`, or `LINE`
	Mode StepMode `json:"mode"`
	// Departure time; treated as arrival time when arrive_by is true. Defaults to now
	DepartAt *time.Time `json:"depart_at,omitempty"`
	// If true, treat depart_at as the desired arrival time rather than departure time. Support depends on the configured routing provider
	ArriveBy *bool `json:"arrive_by,omitempty"`
}

Input parameters for a directions (routing) request.

Specifies an origin, destination, travel mode, and optional departure time. Results are returned as a `Directions` object containing one or more `Itinerary` options.

type Directions added in v1.3.0

type Directions struct {
	// Whether the routing request succeeded
	Success bool `json:"success"`
	// Error message if the request did not succeed
	Exception *string `json:"exception,omitempty"`
	// Identifier for the routing data source or provider
	DataSource *string `json:"data_source,omitempty"`
	// Resolved origin waypoint
	Origin *Waypoint `json:"origin,omitempty"`
	// Resolved destination waypoint
	Destination *Waypoint `json:"destination,omitempty"`
	// Total duration of the first itinerary
	Duration *Duration `json:"duration,omitempty"`
	// Total distance of the first itinerary
	Distance *Distance `json:"distance,omitempty"`
	// Departure time of the first itinerary
	StartTime *time.Time `json:"start_time,omitempty"`
	// Arrival time of the first itinerary
	EndTime *time.Time `json:"end_time,omitempty"`
	// Itineraries as returned by the routing provider, typically in preference order
	Itineraries []*Itinerary `json:"itineraries,omitempty"`
}

Result of a directions (routing) request.

Contains one or more `Itinerary` options from origin to destination, along with summary information for the first (best) itinerary.

type Distance added in v1.3.0

type Distance struct {
	// Numeric distance value
	Distance float64 `json:"distance"`
	// Unit of measurement
	Units DistanceUnit `json:"units"`
}

A distance value with units.

type DistanceUnit added in v1.3.0

type DistanceUnit string

Unit of distance measurement.

const (
	// Distance in kilometers
	DistanceUnitKilometers DistanceUnit = "KILOMETERS"
	// Distance in meters
	DistanceUnitMeters DistanceUnit = "METERS"
	// Distance in miles
	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 {
	// Numeric duration value
	Duration float64 `json:"duration"`
	// Unit of measurement
	Units DurationUnit `json:"units"`
}

A duration value with units.

type DurationUnit added in v1.3.0

type DurationUnit string

Unit of time duration.

const (
	// Duration in seconds
	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)
	FindShapesByFeedVersion(context.Context, int, *int, *Cursor, *ShapeFilter) ([]*Shape, 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, PlaceGeometrySelect) ([]*Place, error)
	FindCensusDatasets(context.Context, *int, *Cursor, []int, *CensusDatasetFilter) ([]*CensusDataset, error)
	FindCensusValuesByDatasetID(context.Context, *int, CensusCursor, int, *CensusDatasetValueFilter) ([]*CensusValue, error)
	RouteStopBuffer(context.Context, *int, *float64, int) ([]*RouteStopBuffer, error)
	FindFeedVersionServiceWindow(context.Context, int) (*ServiceWindow, error)
}

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)
	AttributionsByFeedVersionIDs(context.Context, *int, *Cursor, *AttributionFilter, []int) ([][]*Attribution, 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, CensusGeographySelect, []int) ([][]*CensusGeography, error)
	CensusGeographiesByEntityIDs(context.Context, *int, *CensusGeographyFilter, CensusGeographySelect, string, []int) ([][]*CensusGeography, error)
	CensusGeographiesByLayerIDs(context.Context, *int, *CensusSourceGeographyFilter, CensusGeographySelect, []int) ([][]*CensusGeography, error)
	CensusGeographiesBySourceIDs(context.Context, *int, *CensusSourceGeographyFilter, CensusGeographySelect, []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)
	CensusTablesByDatasetIDs(context.Context, *int, *CensusTableFilter, []int) ([][]*CensusTable, error)
	CensusTablesBySourceIDs(context.Context, *int, *CensusTableFilter, []int) ([][]*CensusTable, error)
	CensusTableByIDs(context.Context, []int) ([]*CensusTable, []error)
	CensusValuesByGeographyIDs(context.Context, *int, string, []string, []string) ([][]*CensusValue, error)
	// GTFS Fares v1 and v2
	FareAttributesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareAttribute, error)
	FareAttributesByIDs(context.Context, []int) ([]*FareAttribute, []error)
	FareRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareRule, error)
	FareMediaByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareMedia, error)
	FareMediaByIDs(context.Context, []int) ([]*FareMedia, []error)
	FareProductsByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareProduct, error)
	FareProductsByFeedVersionFareProductIDs(context.Context, []FVEntityID) ([][]*FareProduct, []error)
	FareLegRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareLegRule, error)
	FareLegRulesByFeedVersionLegGroupIDs(context.Context, []FVEntityID) ([][]*FareLegRule, []error)
	FareLegJoinRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareLegJoinRule, error)
	FareTransferRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareTransferRule, error)
	RiderCategoriesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*RiderCategory, error)
	RiderCategoriesByFeedVersionRiderCategoryIDs(context.Context, []FVEntityID) ([]*RiderCategory, []error)
	TimeframesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*Timeframe, error)
	TimeframesByFeedVersionTimeframeGroupIDs(context.Context, []FVEntityID) ([][]*Timeframe, []error)
	AreasByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*Area, error)
	AreasByIDs(context.Context, []int) ([]*Area, []error)
	AreasByStopIDs(context.Context, *int, []int) ([][]*Area, error)
	NetworksByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*Network, error)
	NetworksByIDs(context.Context, []int) ([]*Network, []error)
	NetworksByRouteIDs(context.Context, *int, []int) ([][]*Network, error)
	RouteNetworksByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*RouteNetwork, error)
	StopAreasByAreaIDs(context.Context, *int, *Cursor, []int) ([][]*StopArea, error)
	StopAreasByFeedVersionIDs(context.Context, *int, *Cursor, *StopAreaFilter, []int) ([][]*StopArea, 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)
	FrequenciesByFeedVersionIDs(context.Context, *int, *Cursor, *FrequencyFilter, []int) ([][]*Frequency, error)
	FrequenciesByTripIDs(context.Context, *int, []int) ([][]*Frequency, error)
	LevelsByFeedVersionIDs(context.Context, *int, *Cursor, *LevelFilter, []int) ([][]*Level, 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)
	LocationGroupStopsByFeedVersionIDs(context.Context, *int, *Cursor, *LocationGroupStopFilter, []int) ([][]*LocationGroupStop, 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)
	PathwaysByFeedVersionIDs(context.Context, *int, *Cursor, *PathwayFilter, []int) ([][]*Pathway, 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)
	RoutesByFeedVersionRouteIDs(context.Context, []FVEntityID) ([]*Route, []error)
	RoutesByIDs(context.Context, []int) ([]*Route, []error)
	RouteStopPatternsByRouteIDs(context.Context, *int, *RouteStopPatternFilter, []FVPair) ([][]*RouteStopPattern, error)
	RouteStopsByRouteIDs(context.Context, *int, []int) ([][]*RouteStop, error)
	RouteStopsByStopIDs(context.Context, *int, []int) ([][]*RouteStop, error)
	RouteTypesByAgencyIDs(context.Context, []int) ([][]int, []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)
	StopsByAgencyIDs(context.Context, *int, *Cursor, *AgencyStopFilter, []int) ([][]*Stop, error)
	StopsByFeedVersionIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)
	StopsByFeedVersionStopIDs(context.Context, []FVEntityID) ([]*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)
	TransfersByFeedVersionIDs(context.Context, *int, *Cursor, *TransferFilter, []int) ([][]*Transfer, error)
	TranslationsByFeedVersionIDs(context.Context, *int, *Cursor, *TranslationFilter, []int) ([][]*Translation, error)
	TripsByFeedVersionIDs(context.Context, *int, *TripFilter, []int) ([][]*Trip, error)
	TripsByFeedVersionTripIDs(context.Context, []FVEntityID) ([]*Trip, []error)
	TripsByIDs(context.Context, []int) ([]*Trip, []error)
	TripsByRouteIDs(context.Context, *int, *TripFilter, []FVPair) ([][]*Trip, error)
	TripsByShapeIDs(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 EstimateSource added in v1.4.0

type EstimateSource string

EstimateSource names the source of an estimated arrival or departure.

const (
	// EstimateTime is the time the stop time update's event gives.
	EstimateTime EstimateSource = "time"
	// EstimateDelay is the scheduled time plus a delay that the stop time
	// update's own events give or imply.
	EstimateDelay EstimateSource = "delay"
	// EstimateCarried is the scheduled time plus a delay carried from an
	// earlier stop time update, or the trip's own delay before the first.
	EstimateCarried EstimateSource = "carried"
)

type FVEntityID added in v1.4.0

type FVEntityID struct {
	FeedVersionID int
	EntityID      string
}

FVEntityID pairs a feed version with a GTFS entity id, for looking up entities named by their GTFS id rather than an internal integer id.

type FVPair added in v1.3.0

type FVPair struct {
	FeedVersionID int
	EntityID      int
}

type FareAttribute added in v1.4.0

type FareAttribute struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.FareAttribute
}

type FareLegJoinRule added in v1.4.0

type FareLegJoinRule struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.FareLegJoinRule
}

type FareLegRule added in v1.4.0

type FareLegRule struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.FareLegRule
}

type FareMedia added in v1.4.0

type FareMedia struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.FareMedia
}

type FareProduct added in v1.4.0

type FareProduct struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.FareProduct
}

type FareRule added in v1.4.0

type FareRule struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.FareRule
}

type FareTransferRule added in v1.4.0

type FareTransferRule struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.FareTransferRule
}

type Feature added in v1.3.0

type Feature struct {
	// Caller-supplied identifier echoed back on matched stops
	ID *string `json:"id,omitempty"`
	// Boundary geometry for the feature (GeoJSON)
	Geometry *tt.Geometry `json:"geometry,omitempty"`
	// Arbitrary key/value metadata associated with the feature
	Properties *tt.Map `json:"properties,omitempty"`
	// GeoJSON type, typically `Feature`
	Type *string `json:"type,omitempty"`
}

A GeoJSON-style feature used as a search-area input. Stops contained in the feature are returned with the feature's `id` echoed back via `Stop.within_features`

type Feed

type Feed struct {
	WithOperatorOnestopID tt.String
	SearchRank            *string
	dmfr.Feed
}

type FeedAuthorization

type FeedAuthorization struct {
	dmfr.FeedAuthorization
}

type FeedFetch added in v1.3.0

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

type FeedFetchFilter added in v1.3.0

type FeedFetchFilter struct {
	// Filter by fetch outcome: true for successful, false for failed
	Success *bool `json:"success,omitempty"`
}

Search options for feed fetches

type FeedFilter

type FeedFilter struct {
	// Search for a feed with this specific Onestop ID
	OnestopID *string `json:"onestop_id,omitempty"`
	// Restrict to feeds matching any of the given data types
	Spec []FeedSpecTypes `json:"spec,omitempty"`
	// Filter by latest-fetch outcome: true for feeds whose most recent fetch failed, false for those whose succeeded
	FetchError *bool `json:"fetch_error,omitempty"`
	// Filter by the import status of the feed's active feed version
	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 FeedLicense

type FeedLicense struct {
	dmfr.FeedLicense
}

type FeedSourceURL added in v1.3.0

type FeedSourceURL struct {
	// URL to match against feed source URLs
	URL *string `json:"url,omitempty"`
	// Restrict the URL match to a specific URL type (e.g. `static_current`)
	Type *FeedSourceURLTypes `json:"type,omitempty"`
	// If true, match the URL case-sensitively; default is case-insensitive
	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 (
	// GTFS Schedule (static)
	FeedSpecTypesGtfs FeedSpecTypes = "GTFS"
	// GTFS Realtime
	FeedSpecTypesGtfsRt FeedSpecTypes = "GTFS_RT"
	// General Bikeshare Feed Specification
	FeedSpecTypesGbfs FeedSpecTypes = "GBFS"
	// Mobility Data Specification
	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 FeedState

type FeedState struct {
	dmfr.FeedState
}

type FeedUrls

type FeedUrls struct {
	dmfr.FeedUrls
}

type FeedVersion

type FeedVersion struct {
	dmfr.FeedVersion
}

type FeedVersionDeleteResult

type FeedVersionDeleteResult struct {
	// True if the delete succeeded
	Success bool `json:"success"`
}

Result of feed version delete operation

type FeedVersionFetchResult

type FeedVersionFetchResult struct {
	// Details of the fetched feed version, if the fetch succeeded
	FeedVersion *FeedVersion `json:"feed_version,omitempty"`
	// Error message if the fetch failed
	FetchError *string `json:"fetch_error,omitempty"`
	// True if the same zip file is already in the database (matched by SHA1)
	FoundSha1 bool `json:"found_sha1"`
	// True if a zip with identical unpacked contents is already in the database (matched by directory SHA1)
	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 Onestop ID
	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 SHA1 hash of the top-level .txt files (`sha1_dir`)
	Sha1Dir *string `json:"sha1_dir,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 feed versions 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 {
	// True if the import succeeded
	Success bool `json:"success"`
}

Result of feed version import operation

type FeedVersionInput added in v1.3.0

type FeedVersionInput struct {
	// Integer ID of the feed version
	ID *int `json:"id,omitempty"`
}

Reference to an existing 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"`
	// Earliest calendar date with scheduled service
	EarliestCalendarDate *tt.Date `json:"earliest_calendar_date,omitempty"`
	// Latest calendar date with scheduled service
	LatestCalendarDate *tt.Date `json:"latest_calendar_date,omitempty"`
	// Start date (Monday) of a representative week with full or near-full service; used as a fallback when queries fall outside the regular service window
	FallbackWeek *tt.Date `json:"fallback_week,omitempty"`
	// Default timezone
	DefaultTimezone *string `json:"default_timezone,omitempty"`
	FeedVersionID   int     `json:"-"`
}

Summary details on service dates in a feed version

type FeedVersionSetInput

type FeedVersionSetInput struct {
	// Integer ID of the feed version to update; required
	ID *int `json:"id,omitempty"`
	// New name for the feed version
	Name *string `json:"name,omitempty"`
	// New description for the feed version
	Description *string `json:"description,omitempty"`
}

Update a feed version entity

type FeedVersionUnimportResult

type FeedVersionUnimportResult struct {
	// True if the unimport succeeded
	Success bool `json:"success"`
}

Result of feed version unimport operation

type Finder added in v1.3.0

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 FocusPoint struct {
	// Latitude
	Lat float64 `json:"lat"`
	// Longitude
	Lon float64 `json:"lon"`
}

A point used to bias result ordering by distance, without otherwise filtering results

type Frequency

type Frequency struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.Frequency
}

type FrequencyFilter added in v1.4.0

type FrequencyFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
}

Search options for frequencies

type GbfsAlertTime added in v1.3.0

type GbfsAlertTime struct {
	*gbfs.AlertTime
}

type GbfsBikeRequest added in v1.3.0

type GbfsBikeRequest struct {
	// Search for vehicles within this radius of a point
	Near *PointRadius `json:"near,omitempty"`
}

Request parameters for querying nearby free-floating bikes/scooters.

type GbfsBrandAsset added in v1.3.0

type GbfsBrandAsset struct {
	*gbfs.BrandAsset
}

type GbfsDockRequest added in v1.3.0

type GbfsDockRequest struct {
	// Search for stations within this radius of a point
	Near *PointRadius `json:"near,omitempty"`
}

Request parameters for querying nearby docking stations.

type GbfsFeed added in v1.3.0

type GbfsFeed struct {
	*gbfs.GbfsFeed
}

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 (*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 GbfsPlanPrice struct {
	*gbfs.PlanPrice
}

type GbfsRentalApp added in v1.3.0

type GbfsRentalApp struct {
	*gbfs.RentalApp
}

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 (*GbfsStationInformation) Status added in v1.3.0

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 Group added in v1.3.3

type Group struct {
	// Internal integer ID
	ID int `json:"id"`
	// Group name
	Name string `json:"name"`
	// Parent tenant
	Tenant *Tenant `json:"tenant,omitempty"`
	// Feeds assigned to this group
	Feeds []*Feed `json:"feeds"`
	// Authorization permissions for this group
	Permissions *Permissions `json:"permissions,omitempty"`
}

A group that organizes feeds within a tenant

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 Itinerary added in v1.3.0

type Itinerary struct {
	// Total duration of this itinerary
	Duration *Duration `json:"duration"`
	// Total distance of this itinerary
	Distance *Distance `json:"distance"`
	// Departure time of this itinerary
	StartTime time.Time `json:"start_time"`
	// Arrival time of this itinerary
	EndTime time.Time `json:"end_time"`
	// Origin waypoint
	From *Waypoint `json:"from"`
	// Destination waypoint
	To *Waypoint `json:"to"`
	// Ordered list of legs making up this itinerary
	Legs []*Leg `json:"legs,omitempty"`
}

A single trip option from origin to destination, composed of one or more `Leg`s.

type JobArtifact added in v1.3.4

type JobArtifact struct {
	JobID       string  `db:"job_id" json:"job_id"`
	JobKind     string  `db:"job_kind" json:"job_kind"`
	UserID      string  `db:"user_id" json:"-"`
	Filename    string  `db:"filename" json:"filename"`
	ContentType string  `db:"content_type" json:"content_type"`
	SizeBytes   int64   `db:"size_bytes" json:"size_bytes"`
	SHA1        string  `db:"sha1" json:"sha1,omitempty"`
	StorageKey  string  `db:"storage_key" json:"-"`
	DeletedAt   tt.Time `db:"deleted_at" json:"-"`
	tt.DatabaseEntity
	tt.Timestamps
}

JobArtifact is a file produced by a background job, for the submitting user to download. It is both the tl_job_artifacts row and the artifact-API DTO.

JobID is opaque: a river_job id, local uuid, or Argo workflow name, never a foreign key. UserID and StorageKey are internal (json:"-") and must not reach API clients.

func (*JobArtifact) TableName added in v1.3.4

func (e *JobArtifact) TableName() string

TableName implements the tldb table-name interface.

type Leg added in v1.3.0

type Leg struct {
	// Duration of this leg
	Duration *Duration `json:"duration"`
	// Distance of this leg
	Distance *Distance `json:"distance"`
	// Start time of this leg
	StartTime time.Time `json:"start_time"`
	// End time of this leg
	EndTime time.Time `json:"end_time"`
	// Origin waypoint for this leg
	From *Waypoint `json:"from,omitempty"`
	// Destination waypoint for this leg
	To *Waypoint `json:"to,omitempty"`
	// Travel mode for this leg
	Mode *StepMode `json:"mode,omitempty"`
	// Turn-by-turn steps for this leg (non-transit modes)
	Steps []*Step `json:"steps,omitempty"`
	// Stops served by this leg, from origin to destination, including any intermediate stops (transit mode only)
	Stops []*WaypointDeparture `json:"stops,omitempty"`
	// Path geometry for this leg as a LineString
	Geometry tt.LineString `json:"geometry"`
	// Transit trip details for this leg (transit mode only)
	Trip *LegTrip `json:"trip,omitempty"`
}

A single segment of an itinerary, traveled by a single mode (e.g. walk, transit vehicle).

A transit leg includes the route, trip, and intermediate stops. A walk leg includes turn-by-turn steps.

type LegRoute added in v1.3.0

type LegRoute struct {
	// GTFS route_id
	RouteID string `json:"route_id"`
	// GTFS route_short_name
	RouteShortName string `json:"route_short_name"`
	// GTFS route_long_name
	RouteLongName string `json:"route_long_name"`
	// Onestop ID for this route
	RouteOnestopID string `json:"route_onestop_id"`
	// GTFS route_type
	RouteType int `json:"route_type"`
	// Route color in hex format (e.g. `FF0000`)
	RouteColor *string `json:"route_color,omitempty"`
	// Route text color in hex format
	RouteTextColor *string `json:"route_text_color,omitempty"`
	// Agency operating this route
	Agency *LegRouteAgency `json:"agency"`
}

Summary of the route used within a leg.

type LegRouteAgency added in v1.3.0

type LegRouteAgency struct {
	// GTFS agency_id
	AgencyID string `json:"agency_id"`
	// Agency name
	AgencyName string `json:"agency_name"`
	// Onestop ID for this agency
	AgencyOnestopID string `json:"agency_onestop_id"`
}

Summary of the agency operating the route within a leg.

type LegTrip added in v1.3.0

type LegTrip struct {
	// GTFS trip_id
	TripID string `json:"trip_id"`
	// GTFS trip_short_name
	TripShortName string `json:"trip_short_name"`
	// Trip headsign
	Headsign string `json:"headsign"`
	// Feed Onestop ID for the source feed
	FeedID string `json:"feed_id"`
	// SHA1 hash of the source feed version
	FeedVersionSha1 string `json:"feed_version_sha1"`
	// Route information for this trip
	Route *LegRoute `json:"route"`
}

Summary of the transit trip used within a leg.

type Level

type Level struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	Geometry        tt.MultiPolygon
	ParentStation   tt.Key
	gtfs.Level
}

type LevelFilter added in v1.4.0

type LevelFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
	// Search for a level with this GTFS level_id
	LevelID *string `json:"level_id,omitempty"`
}

Search options for levels

type LevelSetInput added in v1.3.0

type LevelSetInput struct {
	// Integer ID of the level to update; omit when creating a new level
	ID *int `json:"id,omitempty"`
	// Feed version this level belongs to (required when creating a new level)
	FeedVersion *FeedVersionInput `json:"feed_version,omitempty"`
	// Set GTFS level_id
	LevelID *string `json:"level_id,omitempty"`
	// Set GTFS level_name
	LevelName *string `json:"level_name,omitempty"`
	// Set GTFS level_index
	LevelIndex *float64 `json:"level_index,omitempty"`
	// Set level geometry
	Geometry *tt.MultiPolygon `json:"geometry,omitempty"`
	// Reference to an existing parent station; only the `id` is used (the parent must already exist)
	Parent *StopSetInput `json:"parent,omitempty"`
}

Create or update a level entity. For updates, supply `id`. For creation, supply `feed_version`

type LicenseFilter added in v1.3.0

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 added in v1.3.0

type LicenseValue string

Permissible and impermissible actions for a given license use

const (
	// Use is allowed
	LicenseValueYes LicenseValue = "YES"
	// Use is not allowed
	LicenseValueNo LicenseValue = "NO"
	// Match any value that is not `NO` (i.e. `YES` or `UNKNOWN`); used in license filters
	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 Location added in v1.3.0

type Location struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.Location
}

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
	WithStopID      tt.Int // internal: grouping key set by LocationGroupsByStopIDs
	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 {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.LocationGroupStop
}

type LocationGroupStopFilter added in v1.4.0

type LocationGroupStopFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
}

Search options for location group stops

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"`
	// Roles assigned to this user
	Roles []string `json:"roles,omitempty"`
	// External identifiers and metadata associated with this user, e.g. metering service IDs
	ExternalData tt.Map `json:"external_data"`
}

Current user metadata

type Mutation added in v1.3.0

type Mutation struct {
}

Root Mutation type.

**Authorization**: Most mutations require specific user roles and permissions (e.g. `editor`, `admin`).

type Network added in v1.4.0

type Network struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	WithRouteID     tt.Int
	gtfs.Network
}

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 {
	// If true, collapse multiple agency-operator associations into a single result per operator
	Merged *bool `json:"merged,omitempty"`
	// Search for operators with this Onestop ID
	OnestopID *string `json:"onestop_id,omitempty"`
	// Search for operators with these Onestop IDs
	OnestopIds []string `json:"onestop_ids,omitempty"`
	// Search for operators with this feed Onestop ID
	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 matching these tags
	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 PageInfo added in v1.3.2

type PageInfo struct {
	HasNextPage     bool
	HasPreviousPage bool
	StartCursor     *string
	EndCursor       *string
}

PageInfo contains pagination metadata

type Pathway

type Pathway struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.Pathway
}

type PathwayFilter

type PathwayFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
	// Search for a pathway with this GTFS pathway_id
	PathwayID *string `json:"pathway_id,omitempty"`
	// 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 {
	// Integer ID of the pathway to update; omit when creating a new pathway
	ID *int `json:"id,omitempty"`
	// Feed version this pathway belongs to (required when creating a new pathway)
	FeedVersion *FeedVersionInput `json:"feed_version,omitempty"`
	// Set GTFS pathway_id
	PathwayID *string `json:"pathway_id,omitempty"`
	// Set GTFS pathway_mode
	PathwayMode *int `json:"pathway_mode,omitempty"`
	// Set GTFS is_bidirectional
	IsBidirectional *int `json:"is_bidirectional,omitempty"`
	// Set GTFS length
	Length *float64 `json:"length,omitempty"`
	// Set GTFS traversal_time
	TraversalTime *int `json:"traversal_time,omitempty"`
	// Set GTFS stair_count
	StairCount *int `json:"stair_count,omitempty"`
	// Set GTFS max_slope
	MaxSlope *float64 `json:"max_slope,omitempty"`
	// Set GTFS min_width
	MinWidth *float64 `json:"min_width,omitempty"`
	// Set GTFS signposted_as
	SignpostedAs *string `json:"signposted_as,omitempty"`
	// Set GTFS reverse_signposted_as
	ReverseSignpostedAs *string `json:"reverse_signposted_as,omitempty"`
	// Reference to an existing origin stop; only the `id` is used (the stop must already exist)
	FromStop *StopSetInput `json:"from_stop,omitempty"`
	// Reference to an existing destination stop; only the `id` is used (the stop must already exist)
	ToStop *StopSetInput `json:"to_stop,omitempty"`
}

Create or update a pathway entity. For updates, supply `id`. For creation, supply `feed_version`

type PermFilter added in v1.3.0

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

PermFilter holds permission-based filtering criteria for feeds and feed versions. When IsGlobalAdmin is true, no filtering is applied (unrestricted access). Otherwise, access is restricted to the specified AllowedFeeds and AllowedFeedVersions IDs.

func PermsForContext added in v1.3.0

func PermsForContext(ctx context.Context) *PermFilter

PermsForContext retrieves the PermFilter from context. Always returns a non-nil PermFilter. If none is set, returns an empty filter.

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

func (*PermFilter) GetIsGlobalAdmin added in v1.3.2

func (pf *PermFilter) GetIsGlobalAdmin() bool

GetIsGlobalAdmin returns true if the user has global admin privileges (unrestricted access).

type PermFinder added in v1.3.0

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

type PermissionRef added in v1.3.3

type PermissionRef struct {
	// Entity type (e.g. tenant, group, feed, feed_version)
	Type string `json:"type"`
	// Entity ID
	ID int `json:"id"`
	// Display name
	Name string `json:"name"`
}

Reference to a related entity in the authorization hierarchy

type PermissionSubject added in v1.3.3

type PermissionSubject struct {
	// Type of subject (e.g. user, tenant, group)
	Type string `json:"type"`
	// Subject identifier
	ID string `json:"id"`
	// Display name
	Name string `json:"name"`
	// Relationship type (e.g. admin, member, viewer, editor, manager)
	Relation string `json:"relation"`
}

A user or group that has been granted access to an entity

type Permissions added in v1.3.3

type Permissions struct {
	// Actions the current user can perform on this entity
	Actions []string `json:"actions"`
	// Users and groups with direct access to this entity
	Subjects []*PermissionSubject `json:"subjects"`
	// Parent entity in the authorization hierarchy
	Parent *PermissionRef `json:"parent,omitempty"`
	// Child entities in the authorization hierarchy
	Children []*PermissionRef `json:"children"`
}

Authorization permissions for an entity

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"`
	// Bounding box of this place, from Natural Earth; null where it has no match
	// there. A country covers every region it contains, so the United States reaches
	// Alaska and Hawaii.
	Bbox      *tt.Geometry `json:"bbox,omitempty"`
	AgencyIDs tt.Ints      `db:"agency_ids"`
}

Place name and associated operators.

See [Concepts: Places](https://www.transit.land/documentation/concepts/places).

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"`
	// Full text search on place names, matching word prefixes. Every word must match the place's own name at the requested level (the city at a city level, the state or province at ADM0_ADM1, the country at ADM0) or the region and country it is in, and at least one must match its own name, so "oakland calif" finds Oakland. Punctuation separates words and one-character words are ignored; a search with no other words does not filter. Places whose own name matches every word come first, then those with the most operators, then by country, region, and city name
	Search *string `json:"search,omitempty"`
}

Search options for associated places

type PlaceGeometrySelect added in v1.4.0

type PlaceGeometrySelect struct {
	Bbox bool
}

PlaceGeometrySelect chooses which geometry columns a place query computes. Each is an aggregate over the Natural Earth tables, so it is only worth paying for when the caller asked for it.

type PointRadius

type PointRadius struct {
	// Latitude
	Lat float64 `json:"lat"`
	// Longitude
	Lon float64 `json:"lon"`
	// Search radius in meters
	Radius float64 `json:"radius"`
}

Search for entities within specified radius of a point

type Query added in v1.3.0

type Query struct {
}

Root Query type.

**Authorization**: Most queries are available to all callers. A few (e.g. user-specific data) require authentication or specific roles.

type RTEntitySelector added in v1.4.0

type RTEntitySelector struct {
	// GTFS `agency_id`
	AgencyID *string `json:"agency_id,omitempty"`
	// GTFS `route_id`
	RouteID *string `json:"route_id,omitempty"`
	// GTFS `route_type`
	RouteType *int `json:"route_type,omitempty"`
	// GTFS direction_id (0 or 1); given together with `route_id`
	DirectionID *int `json:"direction_id,omitempty"`
	// The trip this applies to
	Trip *RTTripDescriptor `json:"trip,omitempty"`
	// GTFS `stop_id`
	StopID *string `json:"stop_id,omitempty"`
}

What a GTFS-RT alert applies to, by GTFS ids within the alert's feed. Every field given must match. See https://gtfs.org/realtime/reference/#message-entityselector

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, int, *pb.TripDescriptor) (*Trip, error)
	FindAlertsForTrip(context.Context, *Trip, *int, *bool) []*Alert
	FindAlertsForStop(context.Context, *Stop, *int, *bool) []*Alert
	FindAlertsForRoute(context.Context, *Route, *int, *bool, bool, bool) []*Alert
	FindAlertsForAgency(context.Context, *Agency, *int, *bool, []int) []*Alert
	FindVehiclePositionsForAgency(context.Context, *Agency, *int, *VehiclePositionFilter) []*VehiclePosition
	FindVehiclePositionsForRoute(context.Context, *Route, *int, *VehiclePositionFilter) []*VehiclePosition
	FindVehiclePositionForTrip(context.Context, *Trip, *VehiclePositionFilter) *VehiclePosition
	GetAddedTripsForStop(context.Context, *Stop) []*pb.TripUpdate
	FindStopTimeUpdate(context.Context, *Trip, *StopTime) (*RTStopTimeUpdate, bool)
	FindStopTimeUpdates(context.Context, *Trip, []*StopTime) []*RTStopTimeUpdate
	// lookup cache methods
	StopTimezone(context.Context, int, string) (*time.Location, bool)
	FeedVersionTimezone(context.Context, int) (*time.Location, bool)
	// GetMessage returns a feed's held payload, whether it's stale, and
	// whether one is held.
	GetMessage(context.Context, string, string) (*pb.FeedMessage, bool, bool)
}

RTFinder manages and looks up RT data

type RTStopTimeUpdate added in v1.3.0

type RTStopTimeUpdate struct {
	TripUpdate *pb.TripUpdate
	// The stop time update naming the stop time, or nil when none does.
	StopTimeUpdate *pb.TripUpdate_StopTimeUpdate
	// Estimated arrival and departure in unix seconds, or 0 for none: from the
	// stop time update's events, or else the delay carried from earlier stops.
	EstimatedArrival   int64
	EstimatedDeparture int64
	// The sources of the estimates, empty for none.
	ArrivalSource   EstimateSource
	DepartureSource EstimateSource
}

RTStopTimeUpdate is the realtime data matched to one stop time of a run.

func (*RTStopTimeUpdate) ArrivalEvent added in v1.4.0

func (u *RTStopTimeUpdate) ArrivalEvent() *pb.TripUpdate_StopTimeEvent

ArrivalEvent returns the stop time update's arrival event, or else its departure event: the event that estimates the arrival.

func (*RTStopTimeUpdate) DepartureEvent added in v1.4.0

func (u *RTStopTimeUpdate) DepartureEvent() *pb.TripUpdate_StopTimeEvent

DepartureEvent returns the stop time update's departure event, or else its arrival event: the event that estimates the departure.

type RTTimeRange added in v1.3.0

type RTTimeRange struct {
	// Start of the range, in Unix epoch seconds
	Start *int `json:"start,omitempty"`
	// End of the range, in Unix epoch seconds
	End *int `json:"end,omitempty"`
}

A time range expressed as Unix epoch seconds; used for GTFS-RT alert active periods. See https://gtfs.org/reference/realtime/v2/#message-timerange

type RTTranslation added in v1.3.0

type RTTranslation struct {
	// Translated text
	Text string `json:"text"`
	// BCP 47 language tag for this translation
	Language *string `json:"language,omitempty"`
}

A single translation of a string in a GTFS-RT message (e.g. an alert header or description). See https://gtfs.org/reference/realtime/v2/#message-translatedstring

type RTTripDescriptor added in v1.3.0

type RTTripDescriptor struct {
	// GTFS `trip_id` identifying the trip
	TripID *string `json:"trip_id,omitempty"`
	// GTFS `route_id` of the trip's route
	RouteID *string `json:"route_id,omitempty"`
	// GTFS direction_id (0 or 1)
	DirectionID *int `json:"direction_id,omitempty"`
	// Scheduled start time of the trip in local time `HH:MM:SS`
	StartTime *tt.Seconds `json:"start_time,omitempty"`
	// Service date on which this trip runs (local time)
	StartDate *tt.Date `json:"start_date,omitempty"`
	// GTFS-RT schedule_relationship value as a string. See https://gtfs.org/realtime/reference/#enum-schedulerelationship-1
	ScheduleRelationship *string `json:"schedule_relationship,omitempty"`
}

Identification of a trip in a GTFS-RT message, used to match the trip back to the static GTFS schedule. See https://gtfs.org/reference/realtime/v2/#message-tripdescriptor

type RTVehicleDescriptor added in v1.3.0

type RTVehicleDescriptor struct {
	// Vehicle ID
	ID *string `json:"id,omitempty"`
	// Vehicle label
	Label *string `json:"label,omitempty"`
	// Vehicle license plate
	LicensePlate *string `json:"license_plate,omitempty"`
}

Identification information for the vehicle running a trip. 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"
	// The day before the current date
	RelativeDateYesterday RelativeDate = "YESTERDAY"
	// The day after the current date
	RelativeDateTomorrow RelativeDate = "TOMORROW"
	// 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 RiderCategory added in v1.4.0

type RiderCategory struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.RiderCategory
}

type Route

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

type RouteAttribute added in v1.3.0

type RouteAttribute struct {
	// Route category code (e.g. service tier such as local, express, rapid)
	Category *int `json:"category,omitempty"`
	// Route subcategory code (further subdivision within `category`)
	Subcategory *int `json:"subcategory,omitempty"`
	// Running-way category code (e.g. dedicated lane, mixed traffic, grade-separated)
	RunningWay *int `json:"running_way,omitempty"`
	RouteID    int  `json:"-"`
}

Extended route metadata from the [MTC GTFS+ extension](https://github.com/MobilityData/gtfs-plus-spec) `route_attributes.txt` file. Values are integer codes defined by the extension; consult that spec for the meaning of each code.

type RouteFilter

type RouteFilter struct {
	// Search for routes with this Onestop ID
	OnestopID *string `json:"onestop_id,omitempty"`
	// Search for routes with these Onestop IDs
	OnestopIds []string `json:"onestop_ids,omitempty"`
	// Include previously used Onestop IDs that match the same (feed,route_id). In currently active feed versions, a requested Onestop ID is looked up among previous ones only when no current route matching the rest of the filter has it
	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 Onestop ID
	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"`
	// If true, restrict to routes with at least one trip; false or null returns all routes
	Serviced *bool `json:"serviced,omitempty"`
	// Full text search
	Search *string `json:"search,omitempty"`
	// Search for routes operated by operators with this Onestop ID
	OperatorOnestopID *string `json:"operator_onestop_id,omitempty"`
	// Search for routes that serve a stop with this Onestop ID
	ServesStopOnestopID *string `json:"serves_stop_onestop_id,omitempty"`
	// Search for routes with these license details
	License *LicenseFilter `json:"license,omitempty"`
	// Search for routes operated by these agencies (database integer IDs)
	AgencyIds []int `json:"agency_ids,omitempty"`
	// Geographic search options
	Location *RouteLocationFilter `json:"location,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"`
}

Search options for routes

type RouteGeometry

type RouteGeometry struct {
	// True if the source feed has no `shapes.txt` and this geometry was generated from straight lines between stop points
	Generated bool `json:"generated"`
	// Single LineString representing the most common shape for this route
	Geometry *tt.LineString `json:"geometry,omitempty"`
	// MultiLineString ensemble combining the most common shape for each direction
	CombinedGeometry *tt.Geometry `json:"combined_geometry,omitempty"`
	// Length of the `geometry` LineString, in meters
	Length *float64 `json:"length,omitempty"`
	// Maximum distance between consecutive points in the geometry, in meters; useful for flagging shapes with large gaps
	MaxSegmentLength *float64 `json:"max_segment_length,omitempty"`
	// Maximum distance from the first point of the geometry to any other point, in meters; small values indicate a loop route
	FirstPointMaxDistance *float64 `json:"first_point_max_distance,omitempty"`
	RouteID               int      `json:"-"`
}

Representative geometry for a route, derived from GTFS shapes (or stop coordinates as a fallback) and ranked by trip frequency.

type RouteHeadway

type RouteHeadway struct {
	// Representative 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"`
	// GTFS direction_id (0 or 1)
	DirectionID *int `json:"direction_id,omitempty"`
	// Typical seconds between departures at this stop, direction, and day-of-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"`
	// 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 typical service frequency at a representative stop, broken down by day-of-week category and direction.

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

Geographic search options for routes

type RouteNetwork added in v1.4.0

type RouteNetwork struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.RouteNetwork
}

type RouteStop

type RouteStop struct {
	// Internal integer ID
	ID int `json:"id"`
	// Database integer ID of the stop
	StopID int `json:"stop_id"`
	// Database integer ID of the route
	RouteID int `json:"route_id"`
	// Database integer ID of the agency
	AgencyID int `json:"agency_id"`
	// Associated route
	Route *Route `json:"route"`
	// Associated stop
	Stop *Stop `json:"stop"`
	// Associated agency
	Agency *Agency `json:"agency"`
}

Association between a stop, the route that serves it, and the operating agency. Provides the route and agency context alongside each stop on a route.

type RouteStopBuffer

type RouteStopBuffer struct {
	// Buffer polygon constructed by unioning circles of the requested radius around each stop
	StopBuffer *tt.Geometry `json:"stop_buffer,omitempty"`
	// MultiPoint of the route's stop locations used to build the buffer
	StopPoints *tt.Geometry `json:"stop_points,omitempty"`
	// Convex hull of the route's stop locations
	StopConvexhull *tt.Polygon `json:"stop_convexhull,omitempty"`
}

Spatial buffer derived from the stops served by a route, using the requested radius (in meters)

type RouteStopPattern added in v1.3.0

type RouteStopPattern struct {
	// Identifier for this stop pattern; an integer scoped to a single feed version
	StopPatternID int `json:"stop_pattern_id"`
	// GTFS direction_id (0 or 1) of the trips using this pattern
	DirectionID int `json:"direction_id"`
	// Number of trips that operate this stop pattern
	Count int `json:"count"`
	// The service date given to `Route.patterns`, on which the trips are counted. Null when it was given no date, or a `relative_date` the feed version has no service window to resolve
	ServiceDate *tt.Date `json:"service_date,omitempty"`
	// One trip that follows this stop pattern, for reading the stop sequence without fetching every trip. Every trip sharing a stop pattern visits the same stops in the same order, so any of them describes the pattern; this is the lowest-numbered, scoped to the queried service date when `Route.patterns` was given one.
	//
	// Times, headsigns and `timepoint` flags are properties of the trip and can differ between trips of the same pattern — only the stop sequence is guaranteed common. It carries no GTFS-RT data.
	RepresentativeTrip *Trip `json:"representative_trip,omitempty"`
	// Trips that follow this stop pattern, only those counted on `service_date` when it is set; useful for fetching full stop_times. Without a `service_date`, they carry no GTFS-RT data
	Trips []*Trip `json:"trips,omitempty"`
	// The trips `count` counted on `service_date`, as a timetable: grids of their stop times by stop and trip. Scheduled times from the static GTFS feed only; realtime updates are not merged in. Null when `Route.patterns` was given no date, or when the pattern's trips are all flex service, which runs to locations or within time windows rather than at set times.
	Timetable            *RouteStopPatternTimetable `json:"timetable,omitempty"`
	FeedVersionID        int                        `json:"-"`
	RepresentativeTripID int                        `json:"-"`
	RouteID              int                        `json:"-"`
	// The trips counted, when Route.patterns was given a date; unset without one.
	TripIDs tt.Ints `db:"trip_ids"`
}

A unique sequence of stops served by trips on a route, in a single direction. Multiple trips may share the same RouteStopPattern.

type RouteStopPatternFilter added in v1.4.0

type RouteStopPatternFilter struct {
	// GTFS service date. Restricts the patterns returned to those a trip operates on that date, counts them over that date alone, and picks `representative_trip` from it. Ignored if `relative_date` is set
	ServiceDate *tt.Date `json:"service_date,omitempty"`
	// GTFS service date relative to today in the feed version's timezone; see `RelativeDate`. Takes precedence over `service_date`
	RelativeDate *RelativeDate `json:"relative_date,omitempty"`
	// If true and the requested date falls outside the feed version's normal service window, use the feed version's `fallback_week` instead
	UseServiceWindow *bool `json:"use_service_window,omitempty"`
}

Search options for a route's stop patterns

type RouteStopPatternTimetable added in v1.4.0

type RouteStopPatternTimetable struct {
	StopIds        []int
	Trips          []*Trip
	DepartureTimes *RouteStopPatternTimetableTimeGrid
	ArrivalTimes   *RouteStopPatternTimetableTimeGrid
	PickupTypes    *RouteStopPatternTimetableGrid
	DropOffTypes   *RouteStopPatternTimetableGrid
	Timepoints     *RouteStopPatternTimetableGrid
}

RouteStopPatternTimetable is a stop pattern's trips as grids by stop and trip.

type RouteStopPatternTimetableGrid added in v1.4.0

type RouteStopPatternTimetableGrid struct {
	Values [][]tt.Int
}

RouteStopPatternTimetableGrid is one of a timetable's grids of numbers, by stop and trip.

type RouteStopPatternTimetableTimeGrid added in v1.4.0

type RouteStopPatternTimetableTimeGrid struct {
	Values [][]tt.Seconds
}

RouteStopPatternTimetableTimeGrid is one of a timetable's grids of times, by stop and trip.

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 (
	// Trip or stop is following the normal schedule with real-time updates applied
	ScheduleRelationshipScheduled ScheduleRelationship = "SCHEDULED"
	// Extra trip that was added in addition to a running schedule (no static counterpart)
	ScheduleRelationshipAdded ScheduleRelationship = "ADDED"
	// Trip is running with no associated static schedule (e.g. unscheduled or on-demand service)
	ScheduleRelationshipUnscheduled ScheduleRelationship = "UNSCHEDULED"
	// Trip has been canceled
	ScheduleRelationshipCanceled ScheduleRelationship = "CANCELED"
	// No GTFS-RT data matched; only the static schedule applies (Transitland-specific, not in the GTFS-RT spec)
	ScheduleRelationshipStatic ScheduleRelationship = "STATIC"
	// Stop is skipped on this trip; the trip itself runs as scheduled
	ScheduleRelationshipSkipped ScheduleRelationship = "SKIPPED"
	// No real-time data is available for this stop; arrival/departure times are unknown
	ScheduleRelationshipNoData ScheduleRelationship = "NO_DATA"
	// Deprecated GTFS-RT value: this trip replaces a different scheduled trip
	ScheduleRelationshipReplacement ScheduleRelationship = "REPLACEMENT"
	// A trip created at runtime from a static schedule trip (e.g. an extra run of a regularly scheduled trip)
	ScheduleRelationshipDuplicated ScheduleRelationship = "DUPLICATED"
	// Trip should be removed; clients that previously received it should drop it
	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 the segment was matched to an OpenStreetMap way (0 if unmatched)
	WayID int `json:"way_id"`
	// Path geometry for this segment as a LineString
	Geometry tt.LineString `json:"geometry"`
	// Pattern associations for this segment, each linking it to a route and stop pattern
	SegmentPatterns []*SegmentPattern `json:"segment_patterns,omitempty"`
	FeedVersionID   int               `json:"-"`
	WithRouteID     int               `json:"-"`
}

A normalized, reusable piece of route geometry, optionally aligned with an OpenStreetMap way. Multiple route patterns may reference the same Segment.

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 this segment pattern belongs to
	Route *Route `json:"route"`
	// Stop pattern ID this segment belongs to; scoped to the feed version
	StopPatternID int `json:"stop_pattern_id"`
	// GTFS direction_id (0 or 1) of trips using this pattern
	DirectionID int `json:"direction_id"`
	// Position of this segment within the full path of the pattern (0-indexed)
	SequenceIdx int `json:"sequence_idx"`
	// Internal integer ID of the source shape
	ShapeID int `json:"shape_id"`
	// OSM Way ID, if the segment was matched to an OpenStreetMap way
	WayID *int `json:"way_id,omitempty"`
	// Shape this segment was derived from
	Shape *Shape `json:"shape"`
	// Normalized segment associated with this pattern
	Segment   *Segment `json:"segment"`
	RouteID   int      `json:"-"`
	SegmentID int      `json:"-"`
}

Association linking a route's stop pattern to a single normalized segment within its full path. Used to assemble route geometries from reusable segment pieces.

type SegmentPatternFilter added in v1.3.0

type SegmentPatternFilter struct {
	// Search for segment 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"`
	// Lower bound on the feed's `feed_info.feed_start_date`
	FeedStartDate *tt.Date `json:"feed_start_date,omitempty"`
	// Upper bound on the feed's `feed_info.feed_end_date`
	FeedEndDate *tt.Date `json:"feed_end_date,omitempty"`
	// Lower bound, evaluated against `feed_info.feed_start_date` or calculated earliest calendar date
	StartDate *tt.Date `json:"start_date,omitempty"`
	// Upper bound, evaluated against `feed_info.feed_end_date` or calculated latest calendar date
	EndDate *tt.Date `json:"end_date,omitempty"`
	// Lower bound on the calculated earliest calendar service date
	EarliestCalendarDate *tt.Date `json:"earliest_calendar_date,omitempty"`
	// Upper bound on the calculated latest calendar service date
	LatestCalendarDate *tt.Date `json:"latest_calendar_date,omitempty"`
}

Search options for feed version date range coverage

type ServiceWindow added in v1.3.0

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

type Shape

type Shape struct {
	service.ShapeLine
}

type ShapeFilter added in v1.4.0

type ShapeFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
	// Search for a shape with this GTFS shape_id
	ShapeID *string `json:"shape_id,omitempty"`
	// Search for shapes used by a trip on a route of this GTFS route_type
	RouteType *int `json:"route_type,omitempty"`
}

Search options for shapes

type Step added in v1.3.0

type Step struct {
	// Duration of this step
	Duration *Duration `json:"duration"`
	// Distance of this step
	Distance *Distance `json:"distance"`
	// Start time of this step
	StartTime time.Time `json:"start_time"`
	// End time of this step
	EndTime time.Time `json:"end_time"`
	// Destination waypoint of this step
	To *Waypoint `json:"to,omitempty"`
	// Travel mode for this step
	Mode StepMode `json:"mode"`
	// Human-readable navigation instruction (e.g. `Turn left on Main St`); may be empty depending on the routing provider
	Instruction string `json:"instruction"`
	// Offset into the parent leg geometry where this step begins
	GeometryOffset int `json:"geometry_offset"`
}

A single turn-by-turn navigation instruction within a walking or cycling leg.

type StepMode added in v1.3.0

type StepMode string

Travel mode for a routing leg or step.

const (
	// On foot
	StepModeWalk StepMode = "WALK"
	// Private vehicle (car)
	StepModeAuto StepMode = "AUTO"
	// Bicycle
	StepModeBicycle StepMode = "BICYCLE"
	// Public transit vehicle
	StepModeTransit StepMode = "TRANSIT"
	// Straight-line connection (e.g. for display purposes)
	StepModeLine StepMode = "LINE"
)

func (StepMode) IsValid added in v1.3.0

func (e StepMode) IsValid() bool

func (StepMode) MarshalGQL added in v1.3.0

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

func (StepMode) MarshalJSON added in v1.3.0

func (e StepMode) MarshalJSON() ([]byte, error)

func (StepMode) String added in v1.3.0

func (e StepMode) String() string

func (*StepMode) UnmarshalGQL added in v1.3.0

func (e *StepMode) UnmarshalGQL(v any) error

func (*StepMode) UnmarshalJSON added in v1.3.0

func (e *StepMode) UnmarshalJSON(b []byte) error

type Stop

type Stop struct {
	FeedOnestopID       string
	FeedVersionSHA1     string
	OnestopID           *string
	SearchRank          *string
	WithinFeatures      tt.Strings
	WithRouteID         tt.Int
	WithAgencyID        tt.Int
	WithLocationGroupID tt.Int // internal: grouping key set by StopsByLocationGroupIDs
	gtfs.Stop
}

type StopArea added in v1.4.0

type StopArea struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.StopArea
}

type StopAreaFilter added in v1.4.0

type StopAreaFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
}

Search options for stop areas

type StopBuffer added in v1.3.0

type StopBuffer struct {
	// Stop integer IDs to buffer around
	StopIds []int `json:"stop_ids,omitempty"`
	// Buffer radius in meters around each stop
	Radius *float64 `json:"radius,omitempty"`
	// Search the part of the query area outside the buffers, rather than inside them. Requires a query area and a positive `radius`
	Exclude *bool `json:"exclude,omitempty"`
}

A buffer around a set of stops. A census geography search matches the geographies that intersect any stop's buffer. With `exclude`, the search area is instead the part of the query area outside every buffer.

type StopExternalReference added in v1.3.0

type StopExternalReference struct {
	dmfr.StopExternalReference
}

type StopExternalReferenceSetInput added in v1.3.0

type StopExternalReferenceSetInput struct {
	// Onestop ID of the target stop's feed
	TargetFeedOnestopID *string `json:"target_feed_onestop_id,omitempty"`
	// GTFS `stop_id` of the target stop within that feed
	TargetStopID *string `json:"target_stop_id,omitempty"`
}

Set or update a cross-feed stop reference linking this stop to a stop in another feed

type StopFilter

type StopFilter struct {
	// Search for stops with this Onestop ID
	OnestopID *string `json:"onestop_id,omitempty"`
	// Search for stops with these Onestop IDs
	OnestopIds []string `json:"onestop_ids,omitempty"`
	// Include previously used Onestop IDs that match the same (feed, stop_id). In currently active feed versions, a requested Onestop ID is looked up among previous ones only when no current stop matching the rest of the filter has it
	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 Onestop ID
	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"`
	// If true, restrict to stops served by at least one trip; if false, to stops served by none
	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 served by routes or operators with any of these Onestop IDs
	ServedByOnestopIds []string `json:"served_by_onestop_ids,omitempty"`
	// Search for stops served by routes with the specified GTFS route_type
	ServedByRouteType *int `json:"served_by_route_type,omitempty"`
	// Search for stops served by routes with any of the specified GTFS route_types
	ServedByRouteTypes []int `json:"served_by_route_types,omitempty"`
	// Search for stops served by these agencies (database integer IDs)
	AgencyIds []int `json:"agency_ids,omitempty"`
	// Geographic search options
	Location *StopLocationFilter `json:"location,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"`
}

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 for stops contained in any of the given features; matching feature `id`s are echoed back via `Stop.within_features`
	Features []*Feature `json:"features,omitempty"`
	// Search for stops within specified radius of a point
	Near *PointRadius `json:"near,omitempty"`
	// Search for stops within any of the given `CensusGeography` integer IDs
	GeographyIds []*int `json:"geography_ids,omitempty"`
	// Focus search on this point; results will be sorted by distance
	Focus *FocusPoint `json:"focus,omitempty"`
}

Geographic search options for stops

type StopObservation added in v1.3.0

type StopObservation struct {
	// GTFS-RT TripUpdate schedule_relationship value (string form: e.g. `SCHEDULED`, `ADDED`, `CANCELED`)
	ScheduleRelationship *string `json:"schedule_relationship,omitempty"`
	// GTFS-RT TripDescriptor.start_date for the observed trip
	TripStartDate *tt.Date `json:"trip_start_date,omitempty"`
	// GTFS-RT TripDescriptor.start_time for the observed trip
	TripStartTime *tt.Seconds `json:"trip_start_time,omitempty"`
	// GTFS stop_id of the previous stop in the trip (origin of the observed segment)
	FromStopID *string `json:"from_stop_id,omitempty"`
	// GTFS stop_id of this stop (destination of the observed segment)
	ToStopID *string `json:"to_stop_id,omitempty"`
	// GTFS agency_id of the agency operating the trip's route
	AgencyID *string `json:"agency_id,omitempty"`
	// GTFS route_id of the trip's route
	RouteID *string `json:"route_id,omitempty"`
	// GTFS trip_id of the observed trip
	TripID *string `json:"trip_id,omitempty"`
	// GTFS stop_times.stop_sequence value for the from_stop
	StopSequence *int `json:"stop_sequence,omitempty"`
	// GTFS-RT message used to derive this observation: `TripUpdate` or `VehiclePosition`
	Source *string `json:"source,omitempty"`
	// Scheduled arrival time at to_stop, from GTFS static `stop_times`
	ScheduledArrivalTime *tt.Seconds `json:"scheduled_arrival_time,omitempty"`
	// Scheduled departure time at to_stop, from GTFS static `stop_times`
	ScheduledDepartureTime *tt.Seconds `json:"scheduled_departure_time,omitempty"`
	// Observed arrival time at to_stop, derived from GTFS-RT
	ObservedArrivalTime *tt.Seconds `json:"observed_arrival_time,omitempty"`
	// Observed departure time at to_stop, derived from GTFS-RT
	ObservedDepartureTime *tt.Seconds `json:"observed_departure_time,omitempty"`
	StopID                int         `json:"-"`
}

An archived real-time arrival/departure measurement at a stop, derived from GTFS-RT TripUpdate or VehiclePosition data. Compare `scheduled_arrival_time`/`scheduled_departure_time` against `observed_arrival_time`/`observed_departure_time` for on-time performance analysis.

type StopObservationFilter added in v1.3.0

type StopObservationFilter struct {
	// Data source to filter by; typically `TripUpdate` or `VehiclePosition`
	Source string `json:"source"`
	// Feed version integer ID to filter by
	FeedVersionID int `json:"feed_version_id"`
	// Trip start date to filter by
	TripStartDate tt.Date `json:"trip_start_date"`
}

Filters for querying archived stop observations. All three fields are required.

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-matched country ISO code
	Adm0Iso *string `json:"adm0_iso,omitempty"`
}

Place associated with a stop.

type StopPlaceParam added in v1.3.0

type StopPlaceParam struct {
	ID    int
	Point tlxy.Point
}

type StopSetInput added in v1.3.0

type StopSetInput struct {
	// Integer ID of the stop to update; omit when creating a new stop
	ID *int `json:"id,omitempty"`
	// Feed version this stop belongs to (required when creating a new stop)
	FeedVersion *FeedVersionInput `json:"feed_version,omitempty"`
	// Set GTFS location_type
	LocationType *int `json:"location_type,omitempty"`
	// Set GTFS stop_code
	StopCode *string `json:"stop_code,omitempty"`
	// Set GTFS stop_desc
	StopDesc *string `json:"stop_desc,omitempty"`
	// Set GTFS stop_id
	StopID *string `json:"stop_id,omitempty"`
	// Set GTFS stop_name
	StopName *string `json:"stop_name,omitempty"`
	// Set GTFS stop_timezone
	StopTimezone *string `json:"stop_timezone,omitempty"`
	// Set GTFS stop_url
	StopURL *string `json:"stop_url,omitempty"`
	// Set GTFS wheelchair_boarding
	WheelchairBoarding *int `json:"wheelchair_boarding,omitempty"`
	// Set GTFS zone_id
	ZoneID *string `json:"zone_id,omitempty"`
	// Set GTFS platform_code
	PlatformCode *string `json:"platform_code,omitempty"`
	// Set GTFS tts_stop_name
	TtsStopName *string `json:"tts_stop_name,omitempty"`
	// Set GTFS stop_access
	StopAccess *int `json:"stop_access,omitempty"`
	// Set stop geometry
	Geometry *tt.Point `json:"geometry,omitempty"`
	// Reference to an existing parent station; only the `id` is used (the parent must already exist)
	Parent *StopSetInput `json:"parent,omitempty"`
	// Reference to an existing level; only the `id` is used (the level must already exist)
	Level *LevelSetInput `json:"level,omitempty"`
	// Set or update the cross-feed external reference for this stop
	ExternalReference *StopExternalReferenceSetInput `json:"external_reference,omitempty"`
}

Create or update a stop entity. For updates, supply `id`. For creation, supply `feed_version`

type StopTime

type StopTime struct {
	ServiceDate      tt.Date
	Date             tt.Date
	GtfsTripID       string            // internal: the trip's GTFS trip_id, for matching realtime
	RunStart         tt.Seconds        `db:"run_start"`  // internal: the start of the run, for an instance of a frequency-based trip
	RunOffset        tt.Int            `db:"run_offset"` // internal: the seconds the run's times are shifted from the trip's stop times, for such an instance
	RTTrip           *Trip             // internal: the trip of a stop time added in real time
	RTStopTimeUpdate *RTStopTimeUpdate // internal
	gtfs.StopTime
}

func (*StopTime) SetServiceDate added in v1.4.0

func (st *StopTime) SetServiceDate(d tt.Date)

SetServiceDate sets a stop time's service date and its calendar date, which is the next day for a time past midnight.

type StopTimeEvent added in v1.3.0

type StopTimeEvent struct {
	// IANA timezone name for this stop, used to interpret the `*_local` fields
	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 derived from the trip's overall delay. Values at or beyond ±86,400 seconds (24 hours) are treated as erroneous and returned as null.
	EstimatedDelay *int `json:"estimated_delay,omitempty"`
	// Estimated time HH:MM:SS, as a time of the service day like `scheduled`; a clock time in the stop's timezone without a schedule
	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"`
	// Scheduled 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"`
	// Time in UTC sourced directly from a matching GTFS-RT StopTimeUpdate (no fallback)
	TimeUtc *time.Time `json:"time_utc,omitempty"`
	// Time in Unix epoch seconds sourced directly from a matching GTFS-RT StopTimeUpdate (no fallback)
	TimeUnix *int `json:"time_unix,omitempty"`
	// Schedule delay in seconds from a matching GTFS-RT StopTimeUpdate, passed through as-is; see `estimated_delay` for the inferred-fallback variant
	Delay *int `json:"delay,omitempty"`
	// Estimation uncertainty in seconds from a matching GTFS-RT StopTimeUpdate, passed through as-is
	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-stoptimeevent.

type StopTimeFilter

type StopTimeFilter struct {
	// Calendar date for which to return stop times
	Date *tt.Date `json:"date,omitempty"`
	// Calendar date relative to today in the feed version's timezone (e.g. `MONDAY`, `NEXT_FRIDAY`); see `RelativeDate` for semantics
	RelativeDate *RelativeDate `json:"relative_date,omitempty"`
	// GTFS service date (which may differ from the calendar date for trips that cross midnight)
	ServiceDate *tt.Date `json:"service_date,omitempty"`
	// If true and the requested date falls outside the feed version's normal service window, use the feed version's `fallback_week` instead; stop times still report the requested date
	UseServiceWindow *bool `json:"use_service_window,omitempty"`
	// Lower bound for departure time, in seconds since midnight
	StartTime *int `json:"start_time,omitempty"`
	// Upper bound for arrival time, in seconds since midnight
	EndTime *int `json:"end_time,omitempty"`
	// Lower bound for departure time, in local `HH:MM:SS`
	Start *tt.Seconds `json:"start,omitempty"`
	// Upper bound for arrival time, in local `HH:MM:SS`
	End *tt.Seconds `json:"end,omitempty"`
	// Return stop times with departures within the next N seconds from now (local time)
	Next *int `json:"next,omitempty"`
	// Restrict to stop times on routes matching any of these Onestop IDs
	RouteOnestopIds []string `json:"route_onestop_ids,omitempty"`
	// Include previously used route Onestop IDs that map to the same (feed, route_id)
	AllowPreviousRouteOnestopIds *bool `json:"allow_previous_route_onestop_ids,omitempty"`
	// Exclude the first stop_time of each trip
	ExcludeFirst *bool `json:"exclude_first,omitempty"`
	// Exclude the last stop_time of each trip
	ExcludeLast *bool `json:"exclude_last,omitempty"`
}

Search options for stop times, optionally on a given date

type Tenant added in v1.3.3

type Tenant struct {
	// Internal integer ID
	ID int `json:"id"`
	// Tenant name
	Name string `json:"name"`
	// Groups owned by this tenant
	Groups []*Group `json:"groups"`
	// Authorization permissions for this tenant
	Permissions *Permissions `json:"permissions,omitempty"`
}

A tenant organization that owns groups and feeds

type Timeframe added in v1.4.0

type Timeframe struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.Timeframe
}

type Transfer added in v1.4.0

type Transfer struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.Transfer
}

Transfer is a transfers.txt record.

type TransferFilter added in v1.4.0

type TransferFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
	// Search for transfers with this GTFS transfer_type
	TransferType *int `json:"transfer_type,omitempty"`
}

Search options for transfers

type Translation added in v1.4.0

type Translation struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	gtfs.Translation
}

Translation is a translations.txt record.

func (*Translation) TranslationValue added in v1.4.0

func (t *Translation) TranslationValue() tt.String

TranslationValue returns the translations.translation column, which the embedded gtfs.Translation shadows.

type TranslationFilter added in v1.4.0

type TranslationFilter struct {
	// Restrict to specific ids
	Ids []int `json:"ids,omitempty"`
	// Search for translations of fields in this file, without its `.txt` extension (e.g. `stops`)
	TableName *string `json:"table_name,omitempty"`
	// Search for translations of this field (e.g. `stop_name`)
	FieldName *string `json:"field_name,omitempty"`
	// Search for translations into this language, ignoring case
	Language *string `json:"language,omitempty"`
	// Search for translations with this `record_id`; this excludes translations that select values by `field_value`
	RecordID *string `json:"record_id,omitempty"`
}

Search options for translations

type Trip

type Trip struct {
	// internal: set on a trip added in real time, which MakeTrip builds.
	AddedInRealtime bool
	// internal: the service dates of the requested runs, as given rather than
	// relocated into a fallback week. Realtime data is matched to these runs;
	// with none, to the trip's current run.
	RunDates []tt.Date
	// internal: the start of the requested run of a frequency-based trip, in
	// seconds into its service day, which realtime data naming a start_time
	// has to match, and the seconds the run's times are shifted from the
	// trip's stop times. Both invalid for any other run.
	RunStart  tt.Seconds
	RunOffset tt.Int
	// internal: set for a trip that stands for no run, such as a pattern's
	// representative trip, which realtime data never matches.
	NoRealtime bool
	// Every service date matched by a dates or service_dates query. Under
	// `dates` this reaches one day before the earliest requested date.
	ServiceDates []*tt.Date
	// Wire format for ServiceDates: one comma-separated column.
	ServiceDatesAgg tt.String `db:"service_dates_agg"`
	gtfs.Trip
}

type TripFilter

type TripFilter struct {
	// GTFS service date on which trips run. Lowest precedence: ignored if `dates`, `service_dates` or `relative_date` is set
	ServiceDate *tt.Date `json:"service_date,omitempty"`
	// Several GTFS service dates, which need not be contiguous. Returns each trip once, with the matching dates in `Trip.service_dates`, rather than requiring one query per date. Dates are matched exactly as given: unlike `dates`, no neighbouring service date is brought in for after-midnight departures. Ignored if `dates` is set.
	ServiceDates []*tt.Date `json:"service_dates,omitempty"`
	// Several wall calendar dates, which need not be contiguous. Unlike `service_dates`, a trip departing after midnight is matched for the calendar date it departs on, so each requested date also matches the service date before it — and `Trip.service_dates` can therefore name a day earlier than any requested here. Departures more than 48 hours into their service date are not reached. Takes precedence over `service_date`, `service_dates` and `relative_date`.
	Dates []*tt.Date `json:"dates,omitempty"`
	// GTFS service date relative to today in the feed version's timezone; see `RelativeDate`. Ignored if `dates` or `service_dates` is set. Not applied by the top-level `trips` query; use `Route.trips`, `FeedVersion.trips` or `Shape.trips`
	RelativeDate *RelativeDate `json:"relative_date,omitempty"`
	// If true and the requested date falls outside the feed version's normal service window, use the feed version's `fallback_week` instead. Not applied by the top-level `trips` query; use `Route.trips`, `FeedVersion.trips` or `Shape.trips`
	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 (scoped to feed version)
	StopPatternID *int `json:"stop_pattern_id,omitempty"`
	// Search for trips with these license details
	License *LicenseFilter `json:"license,omitempty"`
	// Search for trips on these routes (database integer IDs)
	RouteIds []int `json:"route_ids,omitempty"`
	// Search for trips on routes matching any of these Onestop IDs
	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 Onestop ID
	FeedOnestopID *string `json:"feed_onestop_id,omitempty"`
}

Search options for trips

type TripStopTimeFilter added in v1.3.0

type TripStopTimeFilter struct {
	// Lower bound for departure time, in local `HH:MM:SS`
	Start *tt.Seconds `json:"start,omitempty"`
	// Upper bound for arrival time, in local `HH:MM:SS`
	End *tt.Seconds `json:"end,omitempty"`
	// Restrict to stop times at these stops (database integer IDs)
	StopIds []int `json:"stop_ids,omitempty"`
}

Search options for stop times within a single trip (no date filter applies, since the parent trip determines the schedule)

type UnimplementedFinder added in v1.4.0

type UnimplementedFinder struct{}

UnimplementedFinder implements the full Finder interface with stubs that return ErrNotImplemented (or empty results). Embed it in a partial Finder implementation — e.g. an in-memory or test finder — and override only the methods you support; the rest satisfy the interface without boilerplate.

func (UnimplementedFinder) AgenciesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) AgenciesByFeedVersionIDs(context.Context, *int, *AgencyFilter, []int) ([][]*Agency, error)

func (UnimplementedFinder) AgenciesByIDs added in v1.4.0

func (UnimplementedFinder) AgenciesByIDs(_ context.Context, ids []int) ([]*Agency, []error)

func (UnimplementedFinder) AgenciesByOnestopIDs added in v1.4.0

func (UnimplementedFinder) AgenciesByOnestopIDs(context.Context, *int, *AgencyFilter, []string) ([][]*Agency, error)

func (UnimplementedFinder) AgencyPlacesByAgencyIDs added in v1.4.0

func (UnimplementedFinder) AgencyPlacesByAgencyIDs(context.Context, *int, *AgencyPlaceFilter, []int) ([][]*AgencyPlace, error)

func (UnimplementedFinder) AreasByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) AreasByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*Area, error)

func (UnimplementedFinder) AreasByIDs added in v1.4.0

func (UnimplementedFinder) AreasByIDs(_ context.Context, ids []int) ([]*Area, []error)

func (UnimplementedFinder) AreasByStopIDs added in v1.4.0

func (UnimplementedFinder) AreasByStopIDs(context.Context, *int, []int) ([][]*Area, error)

func (UnimplementedFinder) AttributionsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) AttributionsByFeedVersionIDs(context.Context, *int, *Cursor, *AttributionFilter, []int) ([][]*Attribution, error)

func (UnimplementedFinder) BookingRulesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) BookingRulesByFeedVersionIDs(context.Context, *int, *BookingRuleFilter, []int) ([][]*BookingRule, error)

func (UnimplementedFinder) BookingRulesByIDs added in v1.4.0

func (UnimplementedFinder) BookingRulesByIDs(_ context.Context, ids []int) ([]*BookingRule, []error)

func (UnimplementedFinder) CalendarDatesByServiceIDs added in v1.4.0

func (UnimplementedFinder) CalendarDatesByServiceIDs(context.Context, *int, *CalendarDateFilter, []int) ([][]*CalendarDate, error)

func (UnimplementedFinder) CalendarsByIDs added in v1.4.0

func (UnimplementedFinder) CalendarsByIDs(_ context.Context, ids []int) ([]*Calendar, []error)

func (UnimplementedFinder) CensusDatasetLayersByDatasetIDs added in v1.4.0

func (UnimplementedFinder) CensusDatasetLayersByDatasetIDs(_ context.Context, ids []int) ([][]*CensusLayer, []error)

func (UnimplementedFinder) CensusFieldsByTableIDs added in v1.4.0

func (UnimplementedFinder) CensusFieldsByTableIDs(context.Context, *int, []int) ([][]*CensusField, error)

func (UnimplementedFinder) CensusGeographiesByDatasetIDs added in v1.4.0

func (UnimplementedFinder) CensusGeographiesByEntityIDs added in v1.4.0

func (UnimplementedFinder) CensusGeographiesByLayerIDs added in v1.4.0

func (UnimplementedFinder) CensusGeographiesBySourceIDs added in v1.4.0

func (UnimplementedFinder) CensusLayersByIDs added in v1.4.0

func (UnimplementedFinder) CensusLayersByIDs(_ context.Context, ids []int) ([]*CensusLayer, []error)

func (UnimplementedFinder) CensusSourceLayersBySourceIDs added in v1.4.0

func (UnimplementedFinder) CensusSourceLayersBySourceIDs(_ context.Context, ids []int) ([][]*CensusLayer, []error)

func (UnimplementedFinder) CensusSourcesByDatasetIDs added in v1.4.0

func (UnimplementedFinder) CensusSourcesByDatasetIDs(context.Context, *int, *CensusSourceFilter, []int) ([][]*CensusSource, error)

func (UnimplementedFinder) CensusSourcesByIDs added in v1.4.0

func (UnimplementedFinder) CensusSourcesByIDs(_ context.Context, ids []int) ([]*CensusSource, []error)

func (UnimplementedFinder) CensusTableByIDs added in v1.4.0

func (UnimplementedFinder) CensusTableByIDs(_ context.Context, ids []int) ([]*CensusTable, []error)

func (UnimplementedFinder) CensusTablesByDatasetIDs added in v1.4.0

func (UnimplementedFinder) CensusTablesByDatasetIDs(context.Context, *int, *CensusTableFilter, []int) ([][]*CensusTable, error)

func (UnimplementedFinder) CensusTablesBySourceIDs added in v1.4.0

func (UnimplementedFinder) CensusTablesBySourceIDs(context.Context, *int, *CensusTableFilter, []int) ([][]*CensusTable, error)

func (UnimplementedFinder) CensusValuesByGeographyIDs added in v1.4.0

func (UnimplementedFinder) CensusValuesByGeographyIDs(context.Context, *int, string, []string, []string) ([][]*CensusValue, error)

func (UnimplementedFinder) FareAttributesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FareAttributesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareAttribute, error)

GTFS Fares v1 and v2

func (UnimplementedFinder) FareAttributesByIDs added in v1.4.0

func (UnimplementedFinder) FareAttributesByIDs(_ context.Context, ids []int) ([]*FareAttribute, []error)

func (UnimplementedFinder) FareLegJoinRulesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FareLegJoinRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareLegJoinRule, error)

func (UnimplementedFinder) FareLegRulesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FareLegRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareLegRule, error)

func (UnimplementedFinder) FareLegRulesByFeedVersionLegGroupIDs added in v1.4.0

func (UnimplementedFinder) FareLegRulesByFeedVersionLegGroupIDs(_ context.Context, keys []FVEntityID) ([][]*FareLegRule, []error)

func (UnimplementedFinder) FareMediaByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FareMediaByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareMedia, error)

func (UnimplementedFinder) FareMediaByIDs added in v1.4.0

func (UnimplementedFinder) FareMediaByIDs(_ context.Context, ids []int) ([]*FareMedia, []error)

func (UnimplementedFinder) FareProductsByFeedVersionFareProductIDs added in v1.4.0

func (UnimplementedFinder) FareProductsByFeedVersionFareProductIDs(_ context.Context, keys []FVEntityID) ([][]*FareProduct, []error)

func (UnimplementedFinder) FareProductsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FareProductsByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareProduct, error)

func (UnimplementedFinder) FareRulesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FareRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareRule, error)

func (UnimplementedFinder) FareTransferRulesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FareTransferRulesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*FareTransferRule, error)

func (UnimplementedFinder) FeedFetchesByFeedIDs added in v1.4.0

func (UnimplementedFinder) FeedFetchesByFeedIDs(context.Context, *int, *FeedFetchFilter, []int) ([][]*FeedFetch, error)

func (UnimplementedFinder) FeedInfosByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FeedInfosByFeedVersionIDs(context.Context, *int, []int) ([][]*FeedInfo, error)

func (UnimplementedFinder) FeedStatesByFeedIDs added in v1.4.0

func (UnimplementedFinder) FeedStatesByFeedIDs(_ context.Context, ids []int) ([]*FeedState, []error)

func (UnimplementedFinder) FeedVersionFileInfosByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FeedVersionFileInfosByFeedVersionIDs(context.Context, *int, []int) ([][]*FeedVersionFileInfo, error)

func (UnimplementedFinder) FeedVersionGeometryByIDs added in v1.4.0

func (UnimplementedFinder) FeedVersionGeometryByIDs(_ context.Context, ids []int) ([]*tt.Polygon, []error)

func (UnimplementedFinder) FeedVersionGtfsImportByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FeedVersionGtfsImportByFeedVersionIDs(_ context.Context, ids []int) ([]*FeedVersionGtfsImport, []error)

func (UnimplementedFinder) FeedVersionServiceLevelsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FeedVersionServiceLevelsByFeedVersionIDs(context.Context, *int, *FeedVersionServiceLevelFilter, []int) ([][]*FeedVersionServiceLevel, error)

func (UnimplementedFinder) FeedVersionServiceWindowByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FeedVersionServiceWindowByFeedVersionIDs(_ context.Context, ids []int) ([]*FeedVersionServiceWindow, []error)

func (UnimplementedFinder) FeedVersionsByFeedIDs added in v1.4.0

func (UnimplementedFinder) FeedVersionsByFeedIDs(context.Context, *int, *FeedVersionFilter, []int) ([][]*FeedVersion, error)

func (UnimplementedFinder) FeedVersionsByIDs added in v1.4.0

func (UnimplementedFinder) FeedVersionsByIDs(_ context.Context, ids []int) ([]*FeedVersion, []error)

func (UnimplementedFinder) FeedsByIDs added in v1.4.0

func (UnimplementedFinder) FeedsByIDs(_ context.Context, ids []int) ([]*Feed, []error)

func (UnimplementedFinder) FeedsByOperatorOnestopIDs added in v1.4.0

func (UnimplementedFinder) FeedsByOperatorOnestopIDs(context.Context, *int, *FeedFilter, []string) ([][]*Feed, error)

func (UnimplementedFinder) FindAgencies added in v1.4.0

func (UnimplementedFinder) FindAgencies(context.Context, *int, *Cursor, []int, *AgencyFilter) ([]*Agency, error)

func (UnimplementedFinder) FindCensusDatasets added in v1.4.0

func (UnimplementedFinder) FindCensusValuesByDatasetID added in v1.4.0

func (UnimplementedFinder) FindFeedVersionServiceWindow added in v1.4.0

func (UnimplementedFinder) FindFeedVersionServiceWindow(context.Context, int) (*ServiceWindow, error)

func (UnimplementedFinder) FindFeedVersions added in v1.4.0

func (UnimplementedFinder) FindFeeds added in v1.4.0

func (UnimplementedFinder) FindFeeds(context.Context, *int, *Cursor, []int, *FeedFilter) ([]*Feed, error)

func (UnimplementedFinder) FindOperators added in v1.4.0

func (UnimplementedFinder) FindPlaces added in v1.4.0

func (UnimplementedFinder) FindRoutes added in v1.4.0

func (UnimplementedFinder) FindRoutes(context.Context, *int, *Cursor, []int, *RouteFilter) ([]*Route, error)

func (UnimplementedFinder) FindShapesByFeedVersion added in v1.4.0

func (UnimplementedFinder) FindShapesByFeedVersion(context.Context, int, *int, *Cursor, *ShapeFilter) ([]*Shape, error)

func (UnimplementedFinder) FindStops added in v1.4.0

func (UnimplementedFinder) FindStops(context.Context, *int, *Cursor, []int, *StopFilter) ([]*Stop, error)

func (UnimplementedFinder) FindTrips added in v1.4.0

func (UnimplementedFinder) FindTrips(context.Context, *int, *Cursor, []int, *TripFilter) ([]*Trip, error)

func (UnimplementedFinder) FlexStopTimesByLocationGroupIDs added in v1.4.0

func (UnimplementedFinder) FlexStopTimesByLocationGroupIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*FlexStopTime, error)

func (UnimplementedFinder) FlexStopTimesByLocationIDs added in v1.4.0

func (UnimplementedFinder) FlexStopTimesByLocationIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*FlexStopTime, error)

func (UnimplementedFinder) FlexStopTimesByStopIDs added in v1.4.0

func (UnimplementedFinder) FlexStopTimesByStopIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*FlexStopTime, error)

func (UnimplementedFinder) FlexStopTimesByTripIDs added in v1.4.0

func (UnimplementedFinder) FlexStopTimesByTripIDs(context.Context, *int, *TripStopTimeFilter, []FVPair) ([][]*FlexStopTime, error)

func (UnimplementedFinder) FrequenciesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) FrequenciesByFeedVersionIDs(context.Context, *int, *Cursor, *FrequencyFilter, []int) ([][]*Frequency, error)

func (UnimplementedFinder) FrequenciesByTripIDs added in v1.4.0

func (UnimplementedFinder) FrequenciesByTripIDs(context.Context, *int, []int) ([][]*Frequency, error)

func (UnimplementedFinder) LevelCreate added in v1.4.0

func (UnimplementedFinder) LevelDelete added in v1.4.0

func (UnimplementedFinder) LevelUpdate added in v1.4.0

func (UnimplementedFinder) LevelsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) LevelsByFeedVersionIDs(context.Context, *int, *Cursor, *LevelFilter, []int) ([][]*Level, error)

func (UnimplementedFinder) LevelsByIDs added in v1.4.0

func (UnimplementedFinder) LevelsByIDs(_ context.Context, ids []int) ([]*Level, []error)

func (UnimplementedFinder) LevelsByParentStationIDs added in v1.4.0

func (UnimplementedFinder) LevelsByParentStationIDs(context.Context, *int, []int) ([][]*Level, error)

func (UnimplementedFinder) LocationGroupStopsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) LocationGroupStopsByFeedVersionIDs(context.Context, *int, *Cursor, *LocationGroupStopFilter, []int) ([][]*LocationGroupStop, error)

func (UnimplementedFinder) LocationGroupsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) LocationGroupsByFeedVersionIDs(context.Context, *int, *LocationGroupFilter, []int) ([][]*LocationGroup, error)

func (UnimplementedFinder) LocationGroupsByIDs added in v1.4.0

func (UnimplementedFinder) LocationGroupsByIDs(_ context.Context, ids []int) ([]*LocationGroup, []error)

func (UnimplementedFinder) LocationGroupsByStopIDs added in v1.4.0

func (UnimplementedFinder) LocationGroupsByStopIDs(context.Context, *int, []int) ([][]*LocationGroup, error)

func (UnimplementedFinder) LocationsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) LocationsByFeedVersionIDs(context.Context, *int, *LocationFilter, []int) ([][]*Location, error)

func (UnimplementedFinder) LocationsByIDs added in v1.4.0

func (UnimplementedFinder) LocationsByIDs(_ context.Context, ids []int) ([]*Location, []error)

func (UnimplementedFinder) NetworksByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) NetworksByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*Network, error)

func (UnimplementedFinder) NetworksByIDs added in v1.4.0

func (UnimplementedFinder) NetworksByIDs(_ context.Context, ids []int) ([]*Network, []error)

func (UnimplementedFinder) NetworksByRouteIDs added in v1.4.0

func (UnimplementedFinder) NetworksByRouteIDs(context.Context, *int, []int) ([][]*Network, error)

func (UnimplementedFinder) OperatorsByAgencyIDs added in v1.4.0

func (UnimplementedFinder) OperatorsByAgencyIDs(_ context.Context, ids []int) ([][]*Operator, []error)

func (UnimplementedFinder) OperatorsByCOIFs added in v1.4.0

func (UnimplementedFinder) OperatorsByCOIFs(_ context.Context, ids []int) ([]*Operator, []error)

func (UnimplementedFinder) OperatorsByFeedIDs added in v1.4.0

func (UnimplementedFinder) OperatorsByFeedIDs(context.Context, *int, *OperatorFilter, []int) ([][]*Operator, error)

func (UnimplementedFinder) PathwayCreate added in v1.4.0

func (UnimplementedFinder) PathwayDelete added in v1.4.0

func (UnimplementedFinder) PathwayDelete(context.Context, int) error

func (UnimplementedFinder) PathwayUpdate added in v1.4.0

func (UnimplementedFinder) PathwaysByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) PathwaysByFeedVersionIDs(context.Context, *int, *Cursor, *PathwayFilter, []int) ([][]*Pathway, error)

func (UnimplementedFinder) PathwaysByFromStopIDs added in v1.4.0

func (UnimplementedFinder) PathwaysByFromStopIDs(context.Context, *int, *PathwayFilter, []int) ([][]*Pathway, error)

func (UnimplementedFinder) PathwaysByIDs added in v1.4.0

func (UnimplementedFinder) PathwaysByIDs(_ context.Context, ids []int) ([]*Pathway, []error)

func (UnimplementedFinder) PathwaysByToStopIDs added in v1.4.0

func (UnimplementedFinder) PathwaysByToStopIDs(context.Context, *int, *PathwayFilter, []int) ([][]*Pathway, error)

func (UnimplementedFinder) PermFilter added in v1.4.0

func (UnimplementedFinder) RiderCategoriesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) RiderCategoriesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*RiderCategory, error)

func (UnimplementedFinder) RiderCategoriesByFeedVersionRiderCategoryIDs added in v1.4.0

func (UnimplementedFinder) RiderCategoriesByFeedVersionRiderCategoryIDs(_ context.Context, keys []FVEntityID) ([]*RiderCategory, []error)

func (UnimplementedFinder) RouteAttributesByRouteIDs added in v1.4.0

func (UnimplementedFinder) RouteAttributesByRouteIDs(_ context.Context, ids []int) ([]*RouteAttribute, []error)

func (UnimplementedFinder) RouteGeometriesByRouteIDs added in v1.4.0

func (UnimplementedFinder) RouteGeometriesByRouteIDs(context.Context, *int, []int) ([][]*RouteGeometry, error)

func (UnimplementedFinder) RouteHeadwaysByRouteIDs added in v1.4.0

func (UnimplementedFinder) RouteHeadwaysByRouteIDs(context.Context, *int, []int) ([][]*RouteHeadway, error)

func (UnimplementedFinder) RouteNetworksByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) RouteNetworksByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*RouteNetwork, error)

func (UnimplementedFinder) RouteStopBuffer added in v1.4.0

func (UnimplementedFinder) RouteStopBuffer(context.Context, *int, *float64, int) ([]*RouteStopBuffer, error)

func (UnimplementedFinder) RouteStopPatternsByRouteIDs added in v1.4.0

func (UnimplementedFinder) RouteStopPatternsByRouteIDs(context.Context, *int, *RouteStopPatternFilter, []FVPair) ([][]*RouteStopPattern, error)

func (UnimplementedFinder) RouteStopsByRouteIDs added in v1.4.0

func (UnimplementedFinder) RouteStopsByRouteIDs(context.Context, *int, []int) ([][]*RouteStop, error)

func (UnimplementedFinder) RouteStopsByStopIDs added in v1.4.0

func (UnimplementedFinder) RouteStopsByStopIDs(context.Context, *int, []int) ([][]*RouteStop, error)

func (UnimplementedFinder) RouteTypesByAgencyIDs added in v1.4.0

func (UnimplementedFinder) RouteTypesByAgencyIDs(_ context.Context, ids []int) ([][]int, []error)

func (UnimplementedFinder) RoutesByAgencyIDs added in v1.4.0

func (UnimplementedFinder) RoutesByAgencyIDs(context.Context, *int, *RouteFilter, []int) ([][]*Route, error)

func (UnimplementedFinder) RoutesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) RoutesByFeedVersionIDs(context.Context, *int, *RouteFilter, []int) ([][]*Route, error)

func (UnimplementedFinder) RoutesByFeedVersionRouteIDs added in v1.4.0

func (UnimplementedFinder) RoutesByFeedVersionRouteIDs(_ context.Context, keys []FVEntityID) ([]*Route, []error)

func (UnimplementedFinder) RoutesByIDs added in v1.4.0

func (UnimplementedFinder) RoutesByIDs(_ context.Context, ids []int) ([]*Route, []error)

func (UnimplementedFinder) SegmentPatternsByRouteIDs added in v1.4.0

func (UnimplementedFinder) SegmentPatternsByRouteIDs(context.Context, *int, *SegmentPatternFilter, []int) ([][]*SegmentPattern, error)

func (UnimplementedFinder) SegmentPatternsBySegmentIDs added in v1.4.0

func (UnimplementedFinder) SegmentPatternsBySegmentIDs(context.Context, *int, *SegmentPatternFilter, []int) ([][]*SegmentPattern, error)

func (UnimplementedFinder) SegmentsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) SegmentsByFeedVersionIDs(context.Context, *int, *SegmentFilter, []int) ([][]*Segment, error)

func (UnimplementedFinder) SegmentsByIDs added in v1.4.0

func (UnimplementedFinder) SegmentsByIDs(_ context.Context, ids []int) ([]*Segment, []error)

func (UnimplementedFinder) SegmentsByRouteIDs added in v1.4.0

func (UnimplementedFinder) SegmentsByRouteIDs(context.Context, *int, *SegmentFilter, []int) ([][]*Segment, error)

func (UnimplementedFinder) ShapesByIDs added in v1.4.0

func (UnimplementedFinder) ShapesByIDs(_ context.Context, ids []int) ([]*Shape, []error)

func (UnimplementedFinder) StopAreasByAreaIDs added in v1.4.0

func (UnimplementedFinder) StopAreasByAreaIDs(context.Context, *int, *Cursor, []int) ([][]*StopArea, error)

func (UnimplementedFinder) StopAreasByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) StopAreasByFeedVersionIDs(context.Context, *int, *Cursor, *StopAreaFilter, []int) ([][]*StopArea, error)

func (UnimplementedFinder) StopCreate added in v1.4.0

func (UnimplementedFinder) StopDelete added in v1.4.0

func (UnimplementedFinder) StopExternalReferencesByStopIDs added in v1.4.0

func (UnimplementedFinder) StopExternalReferencesByStopIDs(_ context.Context, ids []int) ([]*StopExternalReference, []error)

func (UnimplementedFinder) StopObservationsByStopIDs added in v1.4.0

func (UnimplementedFinder) StopObservationsByStopIDs(context.Context, *int, *StopObservationFilter, []int) ([][]*StopObservation, error)

func (UnimplementedFinder) StopPlacesByStopID added in v1.4.0

func (UnimplementedFinder) StopPlacesByStopID(_ context.Context, keys []StopPlaceParam) ([]*StopPlace, []error)

func (UnimplementedFinder) StopTimesByStopIDs added in v1.4.0

func (UnimplementedFinder) StopTimesByStopIDs(context.Context, *int, *StopTimeFilter, []FVPair) ([][]*StopTime, error)

func (UnimplementedFinder) StopTimesByTripIDs added in v1.4.0

func (UnimplementedFinder) StopTimesByTripIDs(context.Context, *int, *TripStopTimeFilter, []FVPair) ([][]*StopTime, error)

func (UnimplementedFinder) StopUpdate added in v1.4.0

func (UnimplementedFinder) StopsByAgencyIDs added in v1.4.0

func (UnimplementedFinder) StopsByAgencyIDs(context.Context, *int, *Cursor, *AgencyStopFilter, []int) ([][]*Stop, error)

func (UnimplementedFinder) StopsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) StopsByFeedVersionIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)

func (UnimplementedFinder) StopsByFeedVersionStopIDs added in v1.4.0

func (UnimplementedFinder) StopsByFeedVersionStopIDs(_ context.Context, keys []FVEntityID) ([]*Stop, []error)

func (UnimplementedFinder) StopsByIDs added in v1.4.0

func (UnimplementedFinder) StopsByIDs(_ context.Context, ids []int) ([]*Stop, []error)

func (UnimplementedFinder) StopsByLevelIDs added in v1.4.0

func (UnimplementedFinder) StopsByLevelIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)

func (UnimplementedFinder) StopsByLocationGroupIDs added in v1.4.0

func (UnimplementedFinder) StopsByLocationGroupIDs(context.Context, *int, []int) ([][]*Stop, error)

func (UnimplementedFinder) StopsByParentStopIDs added in v1.4.0

func (UnimplementedFinder) StopsByParentStopIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)

func (UnimplementedFinder) StopsByRouteIDs added in v1.4.0

func (UnimplementedFinder) StopsByRouteIDs(context.Context, *int, *StopFilter, []int) ([][]*Stop, error)

func (UnimplementedFinder) TargetStopsByStopIDs added in v1.4.0

func (UnimplementedFinder) TargetStopsByStopIDs(_ context.Context, ids []int) ([]*Stop, []error)

func (UnimplementedFinder) TimeframesByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) TimeframesByFeedVersionIDs(context.Context, *int, *Cursor, []int) ([][]*Timeframe, error)

func (UnimplementedFinder) TimeframesByFeedVersionTimeframeGroupIDs added in v1.4.0

func (UnimplementedFinder) TimeframesByFeedVersionTimeframeGroupIDs(_ context.Context, keys []FVEntityID) ([][]*Timeframe, []error)

func (UnimplementedFinder) TransfersByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) TransfersByFeedVersionIDs(context.Context, *int, *Cursor, *TransferFilter, []int) ([][]*Transfer, error)

func (UnimplementedFinder) TranslationsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) TranslationsByFeedVersionIDs(context.Context, *int, *Cursor, *TranslationFilter, []int) ([][]*Translation, error)

func (UnimplementedFinder) TripsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) TripsByFeedVersionIDs(context.Context, *int, *TripFilter, []int) ([][]*Trip, error)

func (UnimplementedFinder) TripsByFeedVersionTripIDs added in v1.4.0

func (UnimplementedFinder) TripsByFeedVersionTripIDs(_ context.Context, keys []FVEntityID) ([]*Trip, []error)

func (UnimplementedFinder) TripsByIDs added in v1.4.0

func (UnimplementedFinder) TripsByIDs(_ context.Context, ids []int) ([]*Trip, []error)

func (UnimplementedFinder) TripsByRouteIDs added in v1.4.0

func (UnimplementedFinder) TripsByRouteIDs(context.Context, *int, *TripFilter, []FVPair) ([][]*Trip, error)

func (UnimplementedFinder) TripsByShapeIDs added in v1.4.0

func (UnimplementedFinder) TripsByShapeIDs(context.Context, *int, *TripFilter, []FVPair) ([][]*Trip, error)

func (UnimplementedFinder) ValidationReportErrorExemplarsByValidationReportErrorGroupIDs added in v1.4.0

func (UnimplementedFinder) ValidationReportErrorExemplarsByValidationReportErrorGroupIDs(context.Context, *int, []int) ([][]*ValidationReportError, error)

func (UnimplementedFinder) ValidationReportErrorGroupsByValidationReportIDs added in v1.4.0

func (UnimplementedFinder) ValidationReportErrorGroupsByValidationReportIDs(context.Context, *int, []int) ([][]*ValidationReportErrorGroup, error)

func (UnimplementedFinder) ValidationReportsByFeedVersionIDs added in v1.4.0

func (UnimplementedFinder) ValidationReportsByFeedVersionIDs(context.Context, *int, *ValidationReportFilter, []int) ([][]*ValidationReport, error)

type User added in v1.3.3

type User struct {
	// User identifier
	ID string `json:"id"`
	// Display name
	Name string `json:"name"`
	// Email address
	Email string `json:"email"`
}

A user in the authorization system

type UserFilter added in v1.3.3

type UserFilter struct {
	// Search for a user by ID
	ID *string `json:"id,omitempty"`
	// Full text search
	Q *string `json:"q,omitempty"`
}

Search options for users

type ValidationRealtimeResult added in v1.3.0

type ValidationRealtimeResult struct {
	// URL the GTFS-RT message was fetched from
	URL string `json:"url"`
	// JSON-decoded representation of the GTFS-RT message
	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 report was generated, in the feed's local time
	ReportedAtLocal *time.Time `json:"reported_at_local,omitempty"`
	// IANA timezone name corresponding to `reported_at_local`
	ReportedAtLocalTimezone *string `json:"reported_at_local_timezone,omitempty"`
	// True if validation completed successfully
	Success bool `json:"success"`
	// Error message if the feed failed to validate
	FailureReason *string `json:"failure_reason,omitempty"`
	// True if the report includes GTFS static validation results
	IncludesStatic *bool `json:"includes_static,omitempty"`
	// True if the report includes GTFS-RT validation results
	IncludesRt *bool `json:"includes_rt,omitempty"`
	// Validator name
	Validator *string `json:"validator,omitempty"`
	// Validator version
	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"`
	// Earliest calendar date with scheduled service
	EarliestCalendarDate *tt.Date `json:"earliest_calendar_date,omitempty"`
	// Latest calendar date with scheduled service
	LatestCalendarDate *tt.Date `json:"latest_calendar_date,omitempty"`
	// Details for each file contained in the feed
	Files []*FeedVersionFileInfo `json:"files"`
	// Calculated weekly service levels
	ServiceLevels []*FeedVersionServiceLevel `json:"service_levels"`
	// Sample of agencies in the feed (truncated; not a complete list)
	Agencies []*Agency `json:"agencies"`
	// Sample of routes in the feed (truncated; not a complete list)
	Routes []*Route `json:"routes"`
	// Sample of stops in the feed (truncated; not a complete list)
	Stops []*Stop `json:"stops"`
	// Records from `feed_info.txt`
	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 (e.g. `stops.txt`, or the GTFS-RT URL for realtime issues)
	Filename string `json:"filename"`
	// Validation rule or error class identifier (e.g. `MissingRequiredFieldError`)
	ErrorType string `json:"error_type"`
	// GTFS-RT error code (set only for realtime validation errors)
	ErrorCode string `json:"error_code"`
	// Stable grouping key shared with the parent `ValidationReportErrorGroup`
	GroupKey string `json:"group_key"`
	// Identifier of the affected entity (e.g. the `stop_id` or `trip_id`)
	EntityID string `json:"entity_id"`
	// Field name on which the error was raised
	Field string `json:"field"`
	// Line number in the source CSV file where the error occurred (static validation only; 0 for realtime)
	Line int `json:"line"`
	// Value of the affected field
	Value string `json:"value"`
	// Human-readable message describing the problem
	Message string `json:"message"`
	// Geometry of the affected entity, if available
	Geometry *tt.Geometry `json:"geometry,omitempty"`
	// JSON representation of the affected entity (empty map if not 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 {
	// Source filename for this group (e.g. `stops.txt`, or the GTFS-RT URL for realtime issues)
	Filename string `json:"filename"`
	// Validation rule or error class identifier (e.g. `MissingRequiredFieldError`)
	ErrorType string `json:"error_type"`
	// GTFS-RT error code (set only for realtime validation errors)
	ErrorCode string `json:"error_code"`
	// Stable grouping key used to aggregate equivalent errors
	GroupKey string `json:"group_key"`
	// Field name on which the error was raised
	Field string `json:"field"`
	// Total number of errors in this group
	Count int `json:"count"`
	// Sample of individual errors from this group
	Errors             []*ValidationReportError `json:"errors"`
	ID                 int                      `json:"-"`
	ValidationReportID int                      `json:"-"`
}

Group of validation errors or warnings sharing the same file, type, and grouping key; useful for summarizing repeated issues

type ValidationReportFilter added in v1.3.0

type ValidationReportFilter struct {
	// Restrict to validation reports with these integer IDs
	ReportIds []int `json:"report_ids,omitempty"`
	// Filter by success: true for successful reports, false for failed
	Success *bool `json:"success,omitempty"`
	// Filter by validator name
	Validator *string `json:"validator,omitempty"`
	// Filter by validator version
	ValidatorVersion *string `json:"validator_version,omitempty"`
	// Filter by `includes_rt`: true for reports that include GTFS-RT validation, false for those that don't
	IncludesRt *bool `json:"includes_rt,omitempty"`
	// Filter by `includes_static`: true for reports that include GTFS static validation, false for those that don't
	IncludesStatic *bool `json:"includes_static,omitempty"`
}

Search options for validation reports

type VehiclePosition added in v1.3.0

type VehiclePosition struct {
	// Identifier of the GTFS-RT FeedEntity carrying this vehicle. Unique within its feed and stable between messages, so `rt_feed_onestop_id` and `id` together identify a vehicle across polls
	ID string `json:"id"`
	// Onestop ID of the feed whose GTFS-RT data this vehicle came from. A feed may carry both static and realtime URLs, so this can be the same feed as a `feed_onestop_id` elsewhere in the schema
	RtFeedOnestopID string `json:"rt_feed_onestop_id"`
	// Vehicle descriptor from the GTFS-RT VehiclePosition
	Vehicle *RTVehicleDescriptor `json:"vehicle,omitempty"`
	// Trip descriptor from the GTFS-RT VehiclePosition
	TripDescriptor *RTTripDescriptor `json:"trip_descriptor,omitempty"`
	// Current vehicle position
	Position *tt.Point `json:"position,omitempty"`
	// Direction of travel in degrees clockwise from true north
	Bearing *float64 `json:"bearing,omitempty"`
	// Momentary speed in meters per second
	Speed *float64 `json:"speed,omitempty"`
	// Sequence index of the stop the vehicle is approaching or stopped at, within the trip
	CurrentStopSequence *int `json:"current_stop_sequence,omitempty"`
	// GTFS `stop_id` of the stop the vehicle is approaching or stopped at
	StopID *string `json:"stop_id,omitempty"`
	// Vehicle status relative to `stop_id`: `INCOMING_AT`, `STOPPED_AT`, or `IN_TRANSIT_TO`
	CurrentStatus *string `json:"current_status,omitempty"`
	// Moment the position was measured, as reported by the vehicle. Null when the message carries no timestamp of its own; such vehicles are ordered last when a `limit` keeps the most recently reported
	Timestamp *time.Time `json:"timestamp,omitempty"`
	// Estimated congestion level: `UNKNOWN_CONGESTION_LEVEL`, `RUNNING_SMOOTHLY`, `STOP_AND_GO`, `CONGESTION`, or `SEVERE_CONGESTION`
	CongestionLevel *string `json:"congestion_level,omitempty"`
	// Vehicle occupancy: `EMPTY`, `MANY_SEATS_AVAILABLE`, `FEW_SEATS_AVAILABLE`, `STANDING_ROOM_ONLY`, `CRUSHED_STANDING_ROOM_ONLY`, `FULL`, `NOT_ACCEPTING_PASSENGERS`, `NO_DATA_AVAILABLE`, or `NOT_BOARDABLE`
	OccupancyStatus *string `json:"occupancy_status,omitempty"`
	// Percentage of the vehicle's total capacity in use
	OccupancyPercentage *int `json:"occupancy_percentage,omitempty"`
	// Scheduled trip matched from the trip descriptor's `trip_id`
	Trip *Trip `json:"trip,omitempty"`
	// Route matched from the trip descriptor's `route_id`, falling back to the matched trip's route
	Route *Route `json:"route,omitempty"`
	// Stop matched from `stop_id`
	Stop              *Stop `json:"stop,omitempty"`
	FeedVersionID     int   `json:"-"`
	MatchedByEntityID bool  `json:"-"`
}

[Vehicle Position](https://gtfs.org/reference/realtime/v2/#message-vehicleposition) message provided by a source GTFS Realtime feed.

Values are passed through from the GTFS-RT message as-is. The `trip`, `route` and `stop` fields resolve the message's `trip_id`, `route_id` and `stop_id` against the static GTFS data of the feed version the vehicle was matched to; each is null when the id is absent from the message or not found in the schedule.

Positions are the last values seen for each vehicle and carry no freshness guarantee; check `timestamp` before drawing a vehicle as current.

func OrderVehiclePositions added in v1.4.0

func OrderVehiclePositions(ents []*VehiclePosition, limit *int) []*VehiclePosition

OrderVehiclePositions deduplicates, truncates and orders a set of vehicle positions for return. A nil limit returns every vehicle.

A vehicle claimed by more than one agency, which happens when their static feeds share a realtime feed, collapses to a single result. Freshness decides which copy survives and what a limit drops, but the returned order is by feed and entity id: a client polling for changes needs its markers to stay put rather than reshuffle every time a timestamp advances.

type VehiclePositionFilter added in v1.4.0

type VehiclePositionFilter struct {
	// Search for vehicles within this bounding box. Its size is bounded by the server's maximum search radius
	Bbox *BoundingBox `json:"bbox"`
}

Search options for GTFS-RT vehicle positions.

To find the vehicles of a particular agency, route or trip, query `vehicle_positions` on that entity rather than searching for it here.

type Waypoint added in v1.3.0

type Waypoint struct {
	// Longitude of the waypoint
	Lon float64 `json:"lon"`
	// Latitude of the waypoint
	Lat float64 `json:"lat"`
	// Display name for the waypoint
	Name *string `json:"name,omitempty"`
	// Matched transit stop at this waypoint, if any
	Stop *WaypointStop `json:"stop,omitempty"`
}

A resolved waypoint in a routing response, including optional matched stop information.

type WaypointDeparture added in v1.3.0

type WaypointDeparture struct {
	// Longitude of the stop
	Lon float64 `json:"lon"`
	// Latitude of the stop
	Lat float64 `json:"lat"`
	// Scheduled departure time at this stop
	Departure time.Time `json:"departure"`
	// GTFS stop_id
	StopID string `json:"stop_id"`
	// Stop name
	StopName string `json:"stop_name"`
	// Stop code
	StopCode string `json:"stop_code"`
	// Onestop ID for this stop
	StopOnestopID string `json:"stop_onestop_id"`
	// Index of this stop within the leg
	StopIndex *int `json:"stop_index,omitempty"`
	// GTFS stop_sequence value
	StopSequence *int `json:"stop_sequence,omitempty"`
}

A transit stop with departure information within a leg, including sequence details.

type WaypointInput added in v1.3.0

type WaypointInput struct {
	// Longitude of the waypoint
	Lon float64 `json:"lon"`
	// Latitude of the waypoint
	Lat float64 `json:"lat"`
	// Optional display name for the waypoint
	Name *string `json:"name,omitempty"`
}

A geographic waypoint used as an origin or destination in a routing request.

type WaypointStop added in v1.3.0

type WaypointStop struct {
	// Longitude of the stop
	Lon float64 `json:"lon"`
	// Latitude of the stop
	Lat float64 `json:"lat"`
	// Scheduled departure time at this stop
	Departure time.Time `json:"departure"`
	// GTFS stop_id
	StopID string `json:"stop_id"`
	// Stop name
	StopName string `json:"stop_name"`
	// Stop code
	StopCode string `json:"stop_code"`
	// Onestop ID for this stop
	StopOnestopID string `json:"stop_onestop_id"`
}

A transit stop matched to a waypoint, with departure information.

Jump to

Keyboard shortcuts

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