Documentation ¶
Index ¶
- Constants
- Variables
- func IsNoContent(err error) bool
- func IsValidationError(err error) bool
- func NewValidationError(err error) error
- type Article
- type ArticleExtract
- type ArticleID
- type Extract
- type Feed
- type FeedID
- type Filter
- type Login
- type ProfileData
- type QueryOpt
- func FeedIDs(ids []FeedID) QueryOpt
- func Filters(filters []Filter) QueryOpt
- func IDRange(after, before ArticleID) QueryOpt
- func IDs(ids []ArticleID) QueryOpt
- func Paging(limit, offset int) QueryOpt
- func ScoreRange(after, before int64) QueryOpt
- func Sorting(field sortingField, order sortingOrder) QueryOpt
- func TimeRange(after, before time.Time) QueryOpt
- type QueryOptions
- type Scores
- type Subscription
- type Tag
- type TagID
- type TagValue
- type Thumbnail
- type User
- type ValidationError
Constants ¶
View Source
const ( DefaultSort sortingField = iota SortByID SortByDate )
View Source
const ( AscendingOrder sortingOrder = iota DescendingOrder )
Variables ¶
View Source
var ( // ReadOnly sets the query for read articles. ReadOnly = QueryOpt{func(o *QueryOptions) { o.ReadOnly = true }} // UnreadOnly sets the query for unread articles. UnreadOnly = QueryOpt{func(o *QueryOptions) { o.UnreadOnly = true }} // UnreadFirst sets the query to return unread articles first. UnreadFirst = QueryOpt{func(o *QueryOptions) { o.UnreadFirst = true }} // FavoriteOnly sets the query for favorite articles. FavoriteOnly = QueryOpt{func(o *QueryOptions) { o.FavoriteOnly = true }} // UntaggedOnly sets the query for untagged articles. UntaggedOnly = QueryOpt{func(o *QueryOptions) { o.UntaggedOnly = true }} // IncludeScores sets the query to return articles' score information. IncludeScores = QueryOpt{func(o *QueryOptions) { o.IncludeScores = true }} // HighScoredFirst sets the query to return articles with high scores first. HighScoredFirst = QueryOpt{func(o *QueryOptions) { o.HighScoredFirst = true }} )
View Source
var (
ErrNoContent = errors.New("No content")
)
Functions ¶
func IsNoContent ¶
func IsValidationError ¶
func NewValidationError ¶
Types ¶
type Article ¶
type Article struct { ID ArticleID `json:"id"` Guid sql.NullString `json:"-"` FeedID FeedID `db:"feed_id" json:"feedID"` Title string `json:"title"` Description string `json:"description"` Link string `json:"link"` Date time.Time `json:"date"` Read bool `json:"read"` Favorite bool `json:"favorite"` Score int64 `json:"score,omitempty"` Thumbnail string `json:"thumbnail,omitempty"` ThumbnailLink string `db:"thumbnail_link" json:"thumbnailLink,omitempty"` IsNew bool `json:"-"` Hit struct { Fragments map[string][]string `json:"fragments,omitempty"` } `json:"hits"` }
type ArticleExtract ¶
type Extract ¶
type Feed ¶
type Feed struct { ID FeedID `json:"id"` Title string `json:"title"` Description string `json:"description"` Link string `json:"link"` SiteLink string `db:"site_link" json:"-"` HubLink string `db:"hub_link" json:"-"` UpdateError string `db:"update_error" json:"updateError"` SubscribeError string `db:"subscribe_error" json:"subscribeError"` TTL time.Duration `json:"-"` SkipHours map[int]bool `json:"-"` SkipDays map[string]bool `json:"-"` // contains filtered or unexported fields }
func (*Feed) AddUpdateError ¶
func (Feed) ParsedArticles ¶
type Filter ¶
type Filter struct { TagID TagID `json:"tagID"` FeedIDs []FeedID `json:"feedIDs"` InverseFeeds bool `json:"inverseFeeds"` URLTerm string `json:"urlTerm"` TitleTerm string `json:"titleTerm"` InverseURL bool `json:"inverseURL"` InverseTitle bool `json:"inverseTitle"` }
func GetUserFilters ¶
type ProfileData ¶
type ProfileData map[string]interface{}
func (*ProfileData) Scan ¶
func (val *ProfileData) Scan(src interface{}) error
func (*ProfileData) UnmarshalJSON ¶
func (p *ProfileData) UnmarshalJSON(b []byte) error
type QueryOpt ¶
type QueryOpt struct {
// contains filtered or unexported fields
}
QueryOpt is a single query option.
func ScoreRange ¶
ScoreRange sets the minimum and maximum scores of returned articles.
type QueryOptions ¶
type QueryOptions struct { Limit int Offset int ReadOnly bool UnreadOnly bool UnreadFirst bool FavoriteOnly bool UntaggedOnly bool IncludeScores bool HighScoredFirst bool BeforeID ArticleID AfterID ArticleID BeforeDate time.Time AfterDate time.Time BeforeScore int64 AfterScore int64 IDs []ArticleID FeedIDs []FeedID Filters []Filter SortField sortingField SortOrder sortingOrder }
QueryOptions is the full range of options for querying articles.
func (*QueryOptions) Apply ¶
func (o *QueryOptions) Apply(opts []QueryOpt)
Apply applies the settings from the passed opts to the QueryOptions
type Scores ¶
type Scores struct { ArticleID ArticleID `db:"article_id"` Score int64 Score1 int64 Score2 int64 Score3 int64 Score4 int64 Score5 int64 }
Scores contains the calculated popularity score of an article.
type Subscription ¶
type Subscription struct { FeedID FeedID `db:"feed_id"` Link string `db:"link"` LeaseDuration int64 `db:"lease_duration"` VerificationTime time.Time `db:"verification_time"` SubscriptionFailure bool `db:"subscription_failure"` }
func (Subscription) String ¶
func (s Subscription) String() string
func (Subscription) Validate ¶
func (s Subscription) Validate() error
type Thumbnail ¶
type User ¶
type User struct { Login Login `json:"login"` FirstName string `db:"first_name" json:"firstName"` LastName string `db:"last_name" json:"lastName"` Email string `json:"email"` HashType string `db:"hash_type" json:"-"` Admin bool `json:"admin"` Active bool `json:"active"` Salt []byte `json:"-"` Hash []byte `json:"-"` MD5API []byte `db:"md5_api" json:"-"` // "md5(user:pass)" ProfileData ProfileData `db:"profile_data" json:"profileData"` }
User represents a readeef user.
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.