Documentation
¶
Index ¶
Constants ¶
View Source
const ( FormatAtom = "atom" FormatRSS = "rss" )
View Source
const CacheTTLDefault = 60 // minutes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeedParams ¶
type FeedParams struct {
// Username is the Telegram channel username
Username string
// Format is the feed format, either "atom" or "rss"
Format string
// ExcludeWords is a list of words that will exclude a post if matched
ExcludeWords []string
// ExcludeCaseSensitive determines if exclusion matching is case-sensitive
ExcludeCaseSensitive bool
// CacheTTL is the cache time-to-live in minutes
// A value of 0 means no caching
CacheTTL int
}
FeedParams represents validated request parameters for feed generation
func NewFeedParamFromRequest ¶
func NewFeedParamFromRequest(r *http.Request) (*FeedParams, error)
NewFeedParamFromRequest parses and validates request parameters and creates a new FeedParams nolint: cyclop
type Post ¶
type Post struct {
// Post ID, e.g. 123
ID int
URL string
Title string
ContentHTML string
// True if this post contains only image(s) without text content
ImageOnly bool
// A preview image that goes to enclosure
Preview *Image
// Collection of all images in the post
Images []Image
// Date and time of the post in RFC3339 format.
Datetime time.Time
}
Click to show internal directories.
Click to hide internal directories.