feeds

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFeed

func AddFeed(Bot *tgbotapi.BotAPI, name string, url string, chatid int64, userid int) error

Add a new feed to the database

func DeleteFeedByID

func DeleteFeedByID(feedid int, chatid int64, userid int) error

Delete a feed by a feedID parameter

func Exists

func Exists(url string, chatid int64) (bool, error)

Check for a feed if it exists by its url returns true if exists and false if it does not

func FeedExistsByID

func FeedExistsByID(id int, chatid int64, userid int) error

func GetAllUnPublishedFeedData

func GetAllUnPublishedFeedData() (*[]models.FeedData, error)

Get all unpublished feed data from the database, this will contain all feeds which were not yet posted to the specific channels

func GetFeed

func GetFeed(feedUrl string, feedID int) error

This function requests the RSS Feed, parses and processes the data

func GetFeedUpdatesChan

func GetFeedUpdatesChan() chan models.Feed

This channel is used for getting the feed updates from the database Here we send all the feed data to the channel

func LinkExists

func LinkExists(link string) bool

This function checks for the URL if it is contained in the feedData table We use this function to not write the same feed data into the table twice

func ListAllFeeds

func ListAllFeeds() (*[]models.Feed, error)

Get a list of all Feeds added to the database

func ListFeeds

func ListFeeds(userid int, chatid int64) (*[]models.Feed, error)

List all feeds added to the database, filter by userID and chatID

func PostFeedUpdatesChan

func PostFeedUpdatesChan() chan models.FeedData

This channel is use for getting all the unpublished feed data from the database We write all the unpublished feed data into the channel

func UpdateFeedDataPublished

func UpdateFeedDataPublished(data *models.FeedData) (bool, error)

This function updates the Feed data and sets the respective feed data entry to published

func WriteFeedData

func WriteFeedData(feedT *gofeed.Item, feedID int) (string, error)

This function writes new feed data to the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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