Documentation
¶
Index ¶
- func Display(w io.Writer, feedItems []FeedItem, displayMode DisplayMode, ...) error
- func GetFeedsAsync(urls []string) <-chan *Feed
- func GetURLs(r io.Reader) []string
- func RunApp(feeds <-chan *Feed, mode DisplayMode, opts ...AppOption) error
- type AppOption
- type Browser
- type Channel
- type Colour
- type DisplayMode
- type DisplayOption
- type Feed
- type FeedItem
- type Filter
- type Filters
- type Item
- type Page
- type RSS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Display ¶
func Display(w io.Writer, feedItems []FeedItem, displayMode DisplayMode, opts ...DisplayOption) error
Display writes the feed items to the given writer in the provided display mode. Returns any error encountered by writing to w.
func GetFeedsAsync ¶
GetFeedsAsync makes requests to the hosts in parallel and writes the results to the returned channel as they are received.
Types ¶
type AppOption ¶
type AppOption func(*appOptions)
func WithDisplayOptions ¶
func WithDisplayOptions(opts ...DisplayOption) AppOption
func WithFilters ¶
type DisplayMode ¶
type DisplayOption ¶
func ColourAfter ¶
func ColourAfter(t time.Time) DisplayOption
type FeedItem ¶
type FeedItem struct { Title string Description string PublishTime time.Time Links []string Feed string Channel string }
func GetFeedItems ¶
GetFeedItems unpacks the items within the given feeds, applying filters if given.
func ReverseChronological ¶
func UnpackFeed ¶
type Filter ¶
func Deduplicate ¶
func Deduplicate() Filter
Deduplicate ensures that each feed item only appears in the output once.
func MaxItems ¶
MaxItems enforces a limit on the total number of items in the result. Passing zero in results in no limit.
func MaxItemsPerChannel ¶
MaxItemsPerChannel puts a limit on the number of items per channel. Passing zero in results in no limit
func OldestItem ¶
OldestItem ensures that the output feed items are less than the max age given.
type Item ¶
type Item struct { XMLName xml.Name `xml:"item"` Title string `xml:"title"` Link string `xml:"link"` PubDate string `xml:"pubDate"` GUID string `xml:"guid"` // Comments provide a link to a dedicated comments page e.g. hackernews Comments string `xml:"comments"` Description []byte `xml:"description"` }