Documentation
¶
Index ¶
- Variables
- type EmailList
- type EmailView
- type InboxPage
- type LoaderData
- type RouteModule
- func (rm *RouteModule) Action(wr http.ResponseWriter, req *http.Request) error
- func (rm *RouteModule) Load(req *http.Request) (any, error)
- func (rm *RouteModule) Render(wr http.ResponseWriter, req *http.Request, ld any) error
- func (rm *RouteModule) Subscribe(wr http.ResponseWriter, req *http.Request) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmailListTemplate = tmpl.MustCompile(&EmailList{}, tmpl.UseFuncs(tmpl.FuncMap{ "hex": func(id primitive.ObjectID) string { return id.Hex() }, "join": func(strs []string) string { return strings.Join(strs, ", ") }, "formatTimeSince": formatTimeSince, })) )
View Source
var EmailListTmplFS embed.FS
View Source
var EmailViewTmplFS embed.FS
View Source
var InboxPageTmplFS embed.FS
View Source
var Template = tmpl.MustCompile( &InboxPage{}, tmpl.UseFuncs(tmpl.FuncMap{ "html": func(v string) template.HTML { return template.HTML(v) }, "hex": func(id primitive.ObjectID) string { return id.Hex() }, "join": func(strs []string) string { return strings.Join(strs, ", ") }, "formatTimeSince": formatTimeSince, }), )
Template can be used to render the inbox page.
Functions ¶
This section is empty.
Types ¶
type EmailList ¶
type EmailList struct { // Emails is a list of emails to display in the inbox. Emails []*model.Email // Current is the currently selected email. Current *model.Email }
func (*EmailList) TemplateText ¶
type EmailView ¶
func (*EmailView) TemplateText ¶
type InboxPage ¶
type InboxPage struct { // Page is a template for a base html page. // It exposes the `body` template slot. html.Page `tmpl:"page"` // <- name the template, so it can be used as a target EmailList EmailList `tmpl:"email-list"` EmailView EmailView `tmpl:"email-view"` // Current is the currently selected email. Current *model.Email }
func (*InboxPage) TemplateText ¶
type RouteModule ¶
RouteModule is the torque route module for the landing page.
func (*RouteModule) Action ¶
func (rm *RouteModule) Action(wr http.ResponseWriter, req *http.Request) error
func (*RouteModule) Render ¶
func (rm *RouteModule) Render(wr http.ResponseWriter, req *http.Request, ld any) error
func (*RouteModule) Subscribe ¶
func (rm *RouteModule) Subscribe(wr http.ResponseWriter, req *http.Request) error
Click to show internal directories.
Click to hide internal directories.