apiload

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package apiload contains internal implementation for FeedLoad & FeedLoadCustomGTFS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeedLoadCustomGTFS added in v0.7.0

func FeedLoadCustomGTFS(m *apptypes.MobsqlRuntime, feedID int, feedURI string) (*apptypes.FeedOpResult, error)

FeedLoadCustomGTFS loads the given feedID to the database for the feedURI allowing the loading of any arbitrary user-provided GTFS file to the SQLite database.

The feedID MUST be a negative integer as this allows disambiguation from Mobility Database feed IDs which are always positive integers. And the feedURI parameter may be either a file:// URI OR a http(s):// URI.

If you want to load a MobilityDatabase GTFS feed you may used the related FeedLoadMDBGTFS function in which case you don't have to specify the URI etc.

Note: Unlike the FeedLoadMDBGTFS function, an implicit [FeedPurge] operation is always run on the provided feed ID prior to load as this function is intended to be a one-time process and thus avoids the caching system

func FeedLoadMDBGTFS added in v0.9.0

func FeedLoadMDBGTFS(m *apptypes.MobsqlRuntime, feedIDs []int, agencyDirectURL bool, cacheClear bool) (*apptypes.FeedOpResult, error)

FeedLoadMDBGTFS loads the given Mobility Database feedIDs to the database. This involves both downloading the associated feed's GTFS ZIP archive (as specified by the Mobility Database) and then loading the feed via SQLite.

See Feed IDs doc for information on valid Mobility Database feed IDs that may be used. Also note that [FeedsearchFilterToFeedIDs] may be used to search for valid feeds.

If the cacheclear flag is set to true, the Mobility Database is force downloaded prior to loading & additionally the filecache & shacaching mechanisms are wholesale disabled. This is applicable in the case of updating feeds if you want to ensure that the loaded feed is the *latest* available data (otherwise in default scenario, the Mobility Database & GTFS data is cached with a 1-week expiry so if you perform subsequent load operations things are cached for a week out).

If the agencyDirectURL flag is set the 'direct' agency URL is utilized in load (meanwhile by default / if false), Mobility Database's CI bucket URLs are used (which may be slightly out of date as these are periodically updated but are vastly more reliable then the numerous agencies upstream URLs).

If you want to load a *custom* (non Mobility-Database) GTFS archive you may used the related FeedLoadCustomGTFS function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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