worker

package
v0.0.0-...-c61f6c7 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

type NetworkUsage

type NetworkUsage int
const (
	NetworkUsed NetworkUsage = iota
	NetworkSkipped
)

type RSS

type RSS struct {
	XMLName xml.Name `xml:"rss"`
	Version string   `xml:"version,attr"`
	Channel struct {
		Title       string `xml:"title"`
		Description string `xml:"description"`
		Link        string `xml:"link"`
		Image       struct {
			Url   string `xml:"url"`
			Title string `xml:"title"`
			Link  string `xml:"link"`
		} `xml:"image"`
		Items []RSSItem `xml:"item"`
	} `xml:"channel"`
}

type RSSItem

type RSSItem struct {
	Title       string `xml:"title"`
	Description struct {
		XMLName xml.Name `xml:"description"`
		Text    string   `xml:",cdata"`
	} `xml:"description"`
	Link string `xml:"link"`
	Guid struct {
		IsPermaLink string `xml:"isPermaLink,attr"`
		Value       string `xml:",chardata"`
	} `xml:"guid"`
	PubDate string `xml:"pubDate"`
}

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(config *config.Config, db *storage.Storage) *Worker

func (*Worker) ProcessQueue

func (w *Worker) ProcessQueue() NetworkUsage

func (*Worker) RefreshFeeds

func (w *Worker) RefreshFeeds()

func (*Worker) StartArticleCleaner

func (w *Worker) StartArticleCleaner(maxAge time.Duration)

func (*Worker) StartFeeds

func (w *Worker) StartFeeds(interval time.Duration)

func (*Worker) StartQueue

func (w *Worker) StartQueue(delay time.Duration)

func (*Worker) Submit

func (w *Worker) Submit(url string, pubDate time.Time)

Jump to

Keyboard shortcuts

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