fetch

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Options    Options
	CreateFeed bool
	Workers    int
	Limit      int
	DBURL      string
	DryRun     bool
	FeedIDs    []string
	Adapter    tldb.Adapter
	Results    []StaticFetchResult
}

Command fetches feeds defined a DMFR database.

func (*Command) Parse

func (cmd *Command) Parse(args []string) error

Parse sets options from command line flags.

func (*Command) Run

func (cmd *Command) Run() error

Run executes this command.

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                 []tl.Secret
	CreatedBy               tl.String
	Name                    tl.String
	Description             tl.String
	SaveValidationReport    bool
	ValidationReportStorage string
}

Options sets options for a fetch operation.

type RTFetchResult added in v0.10.2

type RTFetchResult struct {
	Message *pb.FeedMessage
	Result
}

func RTFetch added in v0.10.2

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

type RebuildStatsCommand added in v0.12.0

type RebuildStatsCommand struct {
	Options RebuildStatsOptions
	Workers int
	DBURL   string
	FeedIDs []string
	FVIDs   cli.ArrayFlags
	FVSHA1  cli.ArrayFlags
	Adapter tldb.Adapter // allow for mocks
}

RebuildStatsCommand rebuilds feed version statistics

func (*RebuildStatsCommand) Parse added in v0.12.0

func (cmd *RebuildStatsCommand) Parse(args []string) error

Parse command line flags

func (*RebuildStatsCommand) Run added in v0.12.0

func (cmd *RebuildStatsCommand) Run() error

Run this command

type RebuildStatsOptions added in v0.12.0

type RebuildStatsOptions struct {
	FeedVersionID           int
	Storage                 string
	ValidationReportStorage string
	SaveValidationReport    bool
}

type RebuildStatsResult added in v0.12.0

type RebuildStatsResult struct {
	Error error
}

type Result

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

Result contains results of a fetch operation.

type StaticFetchResult added in v0.16.0

type StaticFetchResult struct {
	FeedVersion      *tl.FeedVersion
	ValidationResult *validator.Result
	Error            error
	Result
}

func StaticFetch added in v0.10.2

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