Documentation
¶
Index ¶
- func Entry(w io.Writer, p EntryParams) error
- func Feed(w io.Writer, p FeedParams) error
- func Home(w io.Writer, vm []HomeParams) error
- func Login(w io.Writer, p LoginParams) error
- func Render(w http.ResponseWriter, render func(io.Writer) error)
- func StaticFiles() embed.FS
- type EntryLinkViewModel
- type EntryParams
- type EntryViewModel
- type FeedParams
- type FeedViewModel
- type HomeParams
- type LinkViewModel
- type LoginParams
- type NavigationData
- type NavigationViewModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
func Render(w http.ResponseWriter, render func(io.Writer) error)
Render safely writes HTML to the ResponseWriter. It first renders the template/content into a buffer so that: 1) We avoid sending partial responses if rendering fails midway. 2) We can choose the correct HTTP status code on errors before any bytes are written. Only after a successful render do we set the Content-Type and write the body.
func StaticFiles ¶
Types ¶
type EntryLinkViewModel ¶
EntryLinkViewModel is a single link in the entry.html template.
type EntryParams ¶
type EntryParams struct {
URL string
Feed *opds.Feed
Entry opds.Entry
DeviceType device.DeviceType
ConverterManager *convert.ConverterManager
}
type EntryViewModel ¶
type EntryViewModel struct {
Title string
Author string
Content template.HTML
DownloadLinks []EntryLinkViewModel
FeedURL string
ImageURL string
ImageData template.URL
Search string
}
EntryViewModel is the data passed to the entry.html template.
type FeedParams ¶
type FeedViewModel ¶
type FeedViewModel struct {
Title string
Search string
Links []LinkViewModel
}
type HomeParams ¶
type LinkViewModel ¶
type LoginParams ¶
type LoginParams struct {
ReturnURL string
}
type NavigationData ¶
type NavigationData struct {
}
NavigationData contains the common navigation and search data
type NavigationViewModel ¶
type NavigationViewModel struct {
}
Click to show internal directories.
Click to hide internal directories.