Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Feed ¶
type Feed interface { Name() string Description() string URL() string // Next returns the next post in the feed. // // A feed typically models an existing resource, e.g. posts from an RSS feed // or posts from a database that is then iterated over using `Next`. // // An error matching errors.Is(err, io.EOF) indicates that there are no // more posts. Next() (*Post, error) Close() error }
Feed represent of feed of posts from a given source.
type Notes ¶
type Notes interface {
Notes() string
}
Notes is an extension that Feeds might implement, which add arbitrary notes to a feed.
They are currently used to add debugging info to a feed, e.g. if there was an error while updating it or if it is cached.
type Open ¶
Open is a function that opens a feed identified by `name`.
All feeds currently implement this.
type OpenCached ¶
OpenCached is a function that caches the feed identified by `name`.
database.OpenCached is currently the only implementation, backed by sqlite.
type Post ¶
type Post struct { Source string ID string `xml:"guid"` Author string AvatarURL string URL string `xml:"link"` Title string `xml:"title"` DescriptionHTML string `xml:"description"` Tags []string `xml:"category"` DateString string `xml:"pubDate"` Date time.Time }
Post is a single post, e.g. a blog post or a tweet.
type Search ¶
type Search struct { IsActive bool BeforeID string NoReblogs bool Skip bool Terms []string Tags []string ExcludeTerms []string ExcludeTags []string ForceFresh bool // contains filtered or unexported fields }
Search represents a search in a feed.
func FromRequest ¶
FromRequest parses search info from the request.
Search.IsActive if there is a search happening.
func ParseTerms ¶
ParseTerms parses the search terms from the given string.
type Static ¶
Static is a feed that contains exactly the Posts specified.
func (*Static) Description ¶
Description implements Feed.Description
type StatusError ¶
type StatusError struct {
Code int
}
StatusError is an error with an HTTP status code.
func (StatusError) Error ¶
func (se StatusError) Error() string