fetch

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

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
	Workers int
	Limit   int
	DBURL   string
	DryRun  bool
	FeedIDs []string
	// contains filtered or unexported fields
}

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                  string
	FeedCreate              bool
	IgnoreDuplicateContents bool
	Directory               string
	S3                      string
	FetchedAt               time.Time
	Secrets                 download.Secrets
	CreatedBy               tl.OString
	Name                    tl.OString
	Description             tl.OString
}

Options sets options for a fetch operation.

type Result

type Result struct {
	FeedVersion  tl.FeedVersion
	Path         string
	FoundSHA1    bool
	FoundDirSHA1 bool
	FetchError   error
}

Result contains results of a fetch operation.

func DatabaseFetch

func DatabaseFetch(atx tldb.Adapter, opts Options) (Result, error)

DatabaseFetch fetches and creates a new FeedVersion for a given Feed. An error return from this function is a serious failure. Saves FeedState.LastFetchError for regular failures.

Jump to

Keyboard shortcuts

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