Documentation
¶
Overview ¶
Package handlers contains chainable handlers/middleware for routing.
Index ¶
- Variables
- func About() http.HandlerFunc
- func AddFavoriteArticle() http.HandlerFunc
- func AddFavoriteSubscription() http.HandlerFunc
- func AddFeedSubscription() http.HandlerFunc
- func AddFeedset(static embed.FS) http.HandlerFunc
- func AddGroupSubscription() http.HandlerFunc
- func AddSearchSubscription() http.HandlerFunc
- func AddSubscriptionFilter() http.HandlerFunc
- func AdjustSubscriptionCategories() http.HandlerFunc
- func CSRFError() http.HandlerFunc
- func ChangePassword() http.HandlerFunc
- func DocumentationHandler() http.HandlerFunc
- func EditSubscription() http.HandlerFunc
- func ExportSubscriptions() http.HandlerFunc
- func FindSimilarArticles() http.HandlerFunc
- func GenerateSubscriptionEmail() http.HandlerFunc
- func GetObjectIssues() http.HandlerFunc
- func GetPageIssues() http.HandlerFunc
- func GetSearchResults() http.HandlerFunc
- func GetSearchSuggestions() http.HandlerFunc
- func GetSubscriptionFilterSuggestions() http.HandlerFunc
- func Home() http.HandlerFunc
- func ImageProxy(proxyURLBase string) http.HandlerFunc
- func ImportSubscriptions() http.HandlerFunc
- func Landing() http.HandlerFunc
- func ListArticles() http.HandlerFunc
- func ListCategories() http.HandlerFunc
- func ListFavorites() http.HandlerFunc
- func ListSubscriptions() http.HandlerFunc
- func LoadCachedImage(res http.ResponseWriter, req *http.Request)
- func Login(res http.ResponseWriter, req *http.Request)
- func LoginCallback(res http.ResponseWriter, req *http.Request)
- func LoginError(res http.ResponseWriter, req *http.Request)
- func Logout(res http.ResponseWriter, req *http.Request)
- func MarkArticle() http.HandlerFunc
- func MarkArticles() http.HandlerFunc
- func MarkSubscription() http.HandlerFunc
- func MarkSubscriptions() http.HandlerFunc
- func NotFound() http.HandlerFunc
- func PaginateArticles() http.HandlerFunc
- func PaginateSubscriptions() http.HandlerFunc
- func PolicyDocsHandler() http.HandlerFunc
- func RemoveFavoriteArticle() http.HandlerFunc
- func RemoveFavoriteSubscription() http.HandlerFunc
- func RemoveSubscription() http.HandlerFunc
- func RobotsHandler() http.Handler
- func SaveAccountSettings() http.HandlerFunc
- func SaveDisplaySettings() http.HandlerFunc
- func SaveSubscription() http.HandlerFunc
- func SetTheme() http.HandlerFunc
- func ShowAccountSettings() http.HandlerFunc
- func ShowDisplaySettings() http.HandlerFunc
- func ShowSettings() http.HandlerFunc
- func StaticFileHandler(fs http.FileSystem) http.Handler
- func SubmitObjectIssues() http.HandlerFunc
- func SubmitPageIssues() http.HandlerFunc
- func UserAccountCancel() http.HandlerFunc
- func UserAccountIssue() http.HandlerFunc
- func UserAccountSuccess() http.HandlerFunc
- func UserCancelDeactivation() http.HandlerFunc
- func UserChooseSubscriptionPlan() http.HandlerFunc
- func UserDeactivateAccount() http.HandlerFunc
- func UserManageAccountSubscription() http.HandlerFunc
- func UserSubscriptionPlanCheckout() http.HandlerFunc
- func ViewArticle() http.HandlerFunc
- func Viewer() http.HandlerFunc
- func WatchHome() http.HandlerFunc
- func WatchList() http.HandlerFunc
- func WatchSearchResults() http.HandlerFunc
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 About ¶ added in v0.21.0
func About() http.HandlerFunc
func AddFavoriteArticle ¶
func AddFavoriteArticle() http.HandlerFunc
AddFavoriteArticle handles adding a new favorite article for a user.
func AddFavoriteSubscription ¶
func AddFavoriteSubscription() http.HandlerFunc
AddFavoriteSubscription handles adding a new favorite subscription for a user.
func AddFeedSubscription ¶
func AddFeedSubscription() http.HandlerFunc
AddFeedSubscription handles adding a new subscription to a feed.
func AddFeedset ¶
func AddFeedset(static embed.FS) http.HandlerFunc
AddFeedset handles adding a feedset as subscriptions.
func AddGroupSubscription ¶
func AddGroupSubscription() http.HandlerFunc
AddGroupSubscription handles adding a new group subscription.
func AddSearchSubscription ¶
func AddSearchSubscription() http.HandlerFunc
AddSearchSubscription handles adding a new search subscription.
func AddSubscriptionFilter ¶
func AddSubscriptionFilter() http.HandlerFunc
AddSubscriptionFilter handles adding a subscription as a search filter.
func AdjustSubscriptionCategories ¶
func AdjustSubscriptionCategories() http.HandlerFunc
AdjustSubscriptionCategories handles adding and removing categories from a subscription, either when editing or adding.
func CSRFError ¶
func CSRFError() http.HandlerFunc
CSRFError handles CSRF error conditions. It will log details about the request then show an error page to the user.
func ChangePassword ¶
func ChangePassword() http.HandlerFunc
ChangePassword handles a change password request from the user.
func DocumentationHandler ¶
func DocumentationHandler() http.HandlerFunc
DocumentationHandler handles serving Markdown documents for help/documentation from directory in the embedded fs.
func EditSubscription ¶
func EditSubscription() http.HandlerFunc
EditSubscription handles presenting the user with a form for editing a subscription.
func ExportSubscriptions ¶
func ExportSubscriptions() http.HandlerFunc
ExportSubscriptions handles configuring and performing an export of user subscriptions.
func FindSimilarArticles ¶
func FindSimilarArticles() http.HandlerFunc
FindSimilarArticles handles finding articles similar to the given article and showing the results.
func GenerateSubscriptionEmail ¶ added in v0.26.0
func GenerateSubscriptionEmail() http.HandlerFunc
func GetObjectIssues ¶
func GetObjectIssues() http.HandlerFunc
GetObjectIssues presents a form for entering issues about a particular object (subscription/article).
func GetPageIssues ¶
func GetPageIssues() http.HandlerFunc
GetPageIssues handles presenting a form for the user to submit issues about the app.
func GetSearchResults ¶
func GetSearchResults() http.HandlerFunc
GetSearchResults performs a search with the user input and renders a page with the search results.
func GetSearchSuggestions ¶
func GetSearchSuggestions() http.HandlerFunc
GetSearchSuggestions performs a search with the user input and presents suggestions back to the user.
func GetSubscriptionFilterSuggestions ¶
func GetSubscriptionFilterSuggestions() http.HandlerFunc
GetSubscriptionFilterSuggestions handles showing a list of subscriptions as suggestions when building a search query.
func ImageProxy ¶
func ImageProxy(proxyURLBase string) http.HandlerFunc
func ImportSubscriptions ¶
func ImportSubscriptions() http.HandlerFunc
ImportSubscriptions handles assisting the user with importing subscriptions from an external source.
func ListArticles ¶
func ListArticles() http.HandlerFunc
ListArticles handles fetching articles based on the given page filters and displaying them.
func ListCategories ¶ added in v0.27.0
func ListCategories() http.HandlerFunc
ListCategories handles returning a list of categories that can be used for filtering subscriptions or articles.
func ListFavorites ¶
func ListFavorites() http.HandlerFunc
ListFavorites handles fetching the favorite subscriptions and articles of a user and showing them in a grid layout.
func ListSubscriptions ¶
func ListSubscriptions() http.HandlerFunc
ListSubscriptions handles fetching subscriptions based on the given page filters and displaying them. When the request method is GET (i.e. initial page load), the subscriptions are shown in a grid layout. When the request method is POST (i.e. pagination request), the subscriptions are shown as a list.
func LoadCachedImage ¶
func LoadCachedImage(res http.ResponseWriter, req *http.Request)
LoadCachedImage handles fetching and displaying an image from one of the image caches.
func LoginCallback ¶
func LoginCallback(res http.ResponseWriter, req *http.Request)
LoginCallback handles processing the response from a login provider.
func LoginError ¶
func LoginError(res http.ResponseWriter, req *http.Request)
LoginError handles login errors, including invalid login callback URL, missing parameters, expired password reset links.
func Logout ¶
func Logout(res http.ResponseWriter, req *http.Request)
Logout handles logout requests.
func MarkArticle ¶
func MarkArticle() http.HandlerFunc
MarkArticle handles marking an article as read/unread and updates the UI accordingly.
func MarkArticles ¶
func MarkArticles() http.HandlerFunc
MarkArticles handles marking multiple articles as read/unread and updating the UI appropriately.
func MarkSubscription ¶
func MarkSubscription() http.HandlerFunc
MarkSubscription handles marking a subscription as read/unread and updates the UI accordingly.
func MarkSubscriptions ¶
func MarkSubscriptions() http.HandlerFunc
MarkSubscriptions handles marking a list of subscriptions.
func NotFound ¶
func NotFound() http.HandlerFunc
NotFound handles showing a page for a 404 response.
func PaginateArticles ¶
func PaginateArticles() http.HandlerFunc
PaginateArticles handles a request to list more articles.
func PaginateSubscriptions ¶
func PaginateSubscriptions() http.HandlerFunc
func PolicyDocsHandler ¶
func PolicyDocsHandler() http.HandlerFunc
PolicyDocsHandler handles serving policy Markdown documents from directory in the embedded fs.
func RemoveFavoriteArticle ¶
func RemoveFavoriteArticle() http.HandlerFunc
RemoveFavoriteArticle handles removing a favorite article for a user.
func RemoveFavoriteSubscription ¶
func RemoveFavoriteSubscription() http.HandlerFunc
RemoveFavoriteSubscription handles removing a favorite subscription for a user.
func RemoveSubscription ¶
func RemoveSubscription() http.HandlerFunc
RemoveSubscription handles removing (unsubscribing) from a subscription.
func RobotsHandler ¶
RobotsHandler handles requests for robots.txt. In the future, it may handle more requests from non natural human clients...
func SaveAccountSettings ¶
func SaveAccountSettings() http.HandlerFunc
SaveAccountSettings handles processing and saving new account settings.
func SaveDisplaySettings ¶
func SaveDisplaySettings() http.HandlerFunc
SaveDisplaySettings handles saving user settings after user submitted changes.
func SaveSubscription ¶
func SaveSubscription() http.HandlerFunc
SaveSubscription handles saving the edits made by a user to a subscription.
func SetTheme ¶
func SetTheme() http.HandlerFunc
SetTheme handles setting a theme selected by the user.
func ShowAccountSettings ¶
func ShowAccountSettings() http.HandlerFunc
ShowAccountSettings handles showing the settings related to user accounts.
func ShowDisplaySettings ¶
func ShowDisplaySettings() http.HandlerFunc
ShowDisplaySettings handles showing the settings related to the application display.
func ShowSettings ¶
func ShowSettings() http.HandlerFunc
ShowSettings handles retrieving and rendering the user settings page.
func StaticFileHandler ¶
func StaticFileHandler(fs http.FileSystem) http.Handler
StaticFileHandler handles serving content from the embedded filesystem containing static assets (i.e., images, etc.).
func SubmitObjectIssues ¶
func SubmitObjectIssues() http.HandlerFunc
SubmitObjectIssues handles processing the issue form and creating a github issue with the details.
func SubmitPageIssues ¶
func SubmitPageIssues() http.HandlerFunc
SubmitPageIssues handles processing the user submitted subscription issues form.
func UserAccountCancel ¶
func UserAccountCancel() http.HandlerFunc
func UserAccountIssue ¶
func UserAccountIssue() http.HandlerFunc
UserAccountIssue 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 UserAccountSuccess ¶
func UserAccountSuccess() http.HandlerFunc
func UserCancelDeactivation ¶
func UserCancelDeactivation() http.HandlerFunc
UserCancelDeactivation handles a user request to stop the pending deactivation of their account. The cancellation will be reversed in Stripe and full account functionality restored.
func UserChooseSubscriptionPlan ¶
func UserChooseSubscriptionPlan() http.HandlerFunc
UserChooseSubscriptionPlan handles displaying a page on which the user can choose a subscription plan for purchase.
func UserDeactivateAccount ¶
func UserDeactivateAccount() http.HandlerFunc
UserDeactivateAccount 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 UserManageAccountSubscription ¶
func UserManageAccountSubscription() http.HandlerFunc
func UserSubscriptionPlanCheckout ¶
func UserSubscriptionPlanCheckout() http.HandlerFunc
UserSubscriptionPlanCheckout handles processing the user's choice of subscription plan and redirecting to the payment processor.
func ViewArticle ¶
func ViewArticle() http.HandlerFunc
ViewArticle handles showing an article's content.
func Viewer ¶ added in v0.21.0
func Viewer() http.HandlerFunc
func WatchHome ¶
func WatchHome() http.HandlerFunc
WatchHome handles watching the home page content (namely, latest articles) for updates.
func WatchList ¶
func WatchList() http.HandlerFunc
WatchList handles watching a list of object for any updates and rendering a notification to the user to refresh the page.
func WatchSearchResults ¶
func WatchSearchResults() http.HandlerFunc
WatchSearchResults handles watching the search results for any updates and rendering a notification to the user to refresh the page.
Types ¶
This section is empty.