Documentation
¶
Overview ¶
Package handlers contains chainable handlers/middleware for routing.
Index ¶
- Variables
- func AddSubscriptionFilter() http.HandlerFunc
- func DocumentationHandler() http.HandlerFunc
- func FavoriteArticle() http.HandlerFunc
- func GetSubscriptionActionSuggestions() http.HandlerFunc
- func GetSubscriptionFilterSuggestions() http.HandlerFunc
- func HandleAbout() http.HandlerFunc
- func HandleAccountCancel() http.HandlerFunc
- func HandleAccountIssue() http.HandlerFunc
- func HandleAccountSuccess() http.HandlerFunc
- func HandleAddFeedSubscription() http.HandlerFunc
- func HandleAddFeedset(static embed.FS) http.HandlerFunc
- func HandleAddGroupSubscription() http.HandlerFunc
- func HandleAddSearchSubscription() http.HandlerFunc
- func HandleAddSubscriptionToGroup() http.HandlerFunc
- func HandleAddSubscriptionToSearch() http.HandlerFunc
- func HandleCancelDeactivation() http.HandlerFunc
- func HandleChangePassword() http.HandlerFunc
- func HandleChooseSubscriptionPlan() http.HandlerFunc
- func HandleDeactivateAccount() http.HandlerFunc
- func HandleEditSubscription() http.HandlerFunc
- func HandleExportSubscriptions() http.HandlerFunc
- func HandleExternalError(err error) http.HandlerFunc
- func HandleFavoriteSubscription() http.HandlerFunc
- func HandleFindSimilarArticles() http.HandlerFunc
- func HandleGenerateSubscriptionEmail() http.HandlerFunc
- func HandleHome() http.HandlerFunc
- func HandleImportSubscriptions() http.HandlerFunc
- func HandleInternalError(err error) http.HandlerFunc
- func HandleLanding() http.HandlerFunc
- func HandleListArticles() http.HandlerFunc
- func HandleListFavorites() http.HandlerFunc
- func HandleListSubscriptions() http.HandlerFunc
- func HandleLogin(res http.ResponseWriter, req *http.Request)
- func HandleLoginCallback(res http.ResponseWriter, req *http.Request)
- func HandleLoginError(res http.ResponseWriter, req *http.Request)
- func HandleManageAccountSubscription() http.HandlerFunc
- func HandleMarkSubscription() http.HandlerFunc
- func HandleMarkSubscriptions() http.HandlerFunc
- func HandleNotFound() http.HandlerFunc
- func HandlePosts() http.HandlerFunc
- func HandlePostsFeed() http.HandlerFunc
- func HandleRemoveSubscription() http.HandlerFunc
- func HandleReportObjectIssue() http.HandlerFunc
- func HandleReportPageIssue() http.HandlerFunc
- func HandleSaveAccountSettings() http.HandlerFunc
- func HandleSaveDisplaySettings() http.HandlerFunc
- func HandleSaveSubscription() http.HandlerFunc
- func HandleSearchResults() http.HandlerFunc
- func HandleSearchSuggestions() http.HandlerFunc
- func HandleShowAccountSettings() http.HandlerFunc
- func HandleShowDisplaySettings() http.HandlerFunc
- func HandleSitemap() http.Handler
- func HandleSubmitObjectIssue() http.HandlerFunc
- func HandleSubmitPageIssue() http.HandlerFunc
- func HandleSubscriptionCategories() http.HandlerFunc
- func HandleSubscriptionPlanCheckout() http.HandlerFunc
- func HandleSuggestSubscriptionForSearch() http.HandlerFunc
- func HandleUserUnsubscribe() http.HandlerFunc
- func HandleViewArticle() http.HandlerFunc
- func HandleViewer() http.HandlerFunc
- func ImageProxy(proxyURLBase string) http.HandlerFunc
- func ListCategories() http.HandlerFunc
- func LoadCachedImage(res http.ResponseWriter, req *http.Request)
- func Logout(res http.ResponseWriter, req *http.Request)
- func MarkArticle() http.HandlerFunc
- func MarkArticles() http.HandlerFunc
- func PolicyDocsHandler() http.HandlerFunc
- func RenderExternalPage(content ExternalPage) http.HandlerFunc
- func RenderInternalPage(content InternalPage) http.HandlerFunc
- func RenderPartial(content PartialResponseHandler) http.HandlerFunc
- func ShareArticle() http.HandlerFunc
- func ShowSettings() http.HandlerFunc
- func StaticFileHandler(fs http.FileSystem) http.Handler
- func WatchHome() http.HandlerFunc
- func WatchList() http.HandlerFunc
- func WatchSearchResults() http.HandlerFunc
- type About
- type AccountIssue
- type AddSubscription
- type ArticleContent
- type ChooseSubscriptionPlan
- type EditSubscription
- type ExportSubscriptions
- type ExternalError
- type ExternalPage
- type Favorites
- type FullResponseHandler
- type Help
- type Home
- type ImportSubscriptions
- type ImportSubscriptionsResults
- type InternalError
- type InternalPage
- type Landing
- type ListArticles
- type ListSubscriptions
- type Login
- type Modal
- type NotFoundPage
- type Notification
- type ObjectIssue
- type PageIssue
- type PartialResponseHandler
- type PartialTemplate
- type Post
- type PostsIndex
- type SearchResults
- type SearchSuggestions
- type SimilarArticles
- type Unsubscribe
- type UnsubscribeResult
- type UpdatesFound
- type UpdatesHandler
- type UpdatesStream
- 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 DocumentationHandler ¶
func DocumentationHandler() http.HandlerFunc
DocumentationHandler handles serving Markdown documents for help/documentation from directory in the embedded fs.
func FavoriteArticle ¶ added in v0.31.0
func FavoriteArticle() http.HandlerFunc
FavoriteArticle handles adding an article favorite.
func GetSubscriptionActionSuggestions ¶ added in v0.73.0
func GetSubscriptionActionSuggestions() http.HandlerFunc
GetSubscriptionActionSuggestions handles showing a list of subscriptions as suggestions when building a search query.
func GetSubscriptionFilterSuggestions ¶
func GetSubscriptionFilterSuggestions() 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() http.HandlerFunc
func HandleAccountCancel ¶ added in v0.39.0
func HandleAccountCancel() 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 HandleAddFeedSubscription ¶ added in v0.39.0
func HandleAddFeedSubscription() http.HandlerFunc
HandleAddFeedSubscription handles adding a new subscription to a feed.
func HandleAddFeedset ¶ added in v0.39.0
func HandleAddFeedset(static embed.FS) http.HandlerFunc
HandleAddFeedset handles adding a feedset as subscriptions.
func HandleAddGroupSubscription ¶ added in v0.39.0
func HandleAddGroupSubscription() http.HandlerFunc
HandleAddGroupSubscription handles adding a new group subscription.
func HandleAddSearchSubscription ¶ added in v0.39.0
func HandleAddSearchSubscription() http.HandlerFunc
HandleAddSearchSubscription handles adding a new search subscription.
func HandleAddSubscriptionToGroup ¶ added in v0.54.0
func HandleAddSubscriptionToGroup() http.HandlerFunc
func HandleAddSubscriptionToSearch ¶ added in v0.54.0
func HandleAddSubscriptionToSearch() http.HandlerFunc
func HandleCancelDeactivation ¶ added in v0.39.0
func HandleCancelDeactivation() http.HandlerFunc
HandleCancelDeactivation 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 HandleChangePassword ¶ added in v0.39.0
func HandleChangePassword() http.HandlerFunc
HandleChangePassword handles a change password request from the user.
func HandleChooseSubscriptionPlan ¶ added in v0.39.0
func HandleChooseSubscriptionPlan() http.HandlerFunc
HandleChooseSubscriptionPlan handles displaying a page on which the user can choose a subscription plan for purchase.
func HandleDeactivateAccount ¶ added in v0.39.0
func HandleDeactivateAccount() 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 HandleEditSubscription ¶ added in v0.39.0
func HandleEditSubscription() http.HandlerFunc
HandleEditSubscription handles presenting the user with a form for editing a subscription.
func HandleExportSubscriptions ¶ added in v0.39.0
func HandleExportSubscriptions() 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 HandleFavoriteSubscription ¶ added in v0.39.0
func HandleFavoriteSubscription() http.HandlerFunc
HandleFavoriteSubscription handles managing a favorite subscription for a user.
func HandleFindSimilarArticles ¶ added in v0.39.0
func HandleFindSimilarArticles() http.HandlerFunc
HandleFindSimilarArticles handles finding articles similar to the given article and showing the results.
func HandleGenerateSubscriptionEmail ¶ added in v0.39.0
func HandleGenerateSubscriptionEmail() http.HandlerFunc
func HandleHome ¶ added in v0.37.0
func HandleHome() http.HandlerFunc
HandleHome handles displaying the user's home page.
func HandleImportSubscriptions ¶ added in v0.39.0
func HandleImportSubscriptions() http.HandlerFunc
HandleImportSubscriptions handles assisting the user with importing subscriptions from an external source.
func HandleInternalError ¶ added in v0.36.0
func HandleInternalError(err error) http.HandlerFunc
HandleInternalError handles display errors on internal pages (pages accessible to logged in users).
func HandleLanding ¶ added in v0.38.0
func HandleLanding() http.HandlerFunc
func HandleListArticles ¶ added in v0.39.0
func HandleListArticles() http.HandlerFunc
HandleListArticles handles fetching articles based on the given page filters and displaying them.
func HandleListFavorites ¶ added in v0.39.0
func HandleListFavorites() 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() http.HandlerFunc
HandleListSubscriptions handles displaying a list of subscriptions.
func HandleLogin ¶ added in v0.36.0
func HandleLogin(res http.ResponseWriter, req *http.Request)
HandleLogin handles user login or sign-up requests.
func HandleLoginCallback ¶ added in v0.36.0
func HandleLoginCallback(res http.ResponseWriter, req *http.Request)
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 HandleManageAccountSubscription ¶ added in v0.39.0
func HandleManageAccountSubscription() http.HandlerFunc
func HandleMarkSubscription ¶ added in v0.39.0
func HandleMarkSubscription() http.HandlerFunc
HandleMarkSubscription handles marking a subscription as read/unread and updates the UI accordingly.
func HandleMarkSubscriptions ¶ added in v0.39.0
func HandleMarkSubscriptions() http.HandlerFunc
HandleMarkSubscriptions handles marking a list of subscriptions.
func HandleNotFound ¶ added in v0.36.0
func HandleNotFound() http.HandlerFunc
HandleNotFound handles showing a page for a 404 response.
func HandlePosts ¶ added in v0.39.0
func HandlePosts() http.HandlerFunc
HandlePosts handles showing the posts index or individual posts.
func HandlePostsFeed ¶ added in v0.51.0
func HandlePostsFeed() http.HandlerFunc
HandlePostsFeed handles showing an RSS file for posts.
func HandleRemoveSubscription ¶ added in v0.39.0
func HandleRemoveSubscription() http.HandlerFunc
HandleRemoveSubscription handles removing (unsubscribing) from a subscription.
func HandleReportObjectIssue ¶ added in v0.39.0
func HandleReportObjectIssue() http.HandlerFunc
HandleReportObjectIssue presents a form for entering issues about a particular object (subscription/article).
func HandleReportPageIssue ¶ added in v0.39.0
func HandleReportPageIssue() http.HandlerFunc
HandleReportPageIssue handles presenting a form for the user to submit issues about the app.
func HandleSaveAccountSettings ¶ added in v0.39.0
func HandleSaveAccountSettings() http.HandlerFunc
HandleSaveAccountSettings handles processing and saving new account settings.
func HandleSaveDisplaySettings ¶ added in v0.39.0
func HandleSaveDisplaySettings() http.HandlerFunc
HandleSaveDisplaySettings handles saving user settings after user submitted changes.
func HandleSaveSubscription ¶ added in v0.39.0
func HandleSaveSubscription() http.HandlerFunc
HandleSaveSubscription handles saving the edits made by a user to a subscription.
func HandleSearchResults ¶ added in v0.39.0
func HandleSearchResults() 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() http.HandlerFunc
HandleSearchSuggestions performs a search with the user input and presents suggestions back to the user.
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 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 HandleSubmitObjectIssue ¶ added in v0.39.0
func HandleSubmitObjectIssue() http.HandlerFunc
HandleSubmitObjectIssue handles processing the issue form and creating a github issue with the details.
func HandleSubmitPageIssue ¶ added in v0.39.0
func HandleSubmitPageIssue() http.HandlerFunc
HandleSubmitPageIssue 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 HandleSubscriptionPlanCheckout ¶ added in v0.39.0
func HandleSubscriptionPlanCheckout() http.HandlerFunc
HandleSubscriptionPlanCheckout handles processing the user's choice of subscription plan and redirecting to the payment processor.
func HandleSuggestSubscriptionForSearch ¶ added in v0.54.0
func HandleSuggestSubscriptionForSearch() http.HandlerFunc
func HandleUserUnsubscribe ¶ added in v0.87.0
func HandleUserUnsubscribe() 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() http.HandlerFunc
HandleViewArticle handles showing an article's content.
func HandleViewer ¶ added in v0.36.0
func HandleViewer() http.HandlerFunc
HandleViewer handles powering the feed viewer page.
func ImageProxy ¶
func ImageProxy(proxyURLBase string) http.HandlerFunc
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 LoadCachedImage ¶
func LoadCachedImage(res http.ResponseWriter, req *http.Request)
LoadCachedImage handles fetching and displaying an image from one of the image caches.
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 PolicyDocsHandler ¶
func PolicyDocsHandler() http.HandlerFunc
PolicyDocsHandler handles serving policy Markdown documents from directory in the embedded fs.
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 ShareArticle ¶ added in v0.34.1
func ShareArticle() http.HandlerFunc
ShareArticle handles sharing an article.
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 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 ¶
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 ChooseSubscriptionPlan ¶ added in v0.39.0
type ChooseSubscriptionPlan struct {
// contains filtered or unexported fields
}
ChooseSubscriptionPlan contains data for rendering a page to present the user with subscription plan options.
func (*ChooseSubscriptionPlan) FullResponse ¶ added in v0.39.0
func (t *ChooseSubscriptionPlan) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders the page for the user to choose a subscription plan.
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 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 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 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 Landing ¶
type Landing struct {
// contains filtered or unexported fields
}
func (*Landing) FullResponse ¶ added in v0.38.0
func (p *Landing) FullResponse(w http.ResponseWriter, r *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 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{}
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 ObjectIssue ¶ added in v0.39.0
type ObjectIssue struct {
// contains filtered or unexported fields
}
func (*ObjectIssue) FullResponse ¶ added in v0.39.0
func (t *ObjectIssue) FullResponse(res http.ResponseWriter, req *http.Request)
FullResponse renders a full page (headers, footers and content).
func (*ObjectIssue) PartialResponse ¶ added in v0.39.0
func (t *ObjectIssue) 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 PageIssue ¶ added in v0.39.0
type PageIssue struct {
// contains filtered or unexported fields
}
func (*PageIssue) FullResponse ¶ added in v0.39.0
func (t *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 (t *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
type Post struct {
*models.MarkdownFile
}
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 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 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 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 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 UpdatesFound ¶ added in v0.46.0
type UpdatesHandler ¶ added in v0.46.0
type UpdatesHandler struct {
// contains filtered or unexported fields
}
type UpdatesStream ¶ added in v0.46.0
type UpdatesStream struct{}
func (*UpdatesStream) InitialStreamResponse ¶ added in v0.46.0
func (s *UpdatesStream) InitialStreamResponse(res http.ResponseWriter, req *http.Request) (response any, ok bool)
func (*UpdatesStream) NextStreamResponse ¶ added in v0.46.0
type UserSettings ¶ added in v0.39.0
type UserSettings struct{}
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.