Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeedWatcher ¶
type FeedWatcher struct { URL string Client http.Client Handler ItemHandler // contains filtered or unexported fields }
FeedWatcher implements a small service to watch an RSS feed and discover new activity
func NewFeedWatcher ¶
func NewFeedWatcher(url string, handler ItemHandler) FeedWatcher
func (*FeedWatcher) AddKnown ¶
func (c *FeedWatcher) AddKnown(item Item)
type Item ¶
type Item struct { ID string Title string Published time.Time Updated time.Time Content string URL string }
Item is our internal, minimalist representation of a blog post
type ItemHandler ¶
type ItemHandler interface { StatusCode(code int) // called after any fetch, normally either 200 (OK) or 304 (NotModified) NewItem(item Item) // a new feed item is discovered }
ItemHandler is an interface that defines what to do when new RSS items are discovered
Click to show internal directories.
Click to hide internal directories.