fetch

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: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	FeedURL                  string
	FeedID                   int
	URLType                  string
	Storage                  string
	AllowFTPFetch            bool
	AllowLocalFetch          bool
	AllowS3Fetch             bool
	AllowHTTPFetchUnfiltered bool
	MaxSize                  uint64
	HideURL                  bool
	FetchedAt                time.Time
	Secrets                  []dmfr.Secret
}

Options sets options for a fetch operation.

type RTFetchOptions added in v1.0.0

type RTFetchOptions struct {
	Options
}

type RTFetchResult

type RTFetchResult struct {
	Message *pb.FeedMessage
	Result
}

func RTFetch

RTFetch downloads a GTFS-RT feed, parses the protobuf, uploads it, and records a FeedFetch. It creates no feed version. Returns an error only on a serious failure; a 404 or parse error is on Result.FetchError.

type Result

type Result struct {
	Found          bool
	Error          error
	URL            string
	ResponseSize   int
	ResponseCode   int
	ResponseTtfbMs int
	ResponseTimeMs int
	ResponseSHA1   string
	FetchError     error
	FeedVersionID  tt.Int
}

Result contains results of a fetch operation.

type StaticFetchOptions added in v1.0.0

type StaticFetchOptions struct {
	StrictValidation        bool
	SaveValidationReport    bool
	ValidationReportStorage string
	ValidatorOptions        validator.Options
	CreatedBy               tt.String
	Name                    tt.String
	Description             tt.String
	// AllowPartial fetches partial feeds missing the normally-required files.
	AllowPartial bool
	Options
}

type StaticFetchResult

type StaticFetchResult struct {
	FeedVersion                *dmfr.FeedVersion
	FeedVersionValidatorResult *validator.Result
	Result
}

func StaticFetch

StaticFetch downloads a GTFS feed, and — if it's new and valid — uploads the file and creates the FeedVersion + stats records. Creates a FeedFetch record either way. Returns an error only on a serious (db/filesystem) failure; a regular failure such as a 404 or strict-validation error is on Result.FetchError.

Jump to

Keyboard shortcuts

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