Documentation
¶
Index ¶
- Constants
- func CategoriesSortingOptions() map[string]string
- func HomePages() map[string]string
- func OptionalInt(value int) *int
- func OptionalInt64(value int64) *int64
- func OptionalString(value string) *string
- func ThemeColor(theme, colorScheme string) string
- func Themes() map[string]string
- type APIKey
- type APIKeys
- type Categories
- type Category
- type CategoryRequest
- type Enclosure
- type EnclosureList
- type Entries
- type EntriesStatusUpdateRequest
- type Entry
- type Feed
- type FeedCounters
- type FeedCreationRequest
- type FeedIcon
- type FeedModificationRequest
- type Feeds
- type Icon
- type Icons
- type Integration
- type Job
- type JobList
- type Session
- type SessionData
- type SubscriptionDiscoveryRequest
- type User
- type UserCreationRequest
- type UserModificationRequest
- type UserSession
- type UserSessions
- type Users
Constants ¶
const ( EntryStatusUnread = "unread" EntryStatusRead = "read" EntryStatusRemoved = "removed" DefaultSortingOrder = "published_at" DefaultSortingDirection = "asc" )
Entry statuses and default sorting order.
const ( SchedulerRoundRobin = "round_robin" SchedulerEntryFrequency = "entry_frequency" // Default settings for the feed query builder DefaultFeedSorting = "parsing_error_count" DefaultFeedSortingDirection = "desc" )
List of supported schedulers.
Variables ¶
This section is empty.
Functions ¶
func OptionalInt64 ¶
OptionalInt64 populates an optional int64 field.
func OptionalString ¶
OptionalString populates an optional string field.
func ThemeColor ¶
ThemeColor returns the color for the address bar or/and the browser color. https://developer.mozilla.org/en-US/docs/Web/Manifest#theme_color https://developers.google.com/web/tools/lighthouse/audits/address-bar https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
Types ¶
type APIKey ¶
type APIKey struct {
ID int64
UserID int64
Token string
Description string
LastUsedAt *time.Time
CreatedAt time.Time
}
APIKey represents an application API key.
type Category ¶
type Category struct {
ID int64 `json:"id"`
Title string `json:"title"`
UserID int64 `json:"user_id"`
HideGlobally bool `json:"hide_globally"`
FeedCount *int `json:"feed_count,omitempty"`
TotalUnread *int `json:"total_unread,omitempty"`
}
Category represents a feed category.
type CategoryRequest ¶
type CategoryRequest struct {
Title string `json:"title"`
HideGlobally string `json:"hide_globally"`
}
CategoryRequest represents the request to create or update a category.
func (*CategoryRequest) Patch ¶
func (cr *CategoryRequest) Patch(category *Category)
Patch updates category fields.
type Enclosure ¶
type Enclosure struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
EntryID int64 `json:"entry_id"`
URL string `json:"url"`
MimeType string `json:"mime_type"`
Size int64 `json:"size"`
MediaProgression int64 `json:"media_progression"`
}
Enclosure represents an attachment.
func (Enclosure) Html5MimeType ¶
Html5MimeType will modify the actual MimeType to allow direct playback from HTML5 player for some kind of MimeType
type EnclosureList ¶
type EnclosureList []*Enclosure
EnclosureList represents a list of attachments.
type EntriesStatusUpdateRequest ¶
type EntriesStatusUpdateRequest struct {
EntryIDs []int64 `json:"entry_ids"`
Status string `json:"status"`
}
EntriesStatusUpdateRequest represents a request to change entries status.
type Entry ¶
type Entry struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
FeedID int64 `json:"feed_id"`
Status string `json:"status"`
Hash string `json:"hash"`
Title string `json:"title"`
URL string `json:"url"`
CommentsURL string `json:"comments_url"`
Date time.Time `json:"published_at"`
CreatedAt time.Time `json:"created_at"`
ChangedAt time.Time `json:"changed_at"`
Content string `json:"content"`
Author string `json:"author"`
Starred bool `json:"starred"`
ReadingTime int `json:"reading_time"`
Enclosures EnclosureList `json:"enclosures"`
Feed *Feed `json:"feed,omitempty"`
Tags []string `json:"tags"`
}
Entry represents a feed item in the system.
type Feed ¶
type Feed struct {
ID int64 `json:"id"`
UserID int64 `json:"user_id"`
FeedURL string `json:"feed_url"`
SiteURL string `json:"site_url"`
Title string `json:"title"`
CheckedAt time.Time `json:"checked_at"`
NextCheckAt time.Time `json:"next_check_at"`
EtagHeader string `json:"etag_header"`
LastModifiedHeader string `json:"last_modified_header"`
ParsingErrorMsg string `json:"parsing_error_message"`
ParsingErrorCount int `json:"parsing_error_count"`
ScraperRules string `json:"scraper_rules"`
RewriteRules string `json:"rewrite_rules"`
Crawler bool `json:"crawler"`
BlocklistRules string `json:"blocklist_rules"`
KeeplistRules string `json:"keeplist_rules"`
UrlRewriteRules string `json:"urlrewrite_rules"`
UserAgent string `json:"user_agent"`
Cookie string `json:"cookie"`
Username string `json:"username"`
Password string `json:"password"`
Disabled bool `json:"disabled"`
NoMediaPlayer bool `json:"no_media_player"`
IgnoreHTTPCache bool `json:"ignore_http_cache"`
AllowSelfSignedCertificates bool `json:"allow_self_signed_certificates"`
FetchViaProxy bool `json:"fetch_via_proxy"`
Category *Category `json:"category,omitempty"`
Entries Entries `json:"entries,omitempty"`
IconURL string `json:"icon_url"`
Icon *FeedIcon `json:"icon"`
HideGlobally bool `json:"hide_globally"`
UnreadCount int `json:"-"`
ReadCount int `json:"-"`
}
Feed represents a feed in the application.
func (*Feed) CheckedNow ¶
func (f *Feed) CheckedNow()
CheckedNow set attribute values when the feed is refreshed.
func (*Feed) ResetErrorCounter ¶
func (f *Feed) ResetErrorCounter()
ResetErrorCounter removes all previous errors.
func (*Feed) ScheduleNextCheck ¶
ScheduleNextCheck set "next_check_at" of a feed based on the scheduler selected from the configuration.
func (*Feed) WithCategoryID ¶
WithCategoryID initializes the category attribute of the feed.
func (*Feed) WithClientResponse ¶
WithClientResponse updates feed attributes from an HTTP request.
type FeedCounters ¶
type FeedCreationRequest ¶
type FeedCreationRequest struct {
FeedURL string `json:"feed_url"`
CategoryID int64 `json:"category_id"`
UserAgent string `json:"user_agent"`
Cookie string `json:"cookie"`
Username string `json:"username"`
Password string `json:"password"`
Crawler bool `json:"crawler"`
Disabled bool `json:"disabled"`
NoMediaPlayer bool `json:"no_media_player"`
IgnoreHTTPCache bool `json:"ignore_http_cache"`
AllowSelfSignedCertificates bool `json:"allow_self_signed_certificates"`
FetchViaProxy bool `json:"fetch_via_proxy"`
ScraperRules string `json:"scraper_rules"`
RewriteRules string `json:"rewrite_rules"`
BlocklistRules string `json:"blocklist_rules"`
KeeplistRules string `json:"keeplist_rules"`
HideGlobally bool `json:"hide_globally"`
UrlRewriteRules string `json:"urlrewrite_rules"`
}
FeedCreationRequest represents the request to create a feed.
type FeedModificationRequest ¶
type FeedModificationRequest struct {
FeedURL *string `json:"feed_url"`
SiteURL *string `json:"site_url"`
Title *string `json:"title"`
ScraperRules *string `json:"scraper_rules"`
RewriteRules *string `json:"rewrite_rules"`
BlocklistRules *string `json:"blocklist_rules"`
KeeplistRules *string `json:"keeplist_rules"`
UrlRewriteRules *string `json:"urlrewrite_rules"`
Crawler *bool `json:"crawler"`
UserAgent *string `json:"user_agent"`
Cookie *string `json:"cookie"`
Username *string `json:"username"`
Password *string `json:"password"`
CategoryID *int64 `json:"category_id"`
Disabled *bool `json:"disabled"`
NoMediaPlayer *bool `json:"no_media_player"`
IgnoreHTTPCache *bool `json:"ignore_http_cache"`
AllowSelfSignedCertificates *bool `json:"allow_self_signed_certificates"`
FetchViaProxy *bool `json:"fetch_via_proxy"`
HideGlobally *bool `json:"hide_globally"`
}
FeedModificationRequest represents the request to update a feed.
func (*FeedModificationRequest) Patch ¶
func (f *FeedModificationRequest) Patch(feed *Feed)
Patch updates a feed with modified values.
type Icon ¶
type Icon struct {
ID int64 `json:"id"`
Hash string `json:"hash"`
MimeType string `json:"mime_type"`
Content []byte `json:"content"`
}
Icon represents a website icon (favicon)
type Integration ¶
type Integration struct {
UserID int64
PinboardEnabled bool
PinboardToken string
PinboardTags string
PinboardMarkAsUnread bool
InstapaperEnabled bool
InstapaperUsername string
InstapaperPassword string
FeverEnabled bool
FeverUsername string
FeverToken string
GoogleReaderEnabled bool
GoogleReaderUsername string
GoogleReaderPassword string
WallabagEnabled bool
WallabagOnlyURL bool
WallabagURL string
WallabagClientID string
WallabagClientSecret string
WallabagUsername string
WallabagPassword string
NunuxKeeperEnabled bool
NunuxKeeperURL string
NunuxKeeperAPIKey string
NotionEnabled bool
NotionToken string
NotionPageID string
EspialEnabled bool
EspialURL string
EspialAPIKey string
EspialTags string
PocketEnabled bool
PocketAccessToken string
PocketConsumerKey string
TelegramBotEnabled bool
TelegramBotToken string
TelegramBotChatID string
LinkdingEnabled bool
LinkdingURL string
LinkdingAPIKey string
LinkdingTags string
LinkdingMarkAsUnread bool
MatrixBotEnabled bool
MatrixBotUser string
MatrixBotPassword string
MatrixBotURL string
MatrixBotChatID string
}
Integration represents user integration settings.
type Session ¶
type Session struct {
ID string
Data *SessionData
}
Session represents a session in the system.
type SessionData ¶
type SessionData struct {
CSRF string `json:"csrf"`
OAuth2State string `json:"oauth2_state"`
FlashMessage string `json:"flash_message"`
FlashErrorMessage string `json:"flash_error_message"`
Language string `json:"language"`
Theme string `json:"theme"`
PocketRequestToken string `json:"pocket_request_token"`
}
SessionData represents the data attached to the session.
func (*SessionData) Scan ¶
func (s *SessionData) Scan(src interface{}) error
Scan converts raw JSON data.
func (SessionData) String ¶
func (s SessionData) String() string
type SubscriptionDiscoveryRequest ¶
type SubscriptionDiscoveryRequest struct {
URL string `json:"url"`
UserAgent string `json:"user_agent"`
Cookie string `json:"cookie"`
Username string `json:"username"`
Password string `json:"password"`
FetchViaProxy bool `json:"fetch_via_proxy"`
AllowSelfSignedCertificates bool `json:"allow_self_signed_certificates"`
}
SubscriptionDiscoveryRequest represents a request to discover subscriptions.
type User ¶
type User struct {
ID int64 `json:"id"`
Username string `json:"username"`
Password string `json:"-"`
IsAdmin bool `json:"is_admin"`
Theme string `json:"theme"`
Language string `json:"language"`
Timezone string `json:"timezone"`
EntryDirection string `json:"entry_sorting_direction"`
EntryOrder string `json:"entry_sorting_order"`
Stylesheet string `json:"stylesheet"`
GoogleID string `json:"google_id"`
OpenIDConnectID string `json:"openid_connect_id"`
EntriesPerPage int `json:"entries_per_page"`
KeyboardShortcuts bool `json:"keyboard_shortcuts"`
ShowReadingTime bool `json:"show_reading_time"`
EntrySwipe bool `json:"entry_swipe"`
LastLoginAt *time.Time `json:"last_login_at"`
DisplayMode string `json:"display_mode"`
DefaultReadingSpeed int `json:"default_reading_speed"`
CJKReadingSpeed int `json:"cjk_reading_speed"`
DefaultHomePage string `json:"default_home_page"`
CategoriesSortingOrder string `json:"categories_sorting_order"`
MarkReadOnView bool `json:"mark_read_on_view"`
}
User represents a user in the system.
func (*User) UseTimezone ¶
UseTimezone converts last login date to the given timezone.
type UserCreationRequest ¶
type UserCreationRequest struct {
Username string `json:"username"`
Password string `json:"password"`
IsAdmin bool `json:"is_admin"`
GoogleID string `json:"google_id"`
OpenIDConnectID string `json:"openid_connect_id"`
}
UserCreationRequest represents the request to create a user.
type UserModificationRequest ¶
type UserModificationRequest struct {
Username *string `json:"username"`
Password *string `json:"password"`
Theme *string `json:"theme"`
Language *string `json:"language"`
Timezone *string `json:"timezone"`
EntryDirection *string `json:"entry_sorting_direction"`
EntryOrder *string `json:"entry_sorting_order"`
Stylesheet *string `json:"stylesheet"`
GoogleID *string `json:"google_id"`
OpenIDConnectID *string `json:"openid_connect_id"`
EntriesPerPage *int `json:"entries_per_page"`
IsAdmin *bool `json:"is_admin"`
KeyboardShortcuts *bool `json:"keyboard_shortcuts"`
ShowReadingTime *bool `json:"show_reading_time"`
EntrySwipe *bool `json:"entry_swipe"`
DisplayMode *string `json:"display_mode"`
DefaultReadingSpeed *int `json:"default_reading_speed"`
CJKReadingSpeed *int `json:"cjk_reading_speed"`
DefaultHomePage *string `json:"default_home_page"`
CategoriesSortingOrder *string `json:"categories_sorting_order"`
MarkReadOnView *bool `json:"mark_read_on_view"`
}
UserModificationRequest represents the request to update a user.
func (*UserModificationRequest) Patch ¶
func (u *UserModificationRequest) Patch(user *User)
Patch updates the User object with the modification request.
type UserSession ¶
type UserSession struct {
ID int64
UserID int64
Token string
CreatedAt time.Time
UserAgent string
IP string
}
UserSession represents a user session in the system.
func (*UserSession) String ¶
func (u *UserSession) String() string
func (*UserSession) UseTimezone ¶
func (u *UserSession) UseTimezone(tz string)
UseTimezone converts creation date to the given timezone.
type UserSessions ¶
type UserSessions []*UserSession
UserSessions represents a list of sessions.
func (UserSessions) UseTimezone ¶
func (u UserSessions) UseTimezone(tz string)
UseTimezone converts creation date of all sessions to the given timezone.