fetch

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 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
	IgnoreDuplicateContents bool
	Storage                 string
	AllowFTPFetch           bool
	AllowLocalFetch         bool
	AllowS3Fetch            bool
	MaxSize                 uint64
	HideURL                 bool
	FetchedAt               time.Time
	Secrets                 []dmfr.Secret
	CreatedBy               tt.String
	Name                    tt.String
	Description             tt.String
	SaveValidationReport    bool
	ValidationReportStorage string
}

Options sets options for a fetch operation.

type RTFetchResult

type RTFetchResult struct {
	Message *pb.FeedMessage
	Result
}

func RTFetch

func RTFetch(atx tldb.Adapter, opts Options) (RTFetchResult, error)

type Result

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

Result contains results of a fetch operation.

type StaticFetchResult

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

func StaticFetch

func StaticFetch(atx tldb.Adapter, opts Options) (StaticFetchResult, error)

StaticFetch from a URL. Creates FeedVersion and FeedFetch records. Returns an error if a serious failure occurs, such as database or filesystem access. Sets Result.FetchError if a regular failure occurs, such as a 404. feed is an argument to provide the ID, File, and Authorization.

Jump to

Keyboard shortcuts

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