Documentation
¶
Overview ¶
Package model provides the data types used across the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Feed ¶
type Feed struct {
ID int64 `json:"id,omitempty"`
Title string `json:"title"`
URL *url.URL `json:"url"`
Homepage *url.URL `json:"homepage"`
UpdateInterval time.Duration `json:"interval"`
LastRefresh time.Time `json:"last_refresh,omitempty"`
Active bool `json:"active,omitempty"`
}
Feed is an RSS feed. Duh.
type Item ¶
type Item struct {
ID int64 `json:"id"`
FeedID int64 `json:"feed_id"`
URL *url.URL `json:"url"`
Timestamp time.Time `json:"timestamp"`
Headline string `json:"headline"`
Description string `json:"description"`
Rating int8 `json:"rating"`
Guessed int8 `json:"guessed"`
Tags []*Tag `json:"tags"`
// contains filtered or unexported fields
}
Item is a single news item
func (*Item) EffectiveRating ¶ added in v0.2.0
EffectiveRating returns the Item's Rating, *if* it has been rated, the guessed Rating, if one is stored in the Item, else zero.
func (*Item) HasTag ¶ added in v0.6.0
HasTag returns true if the Tag with the given id is found in the Item's list of Tags.
type Search ¶ added in v0.14.0
type Search struct {
ID int64 `json:"id"`
Title string `json:"title"`
TimeCreated time.Time `json:"time_created"`
TimeStarted time.Time `json:"time_started"`
TimeFinished time.Time `json:"time_finished"`
Status bool `json:"status"`
Message string `json:"message"`
Tags []int64 `json:"tags"`
TagsAll bool `json:"tags_all"`
FilterByPeriod bool `json:"filter_by_period"`
FilterPeriod [2]time.Time `json:"filter_period"`
QueryString string `json:"query_string"`
Regex bool `json:"regexp"`
Results []*Item `json:"results"`
// contains filtered or unexported fields
}
Search represents the parameters of a search query. Regex, if true, indicates the Query text should be handled as a regular expression. TagsAll, if true, indicates the query is looking for Items that have ALL the supplied Tags linked to them.
func (*Search) IsFinished ¶ added in v0.14.0
IsFinished returns true if the Search query has a Finished timestamp that is later than its Started timestamp.
type Tag ¶ added in v0.3.0
type Tag struct {
ID int64 `json:"id"`
Parent int64 `json:"parent,omitempty"`
Name string `json:"name"`
Level int64 `json:"level"`
FullName string `json:"full_name"`
}
Tag is a label that can be attached to an Item. A Tag can also have a Parent Tag, which allows to organize them in a hierarchy.