Documentation ¶
Index ¶
Constants ¶
View Source
const ( DBFeedSchema = `` /* 579-byte string literal not displayed */ DBFeedFormatsSchema = `CREATE TABLE IF NOT EXISTS feed_formats ( id INTEGER PRIMARY KEY, format_name TEXT NOT NULL UNIQUE )` )
View Source
const ( QDeleteFeedById = `DELETE FROM feeds WHERE feed_id = ?` QGetFeed = `SELECT * FROM feeds WHERE feed_id = ?` QGetFeedByName = `SELECT * FROM feeds WHERE name = ?` QGetFeedByURL = `SELECT * FROM feeds WHERE url = ?` QListFeeds = `` /* 462-byte string literal not displayed */ )
View Source
const (
MsgOK = "OK"
)
Variables ¶
View Source
var ( ErrDoesNotExist = errors.New("does not exist") ErrAlreadyExists = errors.New("already exists") )
View Source
var DB = db.DB
sqlite> SELECT feeds.name, url, feed_formats.name AS format_name from feeds JOIN feed_formats ON feeds.format = feed_formats.id;
View Source
var (
ErrNotInt = "expected int"
)
View Source
var FeedFormats = map[FeedFormat]string{ FormatRSS: "RSS", FormatHTML: "HTML", FormatJSON: "JSON", FormatTweet: "TWEET", FormatRFC: "RFC", FormatGHRelease: "GithubRelease", }
Functions ¶
func DeleteById ¶
Types ¶
type Feed ¶
type Feed struct { FeedID int64 `json:"id" db:"feed_id"` Name string `json:"name" db:"name"` Section string `json:"section,omitempty"` Categories types.StringList `json:"categories,omitempty"` Description string `json:"description"` Url string `json:"url"` Format FeedFormat `json:"-"` FormatString string `json:"format" db:"format_name"` LastRefresh time.Time `db:"last_refresh" json:"last_refresh"` // timestamp time.Unix() Created time.Time `json:"created"` DisplayName string `db:"display_name"` Publications string `json:"-"` // This feed's posts should also be exported individually ExportPosts bool `json:"export_posts" db:"export_posts"` // Time in seconds between each polling job on the news feed Interval float64 `json:"refresh_interval"` Serial bool `json:"serial" db:"serial_run"` // Jobs for this feed should run in series // Items which only contain summaries and redirect to external content // like publications and newsletters UseExternalLink bool `json:"use_external_link" db:"use_external_link"` }
func (*Feed) ShouldRefresh ¶
Returns true if the feed should be refreshed
type FeedForm ¶
type FeedForm struct { Name string `form:"name" binding:"required"` Url string `form:"url" binding:"required"` Format FeedFormat `form:"format"` Categories []string `form:"categories"` Section string `form:"section"` }
type FeedFormat ¶
type FeedFormat int
const ( FormatRSS FeedFormat = iota FormatHTML FormatJSON FormatTweet FormatRFC FormatGHRelease )
Feed Formats
Click to show internal directories.
Click to hide internal directories.