Documentation ¶
Index ¶
- Constants
- Variables
- func AddAuthor(db *sql.DB, name, email string) (int64, error)
- func AddEpisode(db *sql.DB, feedID int64, url, title string, date *time.Time, rawData string) (int64, error)
- func AddFeedFileData(fileData []file.Data) (map[int64]file.Data, error)
- func AddFeedURL(db *sql.DB, url string) (int64, error)
- func AddTag(db *sql.DB, tag string) (int64, error)
- func AddTagToFeed(db *sql.DB, feedID, tagID int64) (int64, error)
- func AllActiveFeedTags(db *sql.DB, feedID int64) map[int64]string
- func AllActiveFeeds(db *sql.DB) map[int64]string
- func AuthorExist(db *sql.DB, authorName, authorEmail string) (result bool)
- func Create(path string) (*sql.DB, error)
- func DeleteAllTagsFromFeed(db *sql.DB, feedID int64) error
- func DeleteFeed(db *sql.DB, feedID int64) error
- func DeleteTagFromFeed(db *sql.DB, feedID, tagID int64) error
- func EpisodeExist(db *sql.DB, title string) (result bool)
- func EpisodeHasAuthor(db *sql.DB, episodeID int64) (result bool)
- func EpisodeHasMediaContent(db *sql.DB, episodeID int64) (result bool)
- func Exist(path string) bool
- func FeedHasAuthor(db *sql.DB, feedID int64) (result bool)
- func FeedHasTag(db *sql.DB, feedID, tagID int64) bool
- func FeedURLExist(db *sql.DB, url string) bool
- func FilterFeedTags(db *sql.DB, feedID int64, tags map[int64]string) map[int64]string
- func FilterFeeds(db *sql.DB, feeds map[int64]string) map[int64]string
- func FormatEpisodeHeader(feedName, episodeTitle, author, episodeLink, episodeDate, mediaContent string) (result string)
- func GetAuthor(db *sql.DB, authorID int64) (name string, email string, err error)
- func GetAuthorByNameAndEmail(db *sql.DB, authorName, authorEmail string) (id int64, err error)
- func GetEpisode(db *sql.DB, episodeID int64) (url, title string, date time.Time, seen int64, rawData string, err error)
- func GetEpisodeAuthor(db *sql.DB, episodeID int64) (name, email string, err error)
- func GetEpisodeHeaderData(db *sql.DB, feedID, episodeID int64) (feedTitle, episodeTitle, author, episodeLink, dateString, mediaContent string, ...)
- func GetEpisodeIDByFeedIDAndTitle(db *sql.DB, feedID int64, episodeTitle string) (id int64, err error)
- func GetEpisodeMediaContent(db *sql.DB, episodeID int64) (mediaContent string, err error)
- func GetFeedAuthor(db *sql.DB, feedID int64) (name, email string, err error)
- func GetFeedAuthorID(db *sql.DB, feedID int64) (int64, error)
- func GetFeedDataFromSite(url string) (string, error)
- func GetFeedEpisodeIDs(db *sql.DB, feedID int64) (ids []int64, err error)
- func GetFeedEpisodeSeenRatio(db *sql.DB, feedID int64) (seen, total int64, err error)
- func GetFeedID(db *sql.DB, item string) (int64, error)
- func GetFeedInfo(db *sql.DB, feedID int64) (err error)
- func GetFeedRawData(db *sql.DB, feedID int64) (string, error)
- func GetFeedTagID(db *sql.DB, feedID, tagID int64) (int64, error)
- func GetFeedTitle(db *sql.DB, feedID int64) (string, error)
- func GetFeedURL(db *sql.DB, feedID int64) (url string, err error)
- func GetTagID(db *sql.DB, name string) (int64, error)
- func Init(dsn string, reset bool) (*sql.DB, error)
- func IsFeedDeleted(db *sql.DB, feedID int64) bool
- func IsFeedTagDeleted(db *sql.DB, feedTagID int64) bool
- func MarkEpisodeAsSeen(db *sql.DB, episodeID int64) (err error)
- func TagExist(db *sql.DB, tag string) bool
- func UndeleteFeed(db *sql.DB, feedID int64) error
- func UndeleteFeedTag(db *sql.DB, feedTagID int64) error
- func UpdateEpisodeAuthor(db *sql.DB, episodeID, authorID int64) (err error)
- func UpdateEpisodeMediaContent(db *sql.DB, episodeID int64, mediaContent string) (err error)
- func UpdateFeedAuthor(db *sql.DB, feedID, authorID int64) error
- func UpdateFeedRawData(db *sql.DB, feedID int64, rawData string) error
- func UpdateFeedTitle(db *sql.DB, feedID int64, title string) error
- type Episode
- type Feed
- type Feeds
Constants ¶
const ( //AuthorsTable -- author table sql AuthorsTable = ` DROP TABLE IF EXISTS authors; CREATE TABLE authors ( id INTEGER PRIMARY KEY, name TEXT, email TEXT ); ` //EpisodesTable -- episodes table sql EpisodesTable = `` /* 516-byte string literal not displayed */ //FeedsTable -- feeds table sql FeedsTable = `` /* 325-byte string literal not displayed */ //TagsTable -- tags table sql TagsTable = ` DROP TABLE IF EXISTS tags; CREATE TABLE tags ( id INTEGER PRIMARY KEY, name TEXT NOT NULL UNIQUE ); ` //FeedsAndTagsTable -- feeds_and_tags table sql FeedsAndTagsTable = `` /* 334-byte string literal not displayed */ )
Variables ¶
Functions ¶
func AddEpisode ¶
func AddEpisode(db *sql.DB, feedID int64, url, title string, date *time.Time, rawData string) (int64, error)
AddEpisode -- adds an episode to the database
func AddFeedFileData ¶
AddFeedFileData -- Adds Feed File Data to the database
func AddFeedURL ¶
AddFeedURL -- Adds a feed url to the database
func AddTagToFeed ¶
AddTagToFeed -- Adds a Tag to a feed via the feeds_and_tags table
func AllActiveFeedTags ¶
AllActiveFeedTags -- Returns all of the active tags associated with a feed
func AllActiveFeeds ¶
AllActiveFeeds -- Returns all active feeds
func AuthorExist ¶
AuthorExist -- Checks to see if an author exists
func DeleteAllTagsFromFeed ¶
DeleteAllTagsFromFeed -- flips the delete flag for all tags associated with a feed
func DeleteFeed ¶
DeleteFeed -- Flips the delete flag on for a feed in the database
func DeleteTagFromFeed ¶
DeleteTagFromFeed -- Deletes a tag from a feed
func EpisodeExist ¶
EpisodeExist -- Based on the title, it checks if that episode already exists
func EpisodeHasAuthor ¶
EpisodeHasAuthor -- returns true is an author id exists and false otherwise
func EpisodeHasMediaContent ¶
EpisodeHasMediaContent -- returns true is an author id exists and false otherwise
func FeedHasAuthor ¶
FeedHasAuthor -- returns true is an author id exists and false otherwise
func FeedHasTag ¶
FeedHasTag -- Checks to see if a feed has a specific tag
func FeedURLExist ¶
FeedURLExist -- Checks to see if a feed exists
func FilterFeedTags ¶
FilterFeedTags -- Takes in a map of feed tags and compares them with the tags listed in the database for that feed. Returns all the tags for that feed that are listed as active in the database but where not passed in.
func FilterFeeds ¶
FilterFeeds -- Takes in a list of feeds and compares them with the feeds listed in the Database. Returns all the feeds that are listed as active in the database but where not in the list.
func FormatEpisodeHeader ¶
func FormatEpisodeHeader(feedName, episodeTitle, author, episodeLink, episodeDate, mediaContent string) (result string)
FormatEpisodeHeader -- formats the episode header
func GetAuthorByNameAndEmail ¶
GetAuthorByNameAndEmail -- Given a name and email, will return authorID
func GetEpisode ¶
func GetEpisode(db *sql.DB, episodeID int64) (url, title string, date time.Time, seen int64, rawData string, err error)
GetEpisode -- gets an episode from the database
func GetEpisodeAuthor ¶
GetEpisodeAuthor -- returns the episode author
func GetEpisodeHeaderData ¶
func GetEpisodeHeaderData(db *sql.DB, feedID, episodeID int64) (feedTitle, episodeTitle, author, episodeLink, dateString, mediaContent string, err error)
GetEpisodeHeaderData -- Gets the infomation needed to create the episode header
func GetEpisodeIDByFeedIDAndTitle ¶
func GetEpisodeIDByFeedIDAndTitle(db *sql.DB, feedID int64, episodeTitle string) (id int64, err error)
GetEpisodeIDByFeedIDAndTitle -- Gets the episodes using feed id and episode title
func GetEpisodeMediaContent ¶
GetEpisodeMediaContent -- Gets the episode's media content from the database
func GetFeedAuthor ¶
GetFeedAuthor -- returns the feed author
func GetFeedAuthorID ¶
GetFeedAuthorID -- returns the feed's author ID
func GetFeedDataFromSite ¶
GetFeedDataFromSite -- gets the feed data from the feed url and returns it
func GetFeedEpisodeIDs ¶
GetFeedEpisodeIDs -- return ???
func GetFeedEpisodeSeenRatio ¶
GetFeedEpisodeSeenRatio -- return the seen over total episode seen for a feed.
func GetFeedInfo ¶
GetFeedInfo -- Pulls the rss feed from the website and dumps the needed info into the database
func GetFeedRawData ¶
GetFeedRawData -- returns the feed's raw data
func GetFeedTagID ¶
GetFeedTagID -- gets the id for a feed tag
func GetFeedTitle ¶
GetFeedTitle -- returns the feed title
func GetFeedURL ¶
GetFeedURL -- returnd the feed's url
func IsFeedDeleted ¶
IsFeedDeleted -- Checks to see if the feed is currently marked as deleted
func IsFeedTagDeleted ¶
IsFeedTagDeleted -- Checks to see if the feed tag is currently marked as deleted
func MarkEpisodeAsSeen ¶
MarkEpisodeAsSeen -- marks and episode as seen
func UndeleteFeed ¶
UndeleteFeed -- Flips the delete flag off for a feed in the database
func UndeleteFeedTag ¶
UndeleteFeedTag -- Flips the delete flag off for a feed tag in the database
func UpdateEpisodeAuthor ¶
UpdateEpisodeAuthor -- Updates the author associated with the episode
func UpdateEpisodeMediaContent ¶
UpdateEpisodeMediaContent -- updates the media content to the database
func UpdateFeedAuthor ¶
UpdateFeedAuthor -- Updates the feed's author
func UpdateFeedRawData ¶
UpdateFeedRawData -- Updates the feed's raw data
Types ¶
type Feed ¶
Feed -- Data structure used to hold a feed
type Feeds ¶
type Feeds []*Feed
Feeds -- A slice of feeds