handlers

package
v0.29.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: AGPL-3.0 Imports: 54 Imported by: 0

Documentation

Overview

Package handlers contains chainable handlers/middleware for routing.

Index

Constants

This section is empty.

Variables

View Source
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 Home

func Home() http.HandlerFunc

Home handles displaying the user's home page.

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 Landing

func Landing() http.HandlerFunc

Landing handles displaying the landing page.

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 Login

func Login(res http.ResponseWriter, req *http.Request)

Login handles login requests.

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

func RobotsHandler() http.Handler

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL