importer

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateFeedVersion

func ActivateFeedVersion(ctx context.Context, atx tldb.Adapter, fvid int) error

ActivateFeedVersion sets the feed version as active and refreshes materialized tables

func DeleteFeedVersion

func DeleteFeedVersion(ctx context.Context, atx tldb.Adapter, id int, extraTables []string) error

func UnimportFeedVersion

func UnimportFeedVersion(ctx context.Context, atx tldb.Adapter, id int, extraTables []string) error

UnimportFeedVersion unimports a feed version and removes the feed_version_gtfs_import record.

func UnimportSchedule

func UnimportSchedule(ctx context.Context, atx tldb.Adapter, id int) error

UnimportSchedule removes schedule data for a feed version and updates the import record. stops, routes, agencies, pathways, levels are not affected. Note: calendars and calendar_dates MAY be deleted in future versions.

Types

type Options

type Options struct {
	FeedVersionID int
	Storage       string
	Activate      bool
	// ErrorThreshold sets the maximum error percentage (0-100) allowed per file.
	// The key is the filename (e.g., "stops.txt") or "*" for the default threshold.
	// If any file exceeds its threshold, the import is considered failed.
	// Example: {"*": 10, "stops.txt": 5} means 10% default, 5% for stops.txt.
	ErrorThreshold map[string]float64
	copier.Options
}

Options sets various options for importing a feed.

type Result

type Result struct {
	FeedVersionImport dmfr.FeedVersionImport
}

Result contains the results of a feed import.

func ImportFeedVersion

func ImportFeedVersion(ctx context.Context, adapter tldb.Adapter, opts Options) (Result, error)

ImportFeedVersion create FVI and run Copier inside a Tx.

Jump to

Keyboard shortcuts

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