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 ¶
func RTFetch(ctx context.Context, fm feedmanager.FeedManager, opts RTFetchOptions) (RTFetchResult, error)
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 ¶
func StaticFetch(ctx context.Context, fm feedmanager.FeedManager, opts StaticFetchOptions) (StaticFetchResult, error)
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.
Click to show internal directories.
Click to hide internal directories.