Documentation
¶
Overview ¶
Package handlers contains chainable handlers/middleware for routing.
Index ¶
- Variables
- func HandleAccountSuccess() http.HandlerFunc
- func HandlePaddleWebhook(userSvc UserService) http.HandlerFunc
- func HandleResendWebhook(subSvc SubscriptionsService, userSvc UserService, 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 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)
- 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 ImportStatus
- type ImportSubscriptions
- type Importer
- type InternalError
- type InternalPage
- type ItemService
- type Landing
- type Linter
- type LinterError
- type LinterResponse
- type ListArticles
- type ListSubscriptions
- type Login
- type Manager
- func (m *Manager) AddSubscriptionFilter() http.HandlerFunc
- func (m *Manager) AllSubscriptionsCtx(svc SubscriptionsService) func(next http.Handler) http.Handler
- func (m *Manager) ArticleCtx(itemSvc ItemService) func(next http.Handler) http.Handler
- func (m *Manager) CheckUserLimits(next http.Handler) http.Handler
- func (m *Manager) CustomisationCtx(next http.Handler) http.Handler
- func (m *Manager) DocumentationHandler(path string) http.HandlerFunc
- func (m *Manager) GetSubscriptionActionSuggestions(subs SubscriptionsService) http.HandlerFunc
- func (m *Manager) GetSubscriptionFilterSuggestions(svc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleAbout() http.HandlerFunc
- func (m *Manager) HandleAccountIssue() http.HandlerFunc
- func (m *Manager) HandleAddFeedset(feedSvc FeedService, subSvc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleAddGroupSubscription(subSvc SubscriptionsService, userSvc UserService) http.HandlerFunc
- func (m *Manager) HandleAddNewFeedSubscription(subSvc SubscriptionsService, userSvc UserService, feedSvc FeedService) http.HandlerFunc
- func (m *Manager) HandleAddSearchSubscription(subSvc SubscriptionsService, userSvc UserService) http.HandlerFunc
- func (m *Manager) HandleAddSubscription() http.HandlerFunc
- func (m *Manager) HandleAddSubscriptionToGroup() http.HandlerFunc
- func (m *Manager) HandleAddSubscriptionToSearch() http.HandlerFunc
- func (m *Manager) HandleAndroidPurchase(userSvc UserService) http.HandlerFunc
- func (m *Manager) HandleBrowseArticles(subSvc SubscriptionsService, itemSvc ItemService, direction string) http.HandlerFunc
- func (m *Manager) HandleBulkMarkArticles(subsSvc SubscriptionsService, mark models.Mark) http.HandlerFunc
- func (m *Manager) HandleBulkMarkSubscriptions(svc SubscriptionsService, mark models.Mark) http.HandlerFunc
- func (m *Manager) HandleBulkRemoveSubscriptions(svc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleChangePassword() http.HandlerFunc
- func (m *Manager) HandleChangelog() http.HandlerFunc
- func (m *Manager) HandleChangelogFeed() http.HandlerFunc
- func (m *Manager) HandleChooseAndroidSubscription(appCfg AppConfig) http.HandlerFunc
- func (m *Manager) HandleChoosePaddleSubscription(appCfg AppConfig) http.HandlerFunc
- func (m *Manager) HandleChooseSubscription() http.HandlerFunc
- func (m *Manager) HandleComparison() http.HandlerFunc
- func (m *Manager) HandleContact() http.HandlerFunc
- func (m *Manager) HandleDeactivateAccount(users UserService, auth *auth0.Authenticator) http.HandlerFunc
- func (m *Manager) HandleDiscover() http.HandlerFunc
- func (m *Manager) HandleDiscoverSuggestions(feedSvc FeedService) http.HandlerFunc
- func (m *Manager) HandleEditSubscription(subSvc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleExportSubscriptions(feedSvc FeedService) http.HandlerFunc
- func (m *Manager) HandleExternalError(err error) http.HandlerFunc
- func (m *Manager) HandleFavoriteArticle(itemSvc ItemService, userSvc UserService) http.HandlerFunc
- func (m *Manager) HandleFavoriteSubscription(svc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleFeatures() http.HandlerFunc
- func (m *Manager) HandleFeaturesCollect() http.HandlerFunc
- func (m *Manager) HandleFeaturesConsume() http.HandlerFunc
- func (m *Manager) HandleFeaturesCurate() http.HandlerFunc
- func (m *Manager) HandleFindSimilarArticles(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleForgetMe() http.HandlerFunc
- func (m *Manager) HandleGenerateSubscriptionEmail(users UserService) http.HandlerFunc
- func (m *Manager) HandleHome(homepageSvc HomePageService) http.HandlerFunc
- func (m *Manager) HandleImportStatus(importSvc Importer, subSvc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleInternalError(status int, err error, options ...ErrorOption) http.HandlerFunc
- func (m *Manager) HandleLanding() http.HandlerFunc
- func (m *Manager) HandleLinter(httpClient *resty.Client) http.HandlerFunc
- func (m *Manager) HandleListArticles(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleListArticlesUpdates(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleListFavorites(subSvc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleListSubscriptions(subscriptionSvc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleListSubscriptionsUpdates(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleLogin(authenticator *auth0.Authenticator) http.HandlerFunc
- func (m *Manager) HandleLoginCallback(userSvc UserService, authenticator *auth0.Authenticator) http.HandlerFunc
- func (m *Manager) HandleLoginError(res http.ResponseWriter, req *http.Request)
- func (m *Manager) HandleLogout(authenticator *auth0.Authenticator) http.HandlerFunc
- func (m *Manager) HandleManageAccountSubscription() http.HandlerFunc
- func (m *Manager) HandleMap(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleMapUpdates(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleMarkArticle(subsSvc SubscriptionsService, mark models.Mark) http.HandlerFunc
- func (m *Manager) HandleMarkSubscription(subSvc SubscriptionsService, mark models.Mark) http.HandlerFunc
- func (m *Manager) HandleNotFound() http.HandlerFunc
- func (m *Manager) HandlePosts() http.HandlerFunc
- func (m *Manager) HandlePostsFeed() http.HandlerFunc
- func (m *Manager) HandlePurchaseSubscription(userSvc UserService) http.HandlerFunc
- func (m *Manager) HandlePurchaseSubscriptionSuccess() http.HandlerFunc
- func (m *Manager) HandleRefreshToken(httpclient *resty.Client, authenticator *auth0.Authenticator) http.HandlerFunc
- func (m *Manager) HandleRemoveSubscription(svc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleReportIssue() http.HandlerFunc
- func (m *Manager) HandleSaveAccountSettings(users UserService, cache ImageCache) http.HandlerFunc
- func (m *Manager) HandleSaveDisplaySettings(users UserService) http.HandlerFunc
- func (m *Manager) HandleSaveFontSettings(users UserService) http.HandlerFunc
- func (m *Manager) HandleSaveSubscription(cache ImageCache, svc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleSaveSubscriptionsSettings(users UserService) http.HandlerFunc
- func (m *Manager) HandleSaveThemeSettings(users UserService) http.HandlerFunc
- func (m *Manager) HandleSearchResults(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleSearchSuggestions(svc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleSearchUpdates(itemSvc ItemService) http.HandlerFunc
- func (m *Manager) HandleSetupImport(subSvc SubscriptionsService, userSvc UserService) http.HandlerFunc
- func (m *Manager) HandleShareArticle() http.HandlerFunc
- func (m *Manager) HandleShowAccountSettings() http.HandlerFunc
- func (m *Manager) HandleShowDisplaySettings() http.HandlerFunc
- func (m *Manager) HandleShowSubscriptionsSettings() http.HandlerFunc
- func (m *Manager) HandleSitemap() http.Handler
- func (m *Manager) HandleStartImport(importSvc Importer) http.HandlerFunc
- func (m *Manager) HandleSubmitContact() http.HandlerFunc
- func (m *Manager) HandleSubmitForgetMe() http.HandlerFunc
- func (m *Manager) HandleSubmitIssue(cache ImageCache) http.HandlerFunc
- func (m *Manager) HandleSubscriptionCategories() http.HandlerFunc
- func (m *Manager) HandleSuggestFeeds(feeds FeedService) http.HandlerFunc
- func (m *Manager) HandleSuggestSubscriptionForSearch(svc SubscriptionsService) http.HandlerFunc
- func (m *Manager) HandleUserUnsubscribe(users UserService) http.HandlerFunc
- func (m *Manager) HandleViewArticle(itemSvc ItemService, httpClient *resty.Client, itemsCache cache.ObjectCache) http.HandlerFunc
- func (m *Manager) HandleViewer(feedSvc FeedService) http.HandlerFunc
- func (m *Manager) ListCategories(subSvc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
- func (m *Manager) NewPageServices() pageServices
- func (m *Manager) PolicyDocsHandler() http.HandlerFunc
- func (m *Manager) ShowSettings() http.HandlerFunc
- func (m *Manager) SubscriptionCtx(svc SubscriptionsService) func(next http.Handler) http.Handler
- func (m *Manager) ValidateSubscriptionLimits(users UserService, subscriptions SubscriptionsService) func(next http.Handler) http.Handler
- type MapArticles
- type Modal
- type NotFoundPage
- type Notification
- type PageIssue
- type PartialResponseHandler
- type PartialTemplate
- type Post
- type PostHandlerHook
- type PostsIndex
- type PurchaseSubscriptionSuccess
- 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 HandleAccountSuccess ¶ added in v0.39.0
func HandleAccountSuccess() http.HandlerFunc
func HandlePaddleWebhook ¶ added in v0.143.0
func HandlePaddleWebhook(userSvc UserService) http.HandlerFunc
HandlePaddleWebhook handles incoming webhooks from paddle.
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 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 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.
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 {
// contains filtered or unexported fields
}
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) FullResponse ¶ added in v0.129.0
func (p *Contact) FullResponse(res http.ResponseWriter, req *http.Request)
type Discover ¶ added in v0.223.0
type Discover struct {
// contains filtered or unexported fields
}
func (*Discover) FullResponse ¶ added in v0.223.0
func (p *Discover) FullResponse(res http.ResponseWriter, req *http.Request)
func (*Discover) PartialResponse ¶ added in v0.223.0
func (p *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, text string) (*models.SuggestFeedsResults, error)
SuggestFeeds(ctx context.Context, request *models.SuggestFeedsRequest) (*models.SuggestFeedsResults, error)
FindOrCreateFeed(ctx context.Context, feedURL string) (*models.Feed, bool, error)
FetchFeed(ctx context.Context, feedURL string, options ...service.FetchOption) (*models.Feed, 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 ImportStatus ¶ added in v0.237.0
type ImportStatus struct {
// contains filtered or unexported fields
}
func (*ImportStatus) FullResponse ¶ added in v0.237.0
func (p *ImportStatus) FullResponse(res http.ResponseWriter, req *http.Request)
func (*ImportStatus) PartialResponse ¶ added in v0.237.0
func (p *ImportStatus) PartialResponse(res http.ResponseWriter, req *http.Request)
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 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)
GetTopLanguageCountsForItems(ctx context.Context, itemsQuery query.Option) (map[string]int64, 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 Manager ¶ added in v0.235.1
type Manager struct {
AppConfig AppConfig
SessionMgr SessionManager
Breadcrumbs Breadcrumbs
}
Manager contains the common interfaces that nearly all handlers require access to.
func (*Manager) AddSubscriptionFilter ¶ added in v0.235.1
func (m *Manager) AddSubscriptionFilter() http.HandlerFunc
AddSubscriptionFilter handles adding a subscription as a search filter.
func (*Manager) AllSubscriptionsCtx ¶ added in v0.235.2
func (m *Manager) AllSubscriptionsCtx(svc SubscriptionsService) func(next http.Handler) http.Handler
SubscriptionCtx retrieves the subscription matching the URL param and stores it in the context.
func (*Manager) ArticleCtx ¶ added in v0.235.2
ArticleCtx retrieves the article matching the URL param and stores it in the context.
func (*Manager) CheckUserLimits ¶ added in v0.235.2
CheckUserLimits checks that the user has not breached their account limits. If they have, this middleware will break the chain and return a 403. Otherwise it will pass control silently to the next handler.
func (*Manager) CustomisationCtx ¶ added in v0.236.0
CustomisationCtx retrieves the user settings and stores some values in the session cookie for use by templates. If the user has not made any relevant customisations, this middleware does nothing. It's safe to apply outside of authenticated paths as it is a no-op if there is no user.
func (*Manager) DocumentationHandler ¶ added in v0.235.1
func (m *Manager) DocumentationHandler(path string) http.HandlerFunc
DocumentationHandler handles serving Markdown documents for help/documentation from directory in the embedded fs.
func (*Manager) GetSubscriptionActionSuggestions ¶ added in v0.235.1
func (m *Manager) GetSubscriptionActionSuggestions(subs SubscriptionsService) http.HandlerFunc
GetSubscriptionActionSuggestions handles showing a list of subscriptions as suggestions when building a search query.
func (*Manager) GetSubscriptionFilterSuggestions ¶ added in v0.235.1
func (m *Manager) GetSubscriptionFilterSuggestions(svc SubscriptionsService) http.HandlerFunc
GetSubscriptionFilterSuggestions handles showing a list of subscriptions as suggestions when building a search query.
func (*Manager) HandleAbout ¶ added in v0.235.1
func (m *Manager) HandleAbout() http.HandlerFunc
func (*Manager) HandleAccountIssue ¶ added in v0.235.1
func (m *Manager) 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 (*Manager) HandleAddFeedset ¶ added in v0.235.1
func (m *Manager) HandleAddFeedset( feedSvc FeedService, subSvc SubscriptionsService, ) http.HandlerFunc
HandleAddFeedset handles adding a feedset as subscriptions.
func (*Manager) HandleAddGroupSubscription ¶ added in v0.235.1
func (m *Manager) HandleAddGroupSubscription( subSvc SubscriptionsService, userSvc UserService, ) http.HandlerFunc
HandleAddGroupSubscription handles adding a new group subscription.
func (*Manager) HandleAddNewFeedSubscription ¶ added in v0.235.1
func (m *Manager) HandleAddNewFeedSubscription( subSvc SubscriptionsService, userSvc UserService, feedSvc FeedService, ) http.HandlerFunc
HandleAddNewFeedSubscription handles adding a new feed subscription for a user.
func (*Manager) HandleAddSearchSubscription ¶ added in v0.235.1
func (m *Manager) HandleAddSearchSubscription( subSvc SubscriptionsService, userSvc UserService, ) http.HandlerFunc
HandleAddSearchSubscription handles adding a new search subscription.
func (*Manager) HandleAddSubscription ¶ added in v0.235.1
func (m *Manager) HandleAddSubscription() http.HandlerFunc
HandleAddSubscription handles showing a form for adding a new subscription.
func (*Manager) HandleAddSubscriptionToGroup ¶ added in v0.235.1
func (m *Manager) HandleAddSubscriptionToGroup() http.HandlerFunc
func (*Manager) HandleAddSubscriptionToSearch ¶ added in v0.235.1
func (m *Manager) HandleAddSubscriptionToSearch() http.HandlerFunc
func (*Manager) HandleAndroidPurchase ¶ added in v0.235.2
func (m *Manager) HandleAndroidPurchase(userSvc UserService) http.HandlerFunc
HandleAndroidPurchase receives a purchaseToken from the client and verifies it server-side.
func (*Manager) HandleBrowseArticles ¶ added in v0.235.1
func (m *Manager) HandleBrowseArticles( subSvc SubscriptionsService, itemSvc ItemService, direction string, ) http.HandlerFunc
func (*Manager) HandleBulkMarkArticles ¶ added in v0.235.1
func (m *Manager) HandleBulkMarkArticles( subsSvc SubscriptionsService, mark models.Mark, ) http.HandlerFunc
HandleBulkMarkArticles handles marking multiple articles.
func (*Manager) HandleBulkMarkSubscriptions ¶ added in v0.235.1
func (m *Manager) HandleBulkMarkSubscriptions(svc SubscriptionsService, mark models.Mark) http.HandlerFunc
HandleBulkMarkSubscriptions handles bulk marking subscriptions as read/unread.
func (*Manager) HandleBulkRemoveSubscriptions ¶ added in v0.237.0
func (m *Manager) HandleBulkRemoveSubscriptions(svc SubscriptionsService) http.HandlerFunc
func (*Manager) HandleChangePassword ¶ added in v0.235.1
func (m *Manager) HandleChangePassword() http.HandlerFunc
HandleChangePassword handles a change password request from the user.
func (*Manager) HandleChangelog ¶ added in v0.235.1
func (m *Manager) HandleChangelog() http.HandlerFunc
func (*Manager) HandleChangelogFeed ¶ added in v0.235.1
func (m *Manager) HandleChangelogFeed() http.HandlerFunc
func (*Manager) HandleChooseAndroidSubscription ¶ added in v0.235.2
func (m *Manager) HandleChooseAndroidSubscription(appCfg AppConfig) http.HandlerFunc
func (*Manager) HandleChoosePaddleSubscription ¶ added in v0.235.2
func (m *Manager) HandleChoosePaddleSubscription(appCfg AppConfig) http.HandlerFunc
func (*Manager) HandleChooseSubscription ¶ added in v0.235.1
func (m *Manager) HandleChooseSubscription() http.HandlerFunc
func (*Manager) HandleComparison ¶ added in v0.235.1
func (m *Manager) HandleComparison() http.HandlerFunc
func (*Manager) HandleContact ¶ added in v0.235.1
func (m *Manager) HandleContact() http.HandlerFunc
func (*Manager) HandleDeactivateAccount ¶ added in v0.235.1
func (m *Manager) HandleDeactivateAccount( users UserService, auth *auth0.Authenticator, ) 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 (*Manager) HandleDiscover ¶ added in v0.235.1
func (m *Manager) HandleDiscover() http.HandlerFunc
func (*Manager) HandleDiscoverSuggestions ¶ added in v0.235.1
func (m *Manager) HandleDiscoverSuggestions(feedSvc FeedService) http.HandlerFunc
func (*Manager) HandleEditSubscription ¶ added in v0.235.1
func (m *Manager) HandleEditSubscription(subSvc SubscriptionsService) http.HandlerFunc
HandleEditSubscription handles presenting the user with a form for editing a subscription.
func (*Manager) HandleExportSubscriptions ¶ added in v0.235.1
func (m *Manager) HandleExportSubscriptions(feedSvc FeedService) http.HandlerFunc
HandleExportSubscriptions handles configuring and performing an export of user subscriptions.
func (*Manager) HandleExternalError ¶ added in v0.235.2
func (m *Manager) HandleExternalError(err error) http.HandlerFunc
HandleExternalError handles display errors on external pages.
func (*Manager) HandleFavoriteArticle ¶ added in v0.235.1
func (m *Manager) HandleFavoriteArticle(itemSvc ItemService, userSvc UserService) http.HandlerFunc
HandleFavoriteArticle handles toggling an article favorite.
func (*Manager) HandleFavoriteSubscription ¶ added in v0.235.1
func (m *Manager) HandleFavoriteSubscription(svc SubscriptionsService) http.HandlerFunc
HandleFavoriteSubscription handles managing a favorite subscription for a user.
func (*Manager) HandleFeatures ¶ added in v0.235.1
func (m *Manager) HandleFeatures() http.HandlerFunc
func (*Manager) HandleFeaturesCollect ¶ added in v0.235.1
func (m *Manager) HandleFeaturesCollect() http.HandlerFunc
func (*Manager) HandleFeaturesConsume ¶ added in v0.235.1
func (m *Manager) HandleFeaturesConsume() http.HandlerFunc
func (*Manager) HandleFeaturesCurate ¶ added in v0.235.1
func (m *Manager) HandleFeaturesCurate() http.HandlerFunc
func (*Manager) HandleFindSimilarArticles ¶ added in v0.235.1
func (m *Manager) HandleFindSimilarArticles(itemSvc ItemService) http.HandlerFunc
HandleFindSimilarArticles handles finding articles similar to the given article and showing the results.
func (*Manager) HandleForgetMe ¶ added in v0.235.1
func (m *Manager) HandleForgetMe() http.HandlerFunc
func (*Manager) HandleGenerateSubscriptionEmail ¶ added in v0.235.1
func (m *Manager) HandleGenerateSubscriptionEmail(users UserService) http.HandlerFunc
func (*Manager) HandleHome ¶ added in v0.235.1
func (m *Manager) HandleHome(homepageSvc HomePageService) http.HandlerFunc
HandleHome handles displaying the user's home page.
func (*Manager) HandleImportStatus ¶ added in v0.237.0
func (m *Manager) HandleImportStatus(importSvc Importer, subSvc SubscriptionsService) http.HandlerFunc
func (*Manager) HandleInternalError ¶ added in v0.235.2
func (m *Manager) 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 (*Manager) HandleLanding ¶ added in v0.235.1
func (m *Manager) HandleLanding() http.HandlerFunc
func (*Manager) HandleLinter ¶ added in v0.235.1
func (m *Manager) HandleLinter(httpClient *resty.Client) http.HandlerFunc
func (*Manager) HandleListArticles ¶ added in v0.235.1
func (m *Manager) HandleListArticles(itemSvc ItemService) http.HandlerFunc
HandleListArticles handles fetching articles based on the given page filters and displaying them.
func (*Manager) HandleListArticlesUpdates ¶ added in v0.235.1
func (m *Manager) HandleListArticlesUpdates(itemSvc ItemService) http.HandlerFunc
HandleListArticlesUpdates handles checking for any updates and notifying the user.
func (*Manager) HandleListFavorites ¶ added in v0.235.1
func (m *Manager) 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 (*Manager) HandleListSubscriptions ¶ added in v0.235.1
func (m *Manager) HandleListSubscriptions(subscriptionSvc SubscriptionsService) http.HandlerFunc
HandleListSubscriptions handles displaying a list of subscriptions.
func (*Manager) HandleListSubscriptionsUpdates ¶ added in v0.235.1
func (m *Manager) HandleListSubscriptionsUpdates(itemSvc ItemService) http.HandlerFunc
HandleListSubscriptionsUpdates handles checking for any updates and notifying the user.
func (*Manager) HandleLogin ¶ added in v0.235.1
func (m *Manager) HandleLogin(authenticator *auth0.Authenticator) http.HandlerFunc
HandleLogin handles user login or sign-up requests.
func (*Manager) HandleLoginCallback ¶ added in v0.235.1
func (m *Manager) HandleLoginCallback( userSvc UserService, authenticator *auth0.Authenticator, ) http.HandlerFunc
HandleLoginCallback handles processing the response from the login provider.
func (*Manager) HandleLoginError ¶ added in v0.235.1
func (m *Manager) HandleLoginError(res http.ResponseWriter, req *http.Request)
HandleLoginError handles login errors, including invalid login callback URL, missing parameters, expired password reset links.
func (*Manager) HandleLogout ¶ added in v0.235.1
func (m *Manager) HandleLogout(authenticator *auth0.Authenticator) http.HandlerFunc
Logout handles logout requests.
func (*Manager) HandleManageAccountSubscription ¶ added in v0.235.1
func (m *Manager) HandleManageAccountSubscription() http.HandlerFunc
func (*Manager) HandleMap ¶ added in v0.235.1
func (m *Manager) HandleMap(itemSvc ItemService) http.HandlerFunc
func (*Manager) HandleMapUpdates ¶ added in v0.235.1
func (m *Manager) HandleMapUpdates(itemSvc ItemService) http.HandlerFunc
func (*Manager) HandleMarkArticle ¶ added in v0.235.1
func (m *Manager) HandleMarkArticle( subsSvc SubscriptionsService, mark models.Mark, ) http.HandlerFunc
HandleMarkArticle handles marking an article as read or unread.
func (*Manager) HandleMarkSubscription ¶ added in v0.235.1
func (m *Manager) HandleMarkSubscription( subSvc SubscriptionsService, mark models.Mark, ) http.HandlerFunc
HandleMarkSubscription handles marking a subscription as read/unread and updates the UI accordingly.
func (*Manager) HandleNotFound ¶ added in v0.235.1
func (m *Manager) HandleNotFound() http.HandlerFunc
HandleNotFound handles showing a page for a 404 response.
func (*Manager) HandlePosts ¶ added in v0.235.1
func (m *Manager) HandlePosts() http.HandlerFunc
HandlePosts handles showing the posts index or individual posts.
func (*Manager) HandlePostsFeed ¶ added in v0.235.1
func (m *Manager) HandlePostsFeed() http.HandlerFunc
HandlePostsFeed handles showing an RSS file for posts.
func (*Manager) HandlePurchaseSubscription ¶ added in v0.235.1
func (m *Manager) HandlePurchaseSubscription(userSvc UserService) http.HandlerFunc
func (*Manager) HandlePurchaseSubscriptionSuccess ¶ added in v0.235.1
func (m *Manager) HandlePurchaseSubscriptionSuccess() http.HandlerFunc
func (*Manager) HandleRefreshToken ¶ added in v0.235.1
func (m *Manager) HandleRefreshToken( httpclient *resty.Client, authenticator *auth0.Authenticator, ) http.HandlerFunc
HandleRefreshToken handles refreshing the user's access token (using a refresh token) when it is about to expire.
func (*Manager) HandleRemoveSubscription ¶ added in v0.235.1
func (m *Manager) HandleRemoveSubscription(svc SubscriptionsService) http.HandlerFunc
HandleRemoveSubscription handles removing (unsubscribing) from a subscription.
func (*Manager) HandleReportIssue ¶ added in v0.235.1
func (m *Manager) HandleReportIssue() http.HandlerFunc
HandleReportIssue handles presenting a form for the user to submit issues about the app.
func (*Manager) HandleSaveAccountSettings ¶ added in v0.235.1
func (m *Manager) HandleSaveAccountSettings(users UserService, cache ImageCache) http.HandlerFunc
HandleSaveAccountSettings handles processing and saving new account settings.
func (*Manager) HandleSaveDisplaySettings ¶ added in v0.235.1
func (m *Manager) HandleSaveDisplaySettings(users UserService) http.HandlerFunc
HandleSaveDisplaySettings handles saving user settings after user submitted changes.
func (*Manager) HandleSaveFontSettings ¶ added in v0.235.1
func (m *Manager) HandleSaveFontSettings(users UserService) http.HandlerFunc
func (*Manager) HandleSaveSubscription ¶ added in v0.235.1
func (m *Manager) HandleSaveSubscription(cache ImageCache, svc SubscriptionsService) http.HandlerFunc
HandleSaveSubscription handles saving the edits made by a user to a subscription.
func (*Manager) HandleSaveSubscriptionsSettings ¶ added in v0.235.1
func (m *Manager) HandleSaveSubscriptionsSettings(users UserService) http.HandlerFunc
HandleSaveSubscriptionsSettings handles saving any subscription settings the user has applied.
func (*Manager) HandleSaveThemeSettings ¶ added in v0.235.1
func (m *Manager) HandleSaveThemeSettings(users UserService) http.HandlerFunc
func (*Manager) HandleSearchResults ¶ added in v0.235.1
func (m *Manager) HandleSearchResults(itemSvc ItemService) http.HandlerFunc
HandleSearchResults performs a search with the user input and renders a page with the search results.
func (*Manager) HandleSearchSuggestions ¶ added in v0.235.1
func (m *Manager) HandleSearchSuggestions(svc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
HandleSearchSuggestions performs a search with the user input and presents suggestions back to the user.
func (*Manager) HandleSearchUpdates ¶ added in v0.235.1
func (m *Manager) HandleSearchUpdates(itemSvc ItemService) http.HandlerFunc
HandleSearchUpdates handles checking for any new results for the search request and notifying the user.
func (*Manager) HandleSetupImport ¶ added in v0.237.0
func (m *Manager) HandleSetupImport(subSvc SubscriptionsService, userSvc UserService) http.HandlerFunc
func (*Manager) HandleShareArticle ¶ added in v0.235.1
func (m *Manager) HandleShareArticle() http.HandlerFunc
HandleShareArticle handles sharing an article.
func (*Manager) HandleShowAccountSettings ¶ added in v0.235.1
func (m *Manager) HandleShowAccountSettings() http.HandlerFunc
HandleShowAccountSettings handles showing the settings related to user accounts.
func (*Manager) HandleShowDisplaySettings ¶ added in v0.235.1
func (m *Manager) HandleShowDisplaySettings() http.HandlerFunc
HandleShowDisplaySettings handles showing the settings related to the application display.
func (*Manager) HandleShowSubscriptionsSettings ¶ added in v0.235.1
func (m *Manager) HandleShowSubscriptionsSettings() http.HandlerFunc
HandleShowSubscriptionsSettings handles showing the user's subscriptions for bulk management.
func (*Manager) HandleSitemap ¶ added in v0.235.1
HandleSitemap handles requests for sitemap.xml. In the future, it may handle more requests from non natural human clients...
func (*Manager) HandleStartImport ¶ added in v0.237.0
func (m *Manager) HandleStartImport(importSvc Importer) http.HandlerFunc
func (*Manager) HandleSubmitContact ¶ added in v0.235.1
func (m *Manager) HandleSubmitContact() http.HandlerFunc
func (*Manager) HandleSubmitForgetMe ¶ added in v0.235.2
func (m *Manager) HandleSubmitForgetMe() http.HandlerFunc
func (*Manager) HandleSubmitIssue ¶ added in v0.235.1
func (m *Manager) HandleSubmitIssue(cache ImageCache) http.HandlerFunc
HandleSubmitIssue handles processing the user submitted subscription issues form.
func (*Manager) HandleSubscriptionCategories ¶ added in v0.235.1
func (m *Manager) HandleSubscriptionCategories() http.HandlerFunc
HandleSubscriptionCategories handles adding and removing categories from a subscription, either when editing or adding.
func (*Manager) HandleSuggestFeeds ¶ added in v0.235.1
func (m *Manager) HandleSuggestFeeds(feeds FeedService) http.HandlerFunc
func (*Manager) HandleSuggestSubscriptionForSearch ¶ added in v0.235.1
func (m *Manager) HandleSuggestSubscriptionForSearch(svc SubscriptionsService) http.HandlerFunc
func (*Manager) HandleUserUnsubscribe ¶ added in v0.235.1
func (m *Manager) 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 (*Manager) HandleViewArticle ¶ added in v0.235.1
func (m *Manager) HandleViewArticle( itemSvc ItemService, httpClient *resty.Client, itemsCache cache.ObjectCache, ) http.HandlerFunc
HandleViewArticle handles showing an article's content.
func (*Manager) HandleViewer ¶ added in v0.235.1
func (m *Manager) HandleViewer(feedSvc FeedService) http.HandlerFunc
HandleViewer handles powering the feed viewer page.
func (*Manager) ListCategories ¶ added in v0.235.1
func (m *Manager) ListCategories(subSvc SubscriptionsService, itemSvc ItemService) http.HandlerFunc
ListCategories handles returning a list of categories that can be used for filtering subscriptions or articles.
func (*Manager) NewPageServices ¶ added in v0.235.2
func (m *Manager) NewPageServices() pageServices
func (*Manager) PolicyDocsHandler ¶ added in v0.235.1
func (m *Manager) PolicyDocsHandler() http.HandlerFunc
PolicyDocsHandler handles serving policy Markdown documents from directory in the embedded fs.
func (*Manager) ShowSettings ¶ added in v0.235.1
func (m *Manager) ShowSettings() http.HandlerFunc
ShowSettings handles retrieving and rendering the user settings page.
func (*Manager) SubscriptionCtx ¶ added in v0.235.2
SubscriptionCtx retrieves the subscription matching the URL param and stores it in the context.
func (*Manager) ValidateSubscriptionLimits ¶ added in v0.235.2
func (m *Manager) ValidateSubscriptionLimits( users UserService, subscriptions SubscriptionsService, ) func(next http.Handler) http.Handler
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
AddSubscriptions(ctx context.Context, subscriptions ...*models.Subscription) 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)
Invalidate(userID models.UserID)
}
type Unsubscribe ¶ added in v0.87.0
type Unsubscribe struct {
Token string
// contains filtered or unexported fields
}
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
// contains filtered or unexported fields
}
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
- import.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