Documentation
¶
Overview ¶
Package handlers contains chainable handlers/middleware for routing.
Index ¶
- Variables
- func AddSubscriptionFilter() http.HandlerFunc
- func AllSubscriptionsCtx(svc SubscriptionsService) func(next http.Handler) http.Handler
- func ArticleCtx(itemSvc ItemService) func(next http.Handler) http.Handler
- func DocumentationHandler(path string, appCfg AppConfig) http.HandlerFunc
- func GetSubscriptionActionSuggestions(subs SubscriptionsService) http.HandlerFunc
- func GetSubscriptionFilterSuggestions(svc SubscriptionsService) http.HandlerFunc
- func HandleAbout(appCfg AppConfig) http.HandlerFunc
- func HandleAccountCancel(appCfg AppConfig) http.HandlerFunc
- func HandleAccountIssue() http.HandlerFunc
- func HandleAccountSuccess() http.HandlerFunc
- func HandleAddFeedset(feeds FeedService, users UserService, subscriptions SubscriptionsService, ...) http.HandlerFunc
- func HandleAddGroupSubscription(subSvc SubscriptionsService, userSvc UserService, breadcrumbs Breadcrumbs) http.HandlerFunc
- func HandleAddNewFeedSubscription(subscriptions SubscriptionsService, users UserService, feeds FeedService, ...) http.HandlerFunc
- func HandleAddSearchSubscription(subSvc SubscriptionsService, userSvc UserService, breadcrumbs Breadcrumbs) http.HandlerFunc
- func HandleAddSubscription() http.HandlerFunc
- func HandleAddSubscriptionToGroup() http.HandlerFunc
- func HandleAddSubscriptionToSearch() http.HandlerFunc
- func HandleAndroidPurchase(userSvc UserService) http.HandlerFunc
- func HandleBrowseArticles(subSvc SubscriptionsService, itemSvc ItemService, direction string) http.HandlerFunc
- func HandleBulkMarkArticles(subsSvc SubscriptionsService, mark models.Mark) http.HandlerFunc
- func HandleBulkMarkSubscriptions(svc SubscriptionsService, mark models.Mark) http.HandlerFunc
- func HandleChangePassword() http.HandlerFunc
- func HandleChangelog(appCfg AppConfig) http.HandlerFunc
- func HandleChangelogFeed(appCfg AppConfig) http.HandlerFunc
- func HandleChooseAndroidSubscription(appCfg AppConfig) http.HandlerFunc
- func HandleChoosePaddleSubscription(appCfg AppConfig) http.HandlerFunc
- func HandleChooseSubscription(appCfg AppConfig) http.HandlerFunc
- func HandleComparison(appCfg AppConfig) http.HandlerFunc
- func HandleContact(appCfg AppConfig) http.HandlerFunc
- func HandleDeactivateAccount(users UserService, auth *auth0.Authenticator, sessionMgr SessionManager) http.HandlerFunc
- func HandleDiscover() http.HandlerFunc
- func HandleDiscoverSuggestions(feedSvc FeedService, httpClient *resty.Client) http.HandlerFunc
- func HandleEditSubscription(subSvc SubscriptionsService, breadcrumbs Breadcrumbs) http.HandlerFunc
- func HandleExportSubscriptions(feedSvc FeedService, breadcrumbs Breadcrumbs) http.HandlerFunc
- func HandleExternalError(err error) http.HandlerFunc
- func HandleFavoriteArticle(itemSvc ItemService, userSvc UserService) http.HandlerFunc
- func HandleFavoriteSubscription(svc SubscriptionsService) http.HandlerFunc
- func HandleFeatures(appCfg AppConfig) http.HandlerFunc
- func HandleFeaturesCollect(appCfg AppConfig) http.HandlerFunc
- func HandleFeaturesConsume(appCfg AppConfig) http.HandlerFunc
- func HandleFeaturesCurate(appCfg AppConfig) http.HandlerFunc
- func HandleFindSimilarArticles(itemSvc ItemService) http.HandlerFunc
- func HandleForgetMe() http.HandlerFunc
- func HandleGenerateSubscriptionEmail(users UserService) http.HandlerFunc
- func HandleHome(homepageSvc HomePageService) http.HandlerFunc
- func HandleImportSubscriptions(feeds FeedService, users UserService, subscriptions SubscriptionsService, ...) http.HandlerFunc
- func HandleInternalError(status int, err error, options ...ErrorOption) http.HandlerFunc
- func HandleLanding(appCfg AppConfig) http.HandlerFunc
- func HandleLinter(appCfg AppConfig, httpClient *resty.Client) http.HandlerFunc
- func HandleListArticles(itemSvc ItemService) http.HandlerFunc
- func HandleListArticlesUpdates(itemSvc ItemService) http.HandlerFunc
- func HandleListFavorites(subSvc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
- func HandleListSubscriptions(subscriptionSvc SubscriptionsService) http.HandlerFunc
- func HandleListSubscriptionsUpdates(itemSvc ItemService) http.HandlerFunc
- func HandleLogin(authenticator *auth0.Authenticator, session SessionManager) http.HandlerFunc
- func HandleLoginCallback(userSvc UserService, authenticator *auth0.Authenticator, ...) http.HandlerFunc
- func HandleLoginError(res http.ResponseWriter, req *http.Request)
- func HandleLogout(authenticator *auth0.Authenticator, session SessionManager) http.HandlerFunc
- func HandleManageAccountSubscription() http.HandlerFunc
- func HandleMap(itemSvc ItemService) http.HandlerFunc
- func HandleMapUpdates(itemSvc ItemService) http.HandlerFunc
- func HandleMarkArticle(subsSvc SubscriptionsService, mark models.Mark) http.HandlerFunc
- func HandleMarkSubscription(subSvc SubscriptionsService, session SessionManager, breadcrumbs Breadcrumbs, ...) http.HandlerFunc
- func HandleNotFound() http.HandlerFunc
- func HandlePaddleWebhook(userSvc UserService) http.HandlerFunc
- func HandlePosts(appCfg AppConfig) http.HandlerFunc
- func HandlePostsFeed(appCfg AppConfig) http.HandlerFunc
- func HandlePurchaseSubscription(appCfg AppConfig, userSvc UserService) http.HandlerFunc
- func HandlePurchaseSubscriptionSuccess() http.HandlerFunc
- func HandleRefreshToken(httpclient *resty.Client, authenticator *auth0.Authenticator, ...) http.HandlerFunc
- func HandleRemoveSubscription(svc SubscriptionsService) http.HandlerFunc
- func HandleReportIssue(appCfg AppConfig, breadcrumbs Breadcrumbs) http.HandlerFunc
- func HandleResendWebhook(subSvc SubscriptionsService, userSvc UserService, itemSvc ItemService) http.HandlerFunc
- func HandleSaveAccountSettings(users UserService, appCfg AppConfig, cache ImageCache) http.HandlerFunc
- func HandleSaveDisplaySettings(users UserService) http.HandlerFunc
- func HandleSaveFontSettings(users UserService) http.HandlerFunc
- func HandleSaveSubscription(appCfg AppConfig, cache ImageCache, svc SubscriptionsService) http.HandlerFunc
- func HandleSaveSubscriptionsSettings(users UserService) http.HandlerFunc
- func HandleSaveThemeSettings(users UserService) http.HandlerFunc
- func HandleSearchResults(itemSvc ItemService) http.HandlerFunc
- func HandleSearchSuggestions(svc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
- func HandleSearchUpdates(itemSvc ItemService) http.HandlerFunc
- func HandleShareArticle() http.HandlerFunc
- func HandleShowAccountSettings() http.HandlerFunc
- func HandleShowDisplaySettings() http.HandlerFunc
- func HandleShowSubscriptionsSettings() http.HandlerFunc
- func HandleSitemap(appCfg AppConfig) http.Handler
- func HandleSubmitContact() http.HandlerFunc
- func HandleSubmitForgetMe() http.HandlerFunc
- func HandleSubmitIssue(appCfg AppConfig, cache ImageCache) http.HandlerFunc
- func HandleSubscriptionCategories() http.HandlerFunc
- func HandleSuggestFeeds(feeds FeedService, httpClient *resty.Client) http.HandlerFunc
- func HandleSuggestSubscriptionForSearch(svc SubscriptionsService) http.HandlerFunc
- func HandleUserUnsubscribe(users UserService) http.HandlerFunc
- func HandleViewArticle(appCfg AppConfig, itemSvc ItemService, session SessionManager, ...) http.HandlerFunc
- func HandleViewer(appCfg AppConfig, httpClient *resty.Client) http.HandlerFunc
- func ListCategories(subSvc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
- func ListCountFromSession(ctx context.Context, session SessionManager, path string) int
- func ListCountToSession(ctx context.Context, session SessionManager, path string, count int)
- func ListFiltersFromCtx(ctx context.Context) *models.ListFilters
- func ListFiltersFromSession(ctx context.Context, session SessionManager, path string) *models.ListFilters
- func ListFiltersToCtx(ctx context.Context, filters *models.ListFilters) context.Context
- func ListFiltersToSession(ctx context.Context, session SessionManager, path string, ...)
- func PolicyDocsHandler(appCfg AppConfig) http.HandlerFunc
- func RedirectParam(paramName, targetTmpl string, code int) http.HandlerFunc
- func RedirectTo(target string, code int) http.HandlerFunc
- func RenderExternalPage(content ExternalPage) http.HandlerFunc
- func RenderInternalPage(content InternalPage) http.HandlerFunc
- func RenderPartial(content PartialResponseHandler) http.HandlerFunc
- func SearchCountFromSession(ctx context.Context, session SessionManager) int
- func SearchCountToSession(ctx context.Context, session SessionManager, count int)
- func SearchParamsFromCtx(ctx context.Context) *models.SearchRequest
- func SearchParamsFromSession(ctx context.Context, session SessionManager) *models.SearchRequest
- func SearchParamsToCtx(ctx context.Context, search *models.SearchRequest) context.Context
- func SearchParamsToSession(ctx context.Context, session SessionManager, search *models.SearchRequest)
- func ShowSettings() http.HandlerFunc
- func SubscriptionCtx(svc SubscriptionsService) func(next http.Handler) http.Handler
- func ValidateSubscriptionLimits(users UserService, subscriptions SubscriptionsService) func(next http.Handler) http.Handler
- type About
- type AccountIssue
- type AddSubscription
- type AppConfig
- type ArticleContent
- type ArticleService
- type AuthURLResult
- type Authenticator
- type Breadcrumbs
- type Changelog
- type ChooseSubscription
- type ComparisonPage
- type Contact
- type Discover
- type EditSubscription
- type ElasticService
- type ErrorOption
- type ErrorOptions
- type ExportSubscriptions
- type ExternalError
- type ExternalPage
- type Favorites
- type Features
- type FeaturesCollect
- type FeaturesConsume
- type FeaturesCurate
- type FeedService
- type FileUpload
- type ForgetMe
- type FullResponseHandler
- type Help
- type Home
- type HomePageService
- type ImageCache
- type ImportSubscriptions
- type ImportSubscriptionsResults
- type InternalError
- type InternalPage
- type ItemService
- type Landing
- type Linter
- type LinterError
- type LinterResponse
- type ListArticles
- type ListSubscriptions
- type Login
- type MapArticles
- type Modal
- type NotFoundPage
- type Notification
- type PageIssue
- type PartialResponseHandler
- type PartialTemplate
- type Post
- type PostHandlerHook
- type PostsIndex
- type PurchaseSubscriptionSuccess
- type Route
- type SearchResults
- type SearchSuggestions
- type SessionManager
- type SimilarArticles
- type SubscriptionsService
- type Unsubscribe
- type UnsubscribeResult
- type UserService
- type UserSettings
- type Viewer
- type ViewerError
- type ViewerResponse
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidContent indicates that the content for rendering is invalid. ErrInvalidContent = errors.New("invalid content") // ErrInvalidRequestParams indicates that the request parameters received were invalid. ErrInvalidRequestParams = errors.New("invalid request parameters") )
Functions ¶
func AddSubscriptionFilter ¶
func AddSubscriptionFilter() http.HandlerFunc
AddSubscriptionFilter handles adding a subscription as a search filter.
func AllSubscriptionsCtx ¶ added in v0.235.0
func AllSubscriptionsCtx(svc SubscriptionsService) func(next http.Handler) http.Handler
SubscriptionCtx retrieves the subscription matching the URL param and stores it in the context.
func ArticleCtx ¶ added in v0.226.0
func ArticleCtx(itemSvc ItemService) func(next http.Handler) http.Handler
ArticleCtx retrieves the article matching the URL param and stores it in the context.
func DocumentationHandler ¶
func DocumentationHandler(path string, appCfg AppConfig) http.HandlerFunc
DocumentationHandler handles serving Markdown documents for help/documentation from directory in the embedded fs.
func GetSubscriptionActionSuggestions ¶ added in v0.73.0
func GetSubscriptionActionSuggestions(subs SubscriptionsService) http.HandlerFunc
GetSubscriptionActionSuggestions handles showing a list of subscriptions as suggestions when building a search query.
func GetSubscriptionFilterSuggestions ¶
func GetSubscriptionFilterSuggestions(svc SubscriptionsService) http.HandlerFunc
GetSubscriptionFilterSuggestions handles showing a list of subscriptions as suggestions when building a search query.
func HandleAbout ¶ added in v0.38.0
func HandleAbout(appCfg AppConfig) http.HandlerFunc
func HandleAccountCancel ¶ added in v0.39.0
func HandleAccountCancel(appCfg AppConfig) http.HandlerFunc
func HandleAccountIssue ¶ added in v0.39.0
func HandleAccountIssue() http.HandlerFunc
HandleAccountIssue handles showing a page with a message indicating the user needs to contact support, as there is a critical issue with their account blocking access to the service.
func HandleAccountSuccess ¶ added in v0.39.0
func HandleAccountSuccess() http.HandlerFunc
func HandleAddFeedset ¶ added in v0.39.0
func HandleAddFeedset( feeds FeedService, users UserService, subscriptions SubscriptionsService, httpClient *resty.Client, static embed.FS, ) http.HandlerFunc
HandleAddFeedset handles adding a feedset as subscriptions.
func HandleAddGroupSubscription ¶ added in v0.39.0
func HandleAddGroupSubscription( subSvc SubscriptionsService, userSvc UserService, breadcrumbs Breadcrumbs, ) http.HandlerFunc
HandleAddGroupSubscription handles adding a new group subscription.
func HandleAddNewFeedSubscription ¶ added in v0.110.0
func HandleAddNewFeedSubscription( subscriptions SubscriptionsService, users UserService, feeds FeedService, httpClient *resty.Client, ) http.HandlerFunc
HandleAddNewFeedSubscription handles adding a new feed subscription for a user.
func HandleAddSearchSubscription ¶ added in v0.39.0
func HandleAddSearchSubscription( subSvc SubscriptionsService, userSvc UserService, breadcrumbs Breadcrumbs, ) http.HandlerFunc
HandleAddSearchSubscription handles adding a new search subscription.
func HandleAddSubscription ¶ added in v0.110.0
func HandleAddSubscription() http.HandlerFunc
HandleAddSubscription handles showing a form for adding a new subscription.
func HandleAddSubscriptionToGroup ¶ added in v0.54.0
func HandleAddSubscriptionToGroup() http.HandlerFunc
func HandleAddSubscriptionToSearch ¶ added in v0.54.0
func HandleAddSubscriptionToSearch() http.HandlerFunc
func HandleAndroidPurchase ¶ added in v0.166.0
func HandleAndroidPurchase(userSvc UserService) http.HandlerFunc
HandleAndroidPurchase receives a purchaseToken from the client and verifies it server-side.
func HandleBrowseArticles ¶ added in v0.226.0
func HandleBrowseArticles( subSvc SubscriptionsService, itemSvc ItemService, direction string, ) http.HandlerFunc
func HandleBulkMarkArticles ¶ added in v0.226.0
func HandleBulkMarkArticles( subsSvc SubscriptionsService, mark models.Mark, ) http.HandlerFunc
HandleBulkMarkArticles handles marking multiple articles.
func HandleBulkMarkSubscriptions ¶ added in v0.226.0
func HandleBulkMarkSubscriptions(svc SubscriptionsService, mark models.Mark) http.HandlerFunc
HandleBulkMarkSubscriptions handles bulk marking subscriptions as read/unread.
func HandleChangePassword ¶ added in v0.39.0
func HandleChangePassword() http.HandlerFunc
HandleChangePassword handles a change password request from the user.
func HandleChangelog ¶ added in v0.153.0
func HandleChangelog(appCfg AppConfig) http.HandlerFunc
func HandleChangelogFeed ¶ added in v0.153.0
func HandleChangelogFeed(appCfg AppConfig) http.HandlerFunc
func HandleChooseAndroidSubscription ¶ added in v0.168.0
func HandleChooseAndroidSubscription(appCfg AppConfig) http.HandlerFunc
func HandleChoosePaddleSubscription ¶ added in v0.168.0
func HandleChoosePaddleSubscription(appCfg AppConfig) http.HandlerFunc
func HandleChooseSubscription ¶ added in v0.143.0
func HandleChooseSubscription(appCfg AppConfig) http.HandlerFunc
func HandleComparison ¶ added in v0.95.0
func HandleComparison(appCfg AppConfig) http.HandlerFunc
func HandleContact ¶ added in v0.129.0
func HandleContact(appCfg AppConfig) http.HandlerFunc
func HandleDeactivateAccount ¶ added in v0.39.0
func HandleDeactivateAccount( users UserService, auth *auth0.Authenticator, sessionMgr SessionManager, ) http.HandlerFunc
HandleDeactivateAccount handles a user request to deactivate their account. Their subscription in Stripe will be cancelled at the end of the current billing period. They can continue to log in and use the service during the current billing period, after which a scheduled job will delete their account.
func HandleDiscover ¶ added in v0.223.0
func HandleDiscover() http.HandlerFunc
func HandleDiscoverSuggestions ¶ added in v0.223.0
func HandleDiscoverSuggestions(feedSvc FeedService, httpClient *resty.Client) http.HandlerFunc
func HandleEditSubscription ¶ added in v0.39.0
func HandleEditSubscription(subSvc SubscriptionsService, breadcrumbs Breadcrumbs) http.HandlerFunc
HandleEditSubscription handles presenting the user with a form for editing a subscription.
func HandleExportSubscriptions ¶ added in v0.39.0
func HandleExportSubscriptions(feedSvc FeedService, breadcrumbs Breadcrumbs) http.HandlerFunc
HandleExportSubscriptions handles configuring and performing an export of user subscriptions.
func HandleExternalError ¶ added in v0.36.0
func HandleExternalError(err error) http.HandlerFunc
HandleExternalError handles display errors on external pages.
func HandleFavoriteArticle ¶ added in v0.227.0
func HandleFavoriteArticle(itemSvc ItemService, userSvc UserService) http.HandlerFunc
HandleFavoriteArticle handles toggling an article favorite.
func HandleFavoriteSubscription ¶ added in v0.39.0
func HandleFavoriteSubscription(svc SubscriptionsService) http.HandlerFunc
HandleFavoriteSubscription handles managing a favorite subscription for a user.
func HandleFeatures ¶ added in v0.101.0
func HandleFeatures(appCfg AppConfig) http.HandlerFunc
func HandleFeaturesCollect ¶ added in v0.101.0
func HandleFeaturesCollect(appCfg AppConfig) http.HandlerFunc
func HandleFeaturesConsume ¶ added in v0.101.0
func HandleFeaturesConsume(appCfg AppConfig) http.HandlerFunc
func HandleFeaturesCurate ¶ added in v0.101.0
func HandleFeaturesCurate(appCfg AppConfig) http.HandlerFunc
func HandleFindSimilarArticles ¶ added in v0.39.0
func HandleFindSimilarArticles(itemSvc ItemService) http.HandlerFunc
HandleFindSimilarArticles handles finding articles similar to the given article and showing the results.
func HandleForgetMe ¶ added in v0.158.0
func HandleForgetMe() http.HandlerFunc
func HandleGenerateSubscriptionEmail ¶ added in v0.39.0
func HandleGenerateSubscriptionEmail(users UserService) http.HandlerFunc
func HandleHome ¶ added in v0.37.0
func HandleHome(homepageSvc HomePageService) http.HandlerFunc
HandleHome handles displaying the user's home page.
func HandleImportSubscriptions ¶ added in v0.39.0
func HandleImportSubscriptions( feeds FeedService, users UserService, subscriptions SubscriptionsService, httpClient *resty.Client, ) http.HandlerFunc
HandleImportSubscriptions handles assisting the user with importing subscriptions from an external source.
func HandleInternalError ¶ added in v0.36.0
func HandleInternalError(status int, err error, options ...ErrorOption) http.HandlerFunc
HandleInternalError handles display errors on internal pages (pages accessible to logged in users). If the passed in error can be unwrapped as a models.APIError, the status code and value of the APIError is used and the passed in status code is ignored. Otherwise a new APIError will be generated from the status code and error.
func HandleLanding ¶ added in v0.38.0
func HandleLanding(appCfg AppConfig) http.HandlerFunc
func HandleLinter ¶ added in v0.226.0
func HandleLinter(appCfg AppConfig, httpClient *resty.Client) http.HandlerFunc
func HandleListArticles ¶ added in v0.39.0
func HandleListArticles(itemSvc ItemService) http.HandlerFunc
HandleListArticles handles fetching articles based on the given page filters and displaying them.
func HandleListArticlesUpdates ¶ added in v0.105.0
func HandleListArticlesUpdates(itemSvc ItemService) http.HandlerFunc
HandleListArticlesUpdates handles checking for any updates and notifying the user.
func HandleListFavorites ¶ added in v0.39.0
func HandleListFavorites(subSvc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
HandleListFavorites handles fetching the favorite subscriptions and articles of a user and showing them in a grid layout.
func HandleListSubscriptions ¶ added in v0.36.0
func HandleListSubscriptions(subscriptionSvc SubscriptionsService) http.HandlerFunc
HandleListSubscriptions handles displaying a list of subscriptions.
func HandleListSubscriptionsUpdates ¶ added in v0.105.0
func HandleListSubscriptionsUpdates(itemSvc ItemService) http.HandlerFunc
HandleListSubscriptionsUpdates handles checking for any updates and notifying the user.
func HandleLogin ¶ added in v0.36.0
func HandleLogin(authenticator *auth0.Authenticator, session SessionManager) http.HandlerFunc
HandleLogin handles user login or sign-up requests.
func HandleLoginCallback ¶ added in v0.36.0
func HandleLoginCallback( userSvc UserService, authenticator *auth0.Authenticator, session SessionManager, ) http.HandlerFunc
HandleLoginCallback handles processing the response from the login provider.
func HandleLoginError ¶ added in v0.36.0
func HandleLoginError(res http.ResponseWriter, req *http.Request)
HandleLoginError handles login errors, including invalid login callback URL, missing parameters, expired password reset links.
func HandleLogout ¶ added in v0.235.0
func HandleLogout(authenticator *auth0.Authenticator, session SessionManager) http.HandlerFunc
Logout handles logout requests.
func HandleManageAccountSubscription ¶ added in v0.39.0
func HandleManageAccountSubscription() http.HandlerFunc
func HandleMap ¶ added in v0.226.0
func HandleMap(itemSvc ItemService) http.HandlerFunc
func HandleMapUpdates ¶ added in v0.226.0
func HandleMapUpdates(itemSvc ItemService) http.HandlerFunc
func HandleMarkArticle ¶ added in v0.226.0
func HandleMarkArticle( subsSvc SubscriptionsService, mark models.Mark, ) http.HandlerFunc
HandleMarkArticle handles marking an article as read or unread.
func HandleMarkSubscription ¶ added in v0.39.0
func HandleMarkSubscription( subSvc SubscriptionsService, session SessionManager, breadcrumbs Breadcrumbs, mark models.Mark, ) http.HandlerFunc
HandleMarkSubscription handles marking a subscription as read/unread and updates the UI accordingly.
func HandleNotFound ¶ added in v0.36.0
func HandleNotFound() http.HandlerFunc
HandleNotFound handles showing a page for a 404 response.
func HandlePaddleWebhook ¶ added in v0.143.0
func HandlePaddleWebhook(userSvc UserService) http.HandlerFunc
HandlePaddleWebhook handles incoming webhooks from paddle.
func HandlePosts ¶ added in v0.39.0
func HandlePosts(appCfg AppConfig) http.HandlerFunc
HandlePosts handles showing the posts index or individual posts.
func HandlePostsFeed ¶ added in v0.51.0
func HandlePostsFeed(appCfg AppConfig) http.HandlerFunc
HandlePostsFeed handles showing an RSS file for posts.
func HandlePurchaseSubscription ¶ added in v0.143.0
func HandlePurchaseSubscription(appCfg AppConfig, userSvc UserService) http.HandlerFunc
func HandlePurchaseSubscriptionSuccess ¶ added in v0.143.0
func HandlePurchaseSubscriptionSuccess() http.HandlerFunc
func HandleRefreshToken ¶ added in v0.104.0
func HandleRefreshToken( httpclient *resty.Client, authenticator *auth0.Authenticator, session SessionManager, ) http.HandlerFunc
HandleRefreshToken handles refreshing the user's access token (using a refresh token) when it is about to expire.
func HandleRemoveSubscription ¶ added in v0.39.0
func HandleRemoveSubscription(svc SubscriptionsService) http.HandlerFunc
HandleRemoveSubscription handles removing (unsubscribing) from a subscription.
func HandleReportIssue ¶ added in v0.126.0
func HandleReportIssue(appCfg AppConfig, breadcrumbs Breadcrumbs) http.HandlerFunc
HandleReportIssue handles presenting a form for the user to submit issues about the app.
func HandleResendWebhook ¶ added in v0.143.0
func HandleResendWebhook(subSvc SubscriptionsService, userSvc UserService, itemSvc ItemService) http.HandlerFunc
HandleResendWebhook will handle incoming webhook requests from Resend.
func HandleSaveAccountSettings ¶ added in v0.39.0
func HandleSaveAccountSettings(users UserService, appCfg AppConfig, cache ImageCache) http.HandlerFunc
HandleSaveAccountSettings handles processing and saving new account settings.
func HandleSaveDisplaySettings ¶ added in v0.39.0
func HandleSaveDisplaySettings(users UserService) http.HandlerFunc
HandleSaveDisplaySettings handles saving user settings after user submitted changes.
func HandleSaveFontSettings ¶ added in v0.220.0
func HandleSaveFontSettings(users UserService) http.HandlerFunc
func HandleSaveSubscription ¶ added in v0.39.0
func HandleSaveSubscription(appCfg AppConfig, cache ImageCache, svc SubscriptionsService) http.HandlerFunc
HandleSaveSubscription handles saving the edits made by a user to a subscription.
func HandleSaveSubscriptionsSettings ¶ added in v0.207.0
func HandleSaveSubscriptionsSettings(users UserService) http.HandlerFunc
HandleSaveSubscriptionsSettings handles saving any subscription settings the user has applied.
func HandleSaveThemeSettings ¶ added in v0.220.0
func HandleSaveThemeSettings(users UserService) http.HandlerFunc
func HandleSearchResults ¶ added in v0.39.0
func HandleSearchResults(itemSvc ItemService) http.HandlerFunc
HandleSearchResults performs a search with the user input and renders a page with the search results.
func HandleSearchSuggestions ¶ added in v0.39.0
func HandleSearchSuggestions(svc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
HandleSearchSuggestions performs a search with the user input and presents suggestions back to the user.
func HandleSearchUpdates ¶ added in v0.105.0
func HandleSearchUpdates(itemSvc ItemService) http.HandlerFunc
HandleSearchUpdates handles checking for any new results for the search request and notifying the user.
func HandleShareArticle ¶ added in v0.227.0
func HandleShareArticle() http.HandlerFunc
HandleShareArticle handles sharing an article.
func HandleShowAccountSettings ¶ added in v0.39.0
func HandleShowAccountSettings() http.HandlerFunc
HandleShowAccountSettings handles showing the settings related to user accounts.
func HandleShowDisplaySettings ¶ added in v0.39.0
func HandleShowDisplaySettings() http.HandlerFunc
HandleShowDisplaySettings handles showing the settings related to the application display.
func HandleShowSubscriptionsSettings ¶ added in v0.150.0
func HandleShowSubscriptionsSettings() http.HandlerFunc
HandleShowSubscriptionsSettings handles showing the user's subscriptions for bulk management.
func HandleSitemap ¶ added in v0.37.0
HandleSitemap handles requests for sitemap.xml. In the future, it may handle more requests from non natural human clients...
func HandleSubmitContact ¶ added in v0.129.0
func HandleSubmitContact() http.HandlerFunc
func HandleSubmitForgetMe ¶ added in v0.158.0
func HandleSubmitForgetMe() http.HandlerFunc
func HandleSubmitIssue ¶ added in v0.126.0
func HandleSubmitIssue(appCfg AppConfig, cache ImageCache) http.HandlerFunc
HandleSubmitIssue handles processing the user submitted subscription issues form.
func HandleSubscriptionCategories ¶ added in v0.39.0
func HandleSubscriptionCategories() http.HandlerFunc
HandleSubscriptionCategories handles adding and removing categories from a subscription, either when editing or adding.
func HandleSuggestFeeds ¶ added in v0.133.0
func HandleSuggestFeeds(feeds FeedService, httpClient *resty.Client) http.HandlerFunc
func HandleSuggestSubscriptionForSearch ¶ added in v0.54.0
func HandleSuggestSubscriptionForSearch(svc SubscriptionsService) http.HandlerFunc
func HandleUserUnsubscribe ¶ added in v0.87.0
func HandleUserUnsubscribe(users UserService) http.HandlerFunc
HandleUserUnsubscribe handles requests from users to unsubscribe from promotional emails. It handles both interactive (user manually goes to page) and non-interactive (as per RFC 8058).
func HandleViewArticle ¶ added in v0.39.0
func HandleViewArticle( appCfg AppConfig, itemSvc ItemService, session SessionManager, httpClient *resty.Client, itemsCache cache.ObjectCache, ) http.HandlerFunc
HandleViewArticle handles showing an article's content.
func HandleViewer ¶ added in v0.36.0
func HandleViewer(appCfg AppConfig, httpClient *resty.Client) http.HandlerFunc
HandleViewer handles powering the feed viewer page.
func ListCategories ¶ added in v0.27.0
func ListCategories(subSvc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
ListCategories handles returning a list of categories that can be used for filtering subscriptions or articles.
func ListCountFromSession ¶ added in v0.235.0
func ListCountFromSession(ctx context.Context, session SessionManager, path string) int
ListCountFromSession stores the current count of objects displayed in the list in the session. The path is used as a suffix so that the count is retrieved per-route.
func ListCountToSession ¶ added in v0.235.0
func ListCountToSession(ctx context.Context, session SessionManager, path string, count int)
ListCountToSession stores the current count of objects displayed in the list in the session. The path is used as a suffix so that the count is stored per-route.
func ListFiltersFromCtx ¶ added in v0.235.0
func ListFiltersFromCtx(ctx context.Context) *models.ListFilters
ListFiltersFromCtx retrieves the given list filters in the context.
func ListFiltersFromSession ¶ added in v0.235.0
func ListFiltersFromSession(ctx context.Context, session SessionManager, path string) *models.ListFilters
ListFiltersFromSession retrieves the given list filters in the session. The path is used as a suffix so that filters are retrieved per-route.
func ListFiltersToCtx ¶ added in v0.235.0
ListFiltersToCtx stores the given list filters in the context.
func ListFiltersToSession ¶ added in v0.235.0
func ListFiltersToSession(ctx context.Context, session SessionManager, path string, filters *models.ListFilters)
ListFiltersToSession stores the given list filters in the session. The path is used as a suffix so that filters are stored per-route.
func PolicyDocsHandler ¶
func PolicyDocsHandler(appCfg AppConfig) http.HandlerFunc
PolicyDocsHandler handles serving policy Markdown documents from directory in the embedded fs.
func RedirectParam ¶ added in v0.229.0
func RedirectParam(paramName, targetTmpl string, code int) http.HandlerFunc
RedirectParam performs route redirection for routes with parameters that have moved.
func RedirectTo ¶ added in v0.227.2
func RedirectTo(target string, code int) http.HandlerFunc
RedirectTo performs route redirection for routes that have moved.
func RenderExternalPage ¶ added in v0.38.0
func RenderExternalPage(content ExternalPage) http.HandlerFunc
RenderExternalPage is a handler that renders a full external page.
func RenderInternalPage ¶ added in v0.38.0
func RenderInternalPage(content InternalPage) http.HandlerFunc
RenderInternalPage is a handler that chooses the appropriate rendering for an internal page (full or partial), based on the request.
func RenderPartial ¶ added in v0.36.0
func RenderPartial(content PartialResponseHandler) http.HandlerFunc
RenderPartial is a handler that renders a partial response.
func SearchCountFromSession ¶ added in v0.235.0
func SearchCountFromSession(ctx context.Context, session SessionManager) int
SearchCountFromSession stores the current count of objects displayed in the search in the session.
func SearchCountToSession ¶ added in v0.235.0
func SearchCountToSession(ctx context.Context, session SessionManager, count int)
SearchCountToSession stores the current count of objects displayed in the search in the session.
func SearchParamsFromCtx ¶ added in v0.235.0
func SearchParamsFromCtx(ctx context.Context) *models.SearchRequest
SearchParamsFromCtx retrieves the given search params in the context.
func SearchParamsFromSession ¶ added in v0.235.0
func SearchParamsFromSession(ctx context.Context, session SessionManager) *models.SearchRequest
SearchParamsFromSession retrieves the given search params in the session.
func SearchParamsToCtx ¶ added in v0.235.0
SearchParamsToCtx stores the given search params in the context.
func SearchParamsToSession ¶ added in v0.235.0
func SearchParamsToSession(ctx context.Context, session SessionManager, search *models.SearchRequest)
SearchParamsToSession stores the given search params in the session.
func ShowSettings ¶
func ShowSettings() http.HandlerFunc
ShowSettings handles retrieving and rendering the user settings page.
func SubscriptionCtx ¶ added in v0.226.0
func SubscriptionCtx(svc SubscriptionsService) func(next http.Handler) http.Handler
SubscriptionCtx retrieves the subscription matching the URL param and stores it in the context.
func ValidateSubscriptionLimits ¶ added in v0.151.0
func ValidateSubscriptionLimits( users UserService, subscriptions SubscriptionsService, ) func(next http.Handler) http.Handler
Types ¶
type About ¶ added in v0.21.0
type About struct {
// contains filtered or unexported fields
}
func (*About) FullResponse ¶ added in v0.38.0
func (p *About) FullResponse(w http.ResponseWriter, r *http.Request)
type AccountIssue ¶ added in v0.39.0
type AccountIssue struct{}
AccountIssue contains data for rendering a page to present the user when there is an issue with their account.
func (*AccountIssue) FullResponse ¶ added in v0.39.0
func (t *AccountIssue) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders the page for the user to choose a subscription plan.
type AddSubscription ¶ added in v0.39.0
type AddSubscription struct {
// contains filtered or unexported fields
}
AddSubscription contains the data for rendering a page for editing a subscription.
func (*AddSubscription) FullResponse ¶ added in v0.39.0
func (h *AddSubscription) FullResponse(res http.ResponseWriter, req *http.Request)
func (*AddSubscription) PartialResponse ¶ added in v0.39.0
func (h *AddSubscription) PartialResponse(res http.ResponseWriter, req *http.Request)
type ArticleContent ¶ added in v0.39.0
type ArticleContent struct {
// contains filtered or unexported fields
}
ArticleContent contains the data to view article content.
func (*ArticleContent) FullResponse ¶ added in v0.39.0
func (t *ArticleContent) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and content).
func (*ArticleContent) PartialResponse ¶ added in v0.39.0
func (t *ArticleContent) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse renders just the content and performs OOB swaps to update the title (if set) and sidebar/dock.
type ArticleService ¶ added in v0.235.0
type ArticleService interface {
FilterArticles(ctx context.Context, request *models.ListRequest) (models.Articles, models.Pagination, error)
FindSimilarArticles(ctx context.Context, count int, itemIDs ...models.ItemID) (models.Articles, error)
GetArticles(ctx context.Context, itemIDs ...models.ItemID) (models.Articles, error)
GetNextArticle(
ctx context.Context,
currentID models.ItemID,
subscriptionID models.SubscriptionID,
view models.View,
direction string,
ts time.Time,
) (*models.Article, error)
ArchiveArticle(ctx context.Context, article *models.ArticleArchive) error
UnarchiveArticle(ctx context.Context, userID models.UserID, itemID models.ItemID) error
}
type AuthURLResult ¶ added in v0.235.0
type Authenticator ¶ added in v0.235.0
type Authenticator interface {
IsAuthenticated(ctx context.Context, session SessionManager) bool
GenerateAuthURL(req *http.Request) (AuthURLResult, error)
PutState(ctx context.Context, session SessionManager, state string)
GetState(ctx context.Context, session SessionManager) (string, error)
PutCodeVerifier(ctx context.Context, session SessionManager, verifier string)
GetCodeVerifier(ctx context.Context, session SessionManager) (string, error)
PerformExchange(ctx context.Context, code, verifier string) (*auth0.TokenResponse, *auth0.UserProfile, error)
SaveTokens(ctx context.Context, session SessionManager, token *auth0.TokenResponse)
ClearState(ctx context.Context, session SessionManager)
GetReturnTo(ctx context.Context, session SessionManager) (string, error)
}
type Breadcrumbs ¶ added in v0.235.0
type Changelog ¶ added in v0.153.0
type Changelog struct {
Releases []templates.Release `toml:"releases"`
// contains filtered or unexported fields
}
func (*Changelog) FullResponse ¶ added in v0.153.0
func (p *Changelog) FullResponse(res http.ResponseWriter, req *http.Request)
func (*Changelog) PartialResponse ¶ added in v0.153.0
func (p *Changelog) PartialResponse(res http.ResponseWriter, req *http.Request)
type ChooseSubscription ¶ added in v0.143.0
type ChooseSubscription struct {
// contains filtered or unexported fields
}
func (*ChooseSubscription) FullResponse ¶ added in v0.143.0
func (t *ChooseSubscription) FullResponse(res http.ResponseWriter, req *http.Request)
func (*ChooseSubscription) PartialResponse ¶ added in v0.168.0
func (t *ChooseSubscription) PartialResponse(res http.ResponseWriter, req *http.Request)
type ComparisonPage ¶ added in v0.95.0
type ComparisonPage struct {
// contains filtered or unexported fields
}
func (*ComparisonPage) FullResponse ¶ added in v0.95.0
func (p *ComparisonPage) FullResponse(res http.ResponseWriter, req *http.Request)
type Contact ¶ added in v0.129.0
type Contact struct {
// contains filtered or unexported fields
}
func (Contact) CanonicalLink ¶ added in v0.235.0
func (m Contact) CanonicalLink() string
func (*Contact) FullResponse ¶ added in v0.129.0
func (p *Contact) FullResponse(res http.ResponseWriter, req *http.Request)
func (Contact) OpengraphData ¶ added in v0.235.0
type Discover ¶ added in v0.223.0
type Discover struct {
// contains filtered or unexported fields
}
func (*Discover) FullResponse ¶ added in v0.223.0
func (h *Discover) FullResponse(res http.ResponseWriter, req *http.Request)
func (*Discover) PartialResponse ¶ added in v0.223.0
func (h *Discover) PartialResponse(res http.ResponseWriter, req *http.Request)
type EditSubscription ¶
type EditSubscription struct {
// contains filtered or unexported fields
}
EditSubscription contains the data for rendering a page for editing a subscription.
func (*EditSubscription) FullResponse ¶ added in v0.39.0
func (p *EditSubscription) FullResponse(res http.ResponseWriter, req *http.Request)
func (*EditSubscription) PartialResponse ¶ added in v0.39.0
func (p *EditSubscription) PartialResponse(res http.ResponseWriter, req *http.Request)
type ElasticService ¶ added in v0.235.0
type ErrorOption ¶ added in v0.212.3
type ErrorOption func(*ErrorOptions)
func WithUserMessage ¶ added in v0.212.3
func WithUserMessage(msg *models.UserMessage) ErrorOption
type ErrorOptions ¶ added in v0.212.3
type ErrorOptions struct {
UserMessage *models.UserMessage
}
type ExportSubscriptions ¶
type ExportSubscriptions struct {
// contains filtered or unexported fields
}
ExportSubscriptions contains the data for rendering a page for exporting subscriptions.
func (*ExportSubscriptions) FullResponse ¶ added in v0.39.0
func (h *ExportSubscriptions) FullResponse(res http.ResponseWriter, req *http.Request)
func (*ExportSubscriptions) PartialResponse ¶ added in v0.39.0
func (h *ExportSubscriptions) PartialResponse(res http.ResponseWriter, req *http.Request)
type ExternalError ¶ added in v0.36.0
type ExternalError struct {
// contains filtered or unexported fields
}
ExternalError represents errors shown on external (public) pages.
func (*ExternalError) FullResponse ¶ added in v0.36.0
func (p *ExternalError) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders the error on a full page.
type ExternalPage ¶ added in v0.38.0
type ExternalPage interface {
FullResponseHandler
}
ExternalPage is a handler for external pages. External pages only support rendering full responses.
type Favorites ¶ added in v0.39.0
type Favorites struct {
// contains filtered or unexported fields
}
func (*Favorites) FullResponse ¶ added in v0.39.0
func (p *Favorites) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and list of subscriptions).
func (*Favorites) PartialResponse ¶ added in v0.39.0
func (p *Favorites) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse will either render the list of subscriptions, the controls and update the title/dock/sidebar or, when paginating, just the list of subscriptions.
type Features ¶ added in v0.101.0
type Features struct {
// contains filtered or unexported fields
}
func (Features) CanonicalLink ¶ added in v0.235.0
func (m Features) CanonicalLink() string
func (*Features) FullResponse ¶ added in v0.101.0
func (p *Features) FullResponse(res http.ResponseWriter, req *http.Request)
func (Features) OpengraphData ¶ added in v0.235.0
type FeaturesCollect ¶ added in v0.155.0
type FeaturesCollect struct {
// contains filtered or unexported fields
}
func (FeaturesCollect) CanonicalLink ¶ added in v0.235.0
func (m FeaturesCollect) CanonicalLink() string
func (*FeaturesCollect) FullResponse ¶ added in v0.155.0
func (p *FeaturesCollect) FullResponse(res http.ResponseWriter, req *http.Request)
func (FeaturesCollect) OpengraphData ¶ added in v0.235.0
type FeaturesConsume ¶ added in v0.155.0
type FeaturesConsume struct {
// contains filtered or unexported fields
}
func (FeaturesConsume) CanonicalLink ¶ added in v0.235.0
func (m FeaturesConsume) CanonicalLink() string
func (*FeaturesConsume) FullResponse ¶ added in v0.155.0
func (p *FeaturesConsume) FullResponse(res http.ResponseWriter, req *http.Request)
func (FeaturesConsume) OpengraphData ¶ added in v0.235.0
type FeaturesCurate ¶ added in v0.155.0
type FeaturesCurate struct {
// contains filtered or unexported fields
}
func (FeaturesCurate) CanonicalLink ¶ added in v0.235.0
func (m FeaturesCurate) CanonicalLink() string
func (*FeaturesCurate) FullResponse ¶ added in v0.155.0
func (p *FeaturesCurate) FullResponse(res http.ResponseWriter, req *http.Request)
func (FeaturesCurate) OpengraphData ¶ added in v0.235.0
type FeedService ¶ added in v0.235.0
type FeedService interface {
GetFeed(ctx context.Context, id models.FeedID) (*models.Feed, error)
GetFeeds(ctx context.Context, ids ...models.FeedID) (models.Feeds, error)
AddFeed(ctx context.Context, feed *models.Feed) error
SuggestYoutubeFeeds(ctx context.Context, text string) (*models.SuggestFeedsResults, error)
SuggestGoogleNewsFeeds(
ctx context.Context,
httpClient *resty.Client,
text string,
) (*models.SuggestFeedsResults, error)
SuggestFeeds(
ctx context.Context,
httpClient *resty.Client,
request *models.SuggestFeedsRequest,
) (*models.SuggestFeedsResults, error)
FindOrCreateFeed(ctx context.Context, httpClient *resty.Client, feedURL string) (*models.Feed, bool, error)
GenerateOPML(ctx context.Context, feedIDs ...models.FeedID) ([]byte, error)
}
type FileUpload ¶ added in v0.221.2
type FileUpload interface {
Set(hdr *multipart.FileHeader, data multipart.File)
}
FileUpload represents file data uploaded through a mutlipart form.
type ForgetMe ¶ added in v0.158.0
type ForgetMe struct {
// contains filtered or unexported fields
}
func (ForgetMe) CanonicalLink ¶ added in v0.235.0
func (m ForgetMe) CanonicalLink() string
func (*ForgetMe) FullResponse ¶ added in v0.158.0
func (p *ForgetMe) FullResponse(res http.ResponseWriter, req *http.Request)
func (ForgetMe) OpengraphData ¶ added in v0.235.0
type FullResponseHandler ¶ added in v0.36.0
type FullResponseHandler interface {
FullResponse(w http.ResponseWriter, r *http.Request)
}
FullResponseHandler is a handler that handles full responses.
type Help ¶ added in v0.83.1
type Help struct {
// contains filtered or unexported fields
}
func (*Help) FullResponse ¶ added in v0.83.1
func (p *Help) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and list of subscriptions).
func (*Help) PartialResponse ¶ added in v0.83.1
func (p *Help) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse will either render the list of subscriptions, the controls and update the title/dock/sidebar or, when paginating, just the list of subscriptions.
type Home ¶
type Home struct {
// contains filtered or unexported fields
}
Home contains data for generating a user home page.
func (*Home) FullResponse ¶ added in v0.37.0
func (p *Home) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and data).
func (*Home) PartialResponse ¶ added in v0.37.0
func (p *Home) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse will render just the data.
type HomePageService ¶ added in v0.235.0
type HomePageService interface {
AggregateSubscriptions(
ctx context.Context,
user *models.User,
subscriptions models.Subscriptions,
) (models.CategoryCounts, models.CategoryCounts, models.Articles, error)
}
type ImageCache ¶ added in v0.235.0
type ImageCache interface {
GetImage(ctx context.Context, key string, buf *bytes.Buffer) error
SaveImage(ctx context.Context, id string, data []byte) error
GetAvatar(ctx context.Context, key string, buf *bytes.Buffer) error
SaveAvatar(ctx context.Context, id string, data []byte) error
GetThumbnail(ctx context.Context, key string, buf *bytes.Buffer) error
SaveThumbnail(ctx context.Context, id string, data []byte) error
GetScreenshot(ctx context.Context, key string, buf *bytes.Buffer) error
SaveScreenshot(ctx context.Context, id string, data []byte) error
}
type ImportSubscriptions ¶
type ImportSubscriptions struct {
// contains filtered or unexported fields
}
ImportSubscriptions contains the data for rendering a page for importing subscriptions.
func (*ImportSubscriptions) FullResponse ¶ added in v0.39.0
func (h *ImportSubscriptions) FullResponse(res http.ResponseWriter, req *http.Request)
func (*ImportSubscriptions) PartialResponse ¶ added in v0.39.0
func (h *ImportSubscriptions) PartialResponse(res http.ResponseWriter, req *http.Request)
type ImportSubscriptionsResults ¶ added in v0.39.0
type ImportSubscriptionsResults struct {
// contains filtered or unexported fields
}
func (*ImportSubscriptionsResults) PartialResponse ¶ added in v0.39.0
func (h *ImportSubscriptionsResults) PartialResponse(res http.ResponseWriter, req *http.Request)
type InternalError ¶ added in v0.36.0
type InternalError struct {
// contains filtered or unexported fields
}
InternalError represents errors shown on internal (pages accessible to logged in users) pages.
func (*InternalError) FullResponse ¶ added in v0.36.0
func (p *InternalError) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders the error message on a full page.
func (*InternalError) PartialResponse ¶ added in v0.36.0
func (p *InternalError) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse will render the error in the content area for GET requests, as a notification otherwise.
type InternalPage ¶ added in v0.38.0
type InternalPage interface {
PartialResponseHandler
FullResponseHandler
}
InternalPage is a handler for internal pages. Internal pages support rendering either full or partial responses.
type ItemService ¶ added in v0.235.0
type ItemService interface {
ArticleService
AddItems(ctx context.Context, items models.Items) (map[string]models.Items, error)
RetrieveItems(ctx context.Context, request *models.SearchRequest) (models.Items, models.Pagination, error)
GetTopItemCategoriesForSearchResults(ctx context.Context, request *models.SearchRequest) (models.Categories, error)
CountSearchResults(ctx context.Context, request *models.SearchRequest) (int64, error)
CountItems(ctx context.Context, query query.Option) (int64, error)
SuggestItems(ctx context.Context, request *models.SearchRequest) (models.Items, error)
GetTopCategoriesForItems(ctx context.Context, itemsQuery query.Option) (models.CategoryCounts, error)
}
type Landing ¶
type Landing struct {
// contains filtered or unexported fields
}
func (*Landing) FullResponse ¶ added in v0.38.0
func (p *Landing) FullResponse(res http.ResponseWriter, req *http.Request)
type Linter ¶ added in v0.226.0
type Linter struct {
// contains filtered or unexported fields
}
func (Linter) CanonicalLink ¶ added in v0.235.0
func (m Linter) CanonicalLink() string
func (*Linter) FullResponse ¶ added in v0.226.0
func (p *Linter) FullResponse(res http.ResponseWriter, req *http.Request)
func (Linter) OpengraphData ¶ added in v0.235.0
type LinterError ¶ added in v0.226.0
type LinterError struct {
// contains filtered or unexported fields
}
func (*LinterError) PartialResponse ¶ added in v0.226.0
func (p *LinterError) PartialResponse(res http.ResponseWriter, req *http.Request)
type LinterResponse ¶ added in v0.226.0
func (*LinterResponse) PartialResponse ¶ added in v0.226.0
func (p *LinterResponse) PartialResponse(res http.ResponseWriter, req *http.Request)
type ListArticles ¶
type ListArticles struct {
// contains filtered or unexported fields
}
ListArticles holds data for generating the articles list page.
func (*ListArticles) FullResponse ¶ added in v0.39.0
func (p *ListArticles) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and list of articles).
func (*ListArticles) PartialResponse ¶ added in v0.39.0
func (p *ListArticles) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse will either render the list of articles, the controls and update the title/dock/sidebar or, when paginating, just the list of articles.
type ListSubscriptions ¶
type ListSubscriptions struct {
// contains filtered or unexported fields
}
ListSubscriptions holds data for generating the subscriptions list page.
func (*ListSubscriptions) FullResponse ¶ added in v0.36.0
func (p *ListSubscriptions) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and list of subscriptions).
func (*ListSubscriptions) PartialResponse ¶ added in v0.36.0
func (p *ListSubscriptions) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse will either render the list of subscriptions, the controls and update the title/dock/sidebar or, when paginating, just the list of subscriptions.
type Login ¶
type Login struct {
// contains filtered or unexported fields
}
func (*Login) FullResponse ¶ added in v0.36.0
func (p *Login) FullResponse(w http.ResponseWriter, r *http.Request)
func (*Login) PartialResponse ¶ added in v0.36.0
func (p *Login) PartialResponse(w http.ResponseWriter, r *http.Request)
type MapArticles ¶ added in v0.226.0
type MapArticles struct {
// contains filtered or unexported fields
}
func (*MapArticles) FullResponse ¶ added in v0.226.0
func (p *MapArticles) FullResponse(res http.ResponseWriter, req *http.Request)
func (*MapArticles) PartialResponse ¶ added in v0.226.0
func (p *MapArticles) PartialResponse(res http.ResponseWriter, req *http.Request)
type Modal ¶ added in v0.39.0
type Modal struct {
// contains filtered or unexported fields
}
func (*Modal) PartialResponse ¶ added in v0.39.0
func (m *Modal) PartialResponse(res http.ResponseWriter, req *http.Request)
type NotFoundPage ¶ added in v0.36.0
type NotFoundPage struct {
// contains filtered or unexported fields
}
func (*NotFoundPage) FullResponse ¶ added in v0.36.0
func (p *NotFoundPage) FullResponse(w http.ResponseWriter, r *http.Request)
func (*NotFoundPage) PartialResponse ¶ added in v0.36.0
func (p *NotFoundPage) PartialResponse(w http.ResponseWriter, r *http.Request)
type Notification ¶ added in v0.39.0
type Notification struct {
// contains filtered or unexported fields
}
Notification contains a message that will be displayed to the user as a notification.
func (*Notification) PartialResponse ¶ added in v0.39.0
func (n *Notification) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse renders the notification into the notification container on the page as an OOB response.
type PageIssue ¶ added in v0.39.0
type PageIssue struct {
// contains filtered or unexported fields
}
func (*PageIssue) FullResponse ¶ added in v0.39.0
func (p *PageIssue) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and content).
func (*PageIssue) PartialResponse ¶ added in v0.39.0
func (p *PageIssue) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse renders just the content and performs OOB swaps to update the title (if set) and sidebar/dock.
type PartialResponseHandler ¶ added in v0.36.0
type PartialResponseHandler interface {
PartialResponse(w http.ResponseWriter, r *http.Request)
}
PartialResponseHandler is a handler that handles partial responses.
type PartialTemplate ¶ added in v0.39.0
type PartialTemplate struct {
// contains filtered or unexported fields
}
PartialTemplate is a template that only supports being rendered in a partial response.
func (*PartialTemplate) PartialResponse ¶ added in v0.39.0
func (t *PartialTemplate) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse renders the template.
type Post ¶ added in v0.39.0
Post is an individual post.
func (*Post) FullResponse ¶ added in v0.39.0
func (p *Post) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders an individual post.
type PostHandlerHook ¶ added in v0.226.0
type PostHandlerHook func(res http.ResponseWriter, req *http.Request) error
PostHandlerHook is a function that can be run after a handler has done its main processing. Used mainly to perform route-specific or other conditional logic without complicating the handler code.
type PostsIndex ¶ added in v0.39.0
type PostsIndex struct {
// contains filtered or unexported fields
}
PostsIndex is the index of all posts.
func (*PostsIndex) FullResponse ¶ added in v0.39.0
func (p *PostsIndex) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders the posts index.
type PurchaseSubscriptionSuccess ¶ added in v0.143.0
type PurchaseSubscriptionSuccess struct {
// contains filtered or unexported fields
}
func (*PurchaseSubscriptionSuccess) FullResponse ¶ added in v0.143.0
func (t *PurchaseSubscriptionSuccess) FullResponse(res http.ResponseWriter, req *http.Request)
func (*PurchaseSubscriptionSuccess) PartialResponse ¶ added in v0.168.0
func (t *PurchaseSubscriptionSuccess) PartialResponse(res http.ResponseWriter, req *http.Request)
type SearchResults ¶ added in v0.39.0
type SearchResults struct {
// contains filtered or unexported fields
}
func (*SearchResults) FullResponse ¶ added in v0.39.0
func (h *SearchResults) FullResponse(res http.ResponseWriter, req *http.Request)
func (*SearchResults) PartialResponse ¶ added in v0.39.0
func (h *SearchResults) PartialResponse(res http.ResponseWriter, req *http.Request)
type SearchSuggestions ¶ added in v0.39.0
type SearchSuggestions struct {
// contains filtered or unexported fields
}
func (*SearchSuggestions) PartialResponse ¶ added in v0.39.0
func (h *SearchSuggestions) PartialResponse(res http.ResponseWriter, req *http.Request)
type SessionManager ¶ added in v0.235.0
type SimilarArticles ¶ added in v0.39.0
type SimilarArticles struct {
// contains filtered or unexported fields
}
func (*SimilarArticles) FullResponse ¶ added in v0.39.0
func (h *SimilarArticles) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and list of subscriptions).
func (*SimilarArticles) PartialResponse ¶ added in v0.39.0
func (h *SimilarArticles) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse will either render the list of subscriptions, the controls and update the title/dock/sidebar or, when paginating, just the list of subscriptions.
type SubscriptionsService ¶ added in v0.235.0
type SubscriptionsService interface {
GetAllSubscriptions(ctx context.Context) (models.Subscriptions, error)
GetSubscription(ctx context.Context, id models.SubscriptionID) (*models.Subscription, error)
BulkGetSubscriptions(ctx context.Context, ids ...models.SubscriptionID) (models.Subscriptions, error)
UpdateSubscriptions(ctx context.Context, subscriptions ...*models.Subscription) error
MarkSubscriptions(
ctx context.Context,
mark models.Mark,
subscriptionIDs ...models.SubscriptionID,
) error
MarkArticles(
ctx context.Context,
mark models.Mark,
subscriptionID models.SubscriptionID,
itemIDs ...models.ItemID,
) error
RemoveSubscriptions(ctx context.Context, ids ...models.SubscriptionID) error
UpdateSubscriptionDynamicInfo(
ctx context.Context,
subscriptions models.Subscriptions,
) error
GetSubscriptionSuggestions(
ctx context.Context,
text string,
count int,
ignoredSubscriptions []models.SubscriptionID,
) (models.Subscriptions, error)
GetSubscriptionCategorySuggestions(
ctx context.Context,
feedIDs []models.FeedID,
excludedCategories []models.Category,
) []models.Category
GetLatestArticles(ctx context.Context, view models.View, subscriptions models.Subscriptions)
}
type Unsubscribe ¶ added in v0.87.0
type Unsubscribe struct {
Token string
}
Unsubscribe represents an unsubscribe request.
func (*Unsubscribe) FullResponse ¶ added in v0.87.0
func (p *Unsubscribe) FullResponse(res http.ResponseWriter, req *http.Request)
type UnsubscribeResult ¶ added in v0.87.0
type UnsubscribeResult struct {
Msg *models.UserMessage
}
UnsubscribeResult represents an unsubscribe result.
func (*UnsubscribeResult) FullResponse ¶ added in v0.87.0
func (p *UnsubscribeResult) FullResponse(res http.ResponseWriter, req *http.Request)
func (*UnsubscribeResult) PartialResponse ¶ added in v0.87.0
func (p *UnsubscribeResult) PartialResponse(res http.ResponseWriter, req *http.Request)
type UserService ¶ added in v0.235.0
type UserService interface {
GetUserByEmail(ctx context.Context, email string) (*models.User, error)
GetUserByExternalID(ctx context.Context, externalID string) (*models.User, error)
GetUserBySubscriptionEmail(ctx context.Context, emails ...string) (*models.User, error)
GetUserByPurchaseToken(ctx context.Context, token string) (*models.User, error)
GetUserByCustomerID(ctx context.Context, id string) (*models.User, error)
UpdateUser(ctx context.Context, user *models.User, updates map[string]any) error
SyncUser(res http.ResponseWriter, req *http.Request, user *models.User)
AddUser(ctx context.Context, user *models.User) error
DeleteUser(ctx context.Context, user *models.User) error
}
type UserSettings ¶ added in v0.39.0
type UserSettings struct {
// contains filtered or unexported fields
}
UserSettings contains the data for rendering the user settings page.
func (*UserSettings) FullResponse ¶ added in v0.39.0
func (t *UserSettings) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and content).
func (*UserSettings) PartialResponse ¶ added in v0.39.0
func (t *UserSettings) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse renders just the content and performs OOB swaps to update the title (if set) and sidebar/dock.
type Viewer ¶ added in v0.21.0
type Viewer struct {
// contains filtered or unexported fields
}
func (*Viewer) FullResponse ¶ added in v0.36.0
func (p *Viewer) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders the full viewer page.
type ViewerError ¶ added in v0.36.0
type ViewerError struct {
// contains filtered or unexported fields
}
ViewerError holds an error when the viewer failed to parse a url.
func (*ViewerError) PartialResponse ¶ added in v0.36.0
func (p *ViewerError) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse renders an error as the viewer response.
type ViewerResponse ¶ added in v0.38.0
type ViewerResponse struct {
// contains filtered or unexported fields
}
func (*ViewerResponse) PartialResponse ¶ added in v0.38.0
func (p *ViewerResponse) PartialResponse(res http.ResponseWriter, req *http.Request)
PartialResponse returns no content for the viewer as partials are unsupported.
Source Files
¶
- about.go
- actions.go
- android.go
- articles.go
- categories.go
- changelog.go
- checkout.go
- compare.go
- contact.go
- discover.go
- error.go
- favorites.go
- features.go
- forget-me.go
- handlers.go
- help.go
- home.go
- issues.go
- landing.go
- linter.go
- login.go
- logout.go
- map.go
- notfound.go
- notification.go
- paddle.go
- policies.go
- posts.go
- render.go
- resend.go
- search.go
- sitemap.go
- subscriptions.go
- user.go
- viewer.go