handlers

package
v0.244.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: AGPL-3.0 Imports: 63 Imported by: 0

Documentation

Overview

Package handlers contains chainable handlers/middleware for routing.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidContent indicates that the content for rendering is invalid.
	ErrInvalidContent = errors.New("invalid content")
	// ErrInvalidRequestParams indicates that the request parameters received were invalid.
	ErrInvalidRequestParams = errors.New("invalid request parameters")
)

Functions

func HandleAccountSuccess added in v0.39.0

func HandleAccountSuccess() http.HandlerFunc

func HandlePaddleWebhook added in v0.143.0

func HandlePaddleWebhook(userSvc UserService, emailSender EmailSender) http.HandlerFunc

HandlePaddleWebhook handles incoming webhooks from paddle.

func HandleResendWebhook added in v0.143.0

func HandleResendWebhook(verifier WebhookVerifier, processor EmailReceiver) 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

func ListFiltersToCtx(ctx context.Context, filters *models.ListFilters) context.Context

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

func SearchParamsToCtx(ctx context.Context, search *models.SearchRequest) context.Context

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 AppConfig added in v0.235.0

type AppConfig interface {
	GetAppID() string
	GetAppVersion() string
	GetAppName() string
	GetAppEnvironment() config.Environment
	IsProduction() bool
	GetBaseURL() *url.URL
}

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,
		filters *models.ListFilters,
		extraQueries ...query.Option,
	) (models.Articles, models.Subscriptions, models.Pagination, error)
	FilterGeoArticles(
		ctx context.Context,
		filters *models.ListFilters,
	) (models.Articles, models.Subscriptions, models.Pagination, error)
	CountArticles(
		ctx context.Context,
		filters *models.ListFilters,
		extraQueries ...query.Option,
	) (int64, error)
	CountGeoArticles(
		ctx context.Context,
		filters *models.ListFilters,
	) (int64, 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 AuthManager added in v0.240.0

type AuthManager interface {
	GetUser(ctx context.Context, userID string) (*auth0.UserData, error)
	DeleteUser(ctx context.Context, userID string) error
	UpdateUserCustomisation(ctx context.Context, request *models.EditUserRequest) error
	ChangeUserPassword(ctx context.Context, request *models.ChangePasswordRequest) error
}

type Authenticator added in v0.235.0

type Authenticator interface {
	IsAuthenticated(ctx context.Context) bool
	GenerateAuthURL(req *http.Request) (*auth0.AuthURLResult, error)
	GenerateLogoutURL(req *http.Request) (*url.URL, error)
	PutState(ctx context.Context, state string)
	GetState(ctx context.Context) (string, error)
	PutCodeVerifier(ctx context.Context, verifier string)
	GetCodeVerifier(ctx context.Context) (string, error)
	PutReturnTo(ctx context.Context, path string)
	PerformExchange(ctx context.Context, code, verifier string) (*models.UserProfileResponse, error)
	GetRefreshToken(ctx context.Context) (string, error)
	GetTokenExpiry(ctx context.Context) (time.Time, error)
	RefreshTokens(ctx context.Context, token string) error
	ClearAuth(ctx context.Context)
	ClearState(ctx context.Context)
	GetReturnTo(ctx context.Context) (string, error)
	IsAccessTokenExpired(ctx context.Context) bool
}
type Breadcrumbs interface {
	Previous(ctx context.Context) (*url.URL, bool)
}

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 ElasticService interface {
	GetIndexRO(name service.Index) string
	GetIndexRW(name service.Index) string
}

type EmailReceiver added in v0.240.0

type EmailReceiver interface {
	Process(ctx context.Context, details resend.EmailRecieved) error
}

EmailReceiver handles a verified email.received event.

type EmailSender added in v0.240.0

type EmailSender interface {
	Send(ctx context.Context, options ...resend.EmailOption) error
}

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 (m Features) CanonicalLink() string

func (*Features) FullResponse added in v0.101.0

func (p *Features) FullResponse(res http.ResponseWriter, req *http.Request)

func (Features) JSONLD added in v0.235.0

func (m Features) JSONLD() *schemaorg.WebPage

func (Features) OpengraphData added in v0.235.0

func (m Features) OpengraphData() *opengraph.WebSite

type FeaturesCollect added in v0.155.0

type FeaturesCollect struct {
	// contains filtered or unexported fields
}
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) JSONLD added in v0.235.0

func (m FeaturesCollect) JSONLD() *schemaorg.WebPage

func (FeaturesCollect) OpengraphData added in v0.235.0

func (m FeaturesCollect) OpengraphData() *opengraph.WebSite

type FeaturesConsume added in v0.155.0

type FeaturesConsume struct {
	// contains filtered or unexported fields
}
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) JSONLD added in v0.235.0

func (m FeaturesConsume) JSONLD() *schemaorg.WebPage

func (FeaturesConsume) OpengraphData added in v0.235.0

func (m FeaturesConsume) OpengraphData() *opengraph.WebSite

type FeaturesCurate added in v0.155.0

type FeaturesCurate struct {
	// contains filtered or unexported fields
}
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) JSONLD added in v0.235.0

func (m FeaturesCurate) JSONLD() *schemaorg.WebPage

func (FeaturesCurate) OpengraphData added in v0.235.0

func (m FeaturesCurate) OpengraphData() *opengraph.WebSite

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 (m ForgetMe) CanonicalLink() string

func (*ForgetMe) FullResponse added in v0.158.0

func (p *ForgetMe) FullResponse(res http.ResponseWriter, req *http.Request)

func (ForgetMe) JSONLD added in v0.235.0

func (m ForgetMe) JSONLD() *schemaorg.WebPage

func (ForgetMe) OpengraphData added in v0.235.0

func (m ForgetMe) OpengraphData() *opengraph.WebSite

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 Importer added in v0.237.0

type Importer interface {
	StartImport(ctx context.Context, file *models.OPMLFile) (string, error)
	GetImportStatus(ctx context.Context, jobID string) (*models.ImportStatus, []*models.ImportResult, error)
	GetAllImports(ctx context.Context, userID models.UserID) ([]*models.ImportStatus, error)
}

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)
	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)
	GetArticleRemoteContent(ctx context.Context, article *models.Article) 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 (m Linter) CanonicalLink() string

func (*Linter) FullResponse added in v0.226.0

func (p *Linter) FullResponse(res http.ResponseWriter, req *http.Request)

func (Linter) JSONLD added in v0.235.0

func (m Linter) JSONLD() *schemaorg.WebPage

func (Linter) OpengraphData added in v0.235.0

func (m Linter) OpengraphData() *opengraph.WebSite

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

type LinterResponse struct {
	Results map[string][]linter.Result
}

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

AllSubscriptionsCtx retrieves the subscription matching the URL param and stores it in the context.

func (*Manager) ArticleCtx added in v0.235.2

func (m *Manager) ArticleCtx(itemSvc ItemService) func(next http.Handler) http.Handler

ArticleCtx retrieves the article matching the URL param and stores it in the context.

func (*Manager) CheckUserLimits added in v0.235.2

func (m *Manager) CheckUserLimits(next http.Handler) http.Handler

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

func (m *Manager) CustomisationCtx(next http.Handler) http.Handler

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(authMgr AuthManager) 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(
	userSvc UserService,
	authMgr AuthManager,
	auth Authenticator,
	emailSender EmailSender,
) 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(subSvc 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 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,
	authMgr AuthManager,
	auth Authenticator,
	emailSender EmailSender,
) 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 Authenticator) http.HandlerFunc

HandleLogout handles logout requests. It will clear the session, and redirect the user to the appropriate URL for logging them out of the auth backend.

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(
	authenticator 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(
	userSvc UserService,
	authMgr AuthManager,
	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,
	emailSender EmailSender,
) 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

func (m *Manager) HandleSitemap() http.Handler

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(emailSender EmailSender) http.HandlerFunc

func (*Manager) HandleSubmitForgetMe added in v0.235.2

func (m *Manager) HandleSubmitForgetMe(emailSender EmailSender) http.HandlerFunc

func (*Manager) HandleSubmitIssue added in v0.235.1

func (m *Manager) HandleSubmitIssue(cache ImageCache, emailSender EmailSender) 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,
) 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

func (m *Manager) SubscriptionCtx(svc SubscriptionsService) func(next http.Handler) http.Handler

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,
	emailSender EmailSender,
) 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 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

type Post struct {
	*markdownx.File
	// contains filtered or unexported fields
}

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 SessionManager interface {
	Get(ctx context.Context, key string) any
	Put(ctx context.Context, key string, value any)
	Remove(ctx context.Context, key string)
	RenewToken(ctx context.Context) error
	Clear(ctx context.Context) error
}

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)
	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
	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.

type WebhookVerifier added in v0.239.2

type WebhookVerifier interface {
	Verify(req *http.Request, body []byte) error
}

WebhookVerifier checks the Svix signature on an incoming request.

Jump to

Keyboard shortcuts

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