Documentation ¶
Index ¶
- Constants
- func CategoriesSortingOptions() map[string]string
- func HomePages() map[string]string
- func OptionalNumber[T Number](value T) *T
- 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 EnclosureUpdateRequest
- type Entries
- type EntriesStatusUpdateRequest
- type Entry
- type EntryUpdateRequest
- type Feed
- type FeedCounters
- type FeedCreationRequest
- type FeedCreationRequestFromSubscriptionDiscovery
- type FeedIcon
- type FeedModificationRequest
- type Feeds
- type Icon
- type Icons
- type Integration
- type Job
- type JobList
- type Number
- type Session
- type SessionData
- type SubscriptionDiscoveryRequest
- type User
- type UserCreationRequest
- type UserModificationRequest
- type UserSession
- type UserSessions
- type Users
- type WebAuthnCredential
- type WebAuthnSession
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 OptionalNumber ¶ added in v2.1.2
func OptionalNumber[T Number](value T) *T
func OptionalString ¶
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
func (*Enclosure) ProxifyEnclosureURL ¶ added in v2.2.0
type EnclosureList ¶
type EnclosureList []*Enclosure
EnclosureList represents a list of attachments.
func (EnclosureList) ContainsAudioOrVideo ¶ added in v2.2.0
func (el EnclosureList) ContainsAudioOrVideo() bool
func (EnclosureList) FindMediaPlayerEnclosure ¶ added in v2.2.3
func (el EnclosureList) FindMediaPlayerEnclosure() *Enclosure
FindMediaPlayerEnclosure returns the first enclosure that can be played by a media player.
func (EnclosureList) ProxifyEnclosureURL ¶ added in v2.2.0
func (el EnclosureList) ProxifyEnclosureURL(router *mux.Router)
type EnclosureUpdateRequest ¶ added in v2.2.0
type EnclosureUpdateRequest struct {
MediaProgression int64 `json:"media_progression"`
}
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.
func (*Entry) ShouldMarkAsReadOnView ¶ added in v2.2.0
ShouldMarkAsReadOnView Return whether the entry should be marked as viewed considering all user settings and entry state.
type EntryUpdateRequest ¶ added in v2.0.49
EntryUpdateRequest represents a request to update an entry.
func (*EntryUpdateRequest) Patch ¶ added in v2.0.49
func (e *EntryUpdateRequest) Patch(entry *Entry)
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"` Description string `json:"description"` 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"` HideGlobally bool `json:"hide_globally"` DisableHTTP2 bool `json:"disable_http2"` AppriseServiceURLs string `json:"apprise_service_urls"` NtfyEnabled bool `json:"ntfy_enabled"` NtfyPriority int `json:"ntfy_priority"` // Non-persisted attributes Category *Category `json:"category,omitempty"` Icon *FeedIcon `json:"icon"` Entries Entries `json:"entries,omitempty"` // Internal attributes (not exposed in the API and not persisted in the database) TTL int `json:"-"` IconURL string `json:"-"` UnreadCount int `json:"-"` ReadCount int `json:"-"` NumberOfVisibleEntries 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) WithTranslatedErrorMessage ¶ added in v2.0.51
WithTranslatedErrorMessage adds a new error message and increment the error counter.
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"` DisableHTTP2 bool `json:"disable_http2"` }
FeedCreationRequest represents the request to create a feed.
type FeedCreationRequestFromSubscriptionDiscovery ¶ added in v2.0.51
type FeedCreationRequestFromSubscriptionDiscovery struct { Content io.ReadSeeker ETag string LastModified string FeedCreationRequest }
type FeedModificationRequest ¶
type FeedModificationRequest struct { FeedURL *string `json:"feed_url"` SiteURL *string `json:"site_url"` Title *string `json:"title"` Description *string `json:"description"` 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"` DisableHTTP2 *bool `json:"disable_http2"` }
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:"-"` }
Icon represents a website icon (favicon)
type Integration ¶
type Integration struct { UserID int64 BetulaEnabled bool BetulaURL string BetulaToken string 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 ReadwiseEnabled bool ReadwiseAPIKey string PocketEnabled bool PocketAccessToken string PocketConsumerKey string TelegramBotEnabled bool TelegramBotToken string TelegramBotChatID string TelegramBotTopicID *int64 TelegramBotDisableWebPagePreview bool TelegramBotDisableNotification bool TelegramBotDisableButtons bool LinkAceEnabled bool LinkAceURL string LinkAceAPIKey string LinkAceTags string LinkAcePrivate bool LinkAceCheckDisabled bool LinkdingEnabled bool LinkdingURL string LinkdingAPIKey string LinkdingTags string LinkdingMarkAsUnread bool LinkwardenEnabled bool LinkwardenURL string LinkwardenAPIKey string MatrixBotEnabled bool MatrixBotUser string MatrixBotPassword string MatrixBotURL string MatrixBotChatID string AppriseEnabled bool AppriseURL string AppriseServicesURL string ReadeckEnabled bool ReadeckURL string ReadeckAPIKey string ReadeckLabels string ReadeckOnlyURL bool ShioriEnabled bool ShioriURL string ShioriUsername string ShioriPassword string ShaarliEnabled bool ShaarliURL string ShaarliAPISecret string WebhookEnabled bool WebhookURL string WebhookSecret string RSSBridgeEnabled bool RSSBridgeURL string OmnivoreEnabled bool OmnivoreAPIKey string OmnivoreURL string RaindropEnabled bool RaindropToken string RaindropCollectionID string RaindropTags string NtfyEnabled bool NtfyTopic string NtfyURL string NtfyAPIToken string NtfyUsername string NtfyPassword string NtfyIconURL string CuboxEnabled bool CuboxAPILink 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"` OAuth2CodeVerifier string `json:"oauth2_code_verifier"` 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"` LastForceRefresh string `json:"last_force_refresh"` WebAuthnSessionData WebAuthnSession `json:"webauthn_session_data"` }
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"` DisableHTTP2 bool `json:"disable_http2"` }
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"` CustomJS string `json:"custom_js"` ExternalFontHosts string `json:"external_font_hosts"` 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"` MarkReadOnMediaPlayerCompletion bool `json:"mark_read_on_media_player_completion"` MediaPlaybackRate float64 `json:"media_playback_rate"` BlockFilterEntryRules string `json:"block_filter_entry_rules"` KeepFilterEntryRules string `json:"keep_filter_entry_rules"` }
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"` CustomJS *string `json:"custom_js"` ExternalFontHosts *string `json:"external_font_hosts"` 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"` MarkReadOnMediaPlayerCompletion *bool `json:"mark_read_on_media_player_completion"` MediaPlaybackRate *float64 `json:"media_playback_rate"` BlockFilterEntryRules *string `json:"block_filter_entry_rules"` KeepFilterEntryRules *string `json:"keep_filter_entry_rules"` }
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.
type Users ¶
type Users []*User
Users represents a list of users.
func (Users) UseTimezone ¶
UseTimezone converts last login timestamp of all users to the given timezone.
type WebAuthnCredential ¶ added in v2.0.51
type WebAuthnCredential struct { Credential webauthn.Credential Name string AddedOn *time.Time LastSeenOn *time.Time Handle []byte }
func (WebAuthnCredential) HandleEncoded ¶ added in v2.0.51
func (s WebAuthnCredential) HandleEncoded() string
type WebAuthnSession ¶ added in v2.0.51
type WebAuthnSession struct {
*webauthn.SessionData
}
handle marshalling / unmarshalling session data
func (*WebAuthnSession) Scan ¶ added in v2.0.51
func (s *WebAuthnSession) Scan(value interface{}) error
func (WebAuthnSession) String ¶ added in v2.0.51
func (s WebAuthnSession) String() string