feed

package
v0.0.0-...-bcf2fa8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEntry

func AddEntry(feedID int64, url, title, description string, datePublished string) error

Adds an entry to the database if it does not already exist.

func AddFeed

func AddFeed(feed *gofeed.Feed) (int64, error)

Adds a feed to the database. If the feed already exists, it adds any new entries. If the feed does not exist, it inserts a new feed and its entries.

func InitDB

func InitDB()

Initialize SQLite database connection and creates the necessary tables if they do not exist.

func MarkRead

func MarkRead(entryID int) error

Mark an entry as read

func MarkUpdated

func MarkUpdated(feedID int64) error

Update the last updated time for a feed

func OpenInBrowser

func OpenInBrowser(url string, browser string)

Open URL in web browser

func OpenInPlayer

func OpenInPlayer(url string, player string)

Open URL in media player

func Sync

func Sync()

Sync feeds This function asynchronously GETs feeds, using the last_updated field in the database to only grab/update feeds that were updated since the last sync. The new feed contents are then stored in the database.

Types

type Entry

type Entry struct {
	ID            int64  `json:"id"`
	FeedID        int64  `json:"feed_id"`
	URL           string `json:"url"`
	Title         string `json:"title"`
	Description   string `json:"description"`
	Content       string `json:"content"`
	DatePublished string `json:"date_published"`
	Read          bool   `json:"read"`
}

func GetEntries

func GetEntries(feedID int) []*Entry

Get all entries for feed with feedID

type Feed

type Feed struct {
	ID          int64    `json:"id"`
	URL         string   `json:"url"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	LastUpdated string   `json:"last_updated"`
	Entries     []*Entry `json:"entries,omitempty"`
}

func GetFeedByURL

func GetFeedByURL(url string) *Feed

func GetFeeds

func GetFeeds() []*Feed

Retrieve all feeds

Jump to

Keyboard shortcuts

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