Documentation
¶
Overview ¶
Package render provides the file content rendering for the web server.
Index ¶
- Variables
- func DescriptionInZIP(buf *bytes.Buffer, art *models.File, extra dir.Directory) error
- func Encoder(art *models.File, r io.Reader) encoding.Encoding
- func InformationText(buf, ruf *bytes.Buffer, sizeLimit int64, art *models.File, ...) error
- func InsertDiz(b []byte, diz []byte) []byte
- func NoScreenshot(art *models.File, previewPath string) bool
- func Viewer(art *models.File) bool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DescriptionInZIP ¶ added in v1.9.13
DescriptionInZIP returns the content of the description in archive file. Usually this brief summary text is named 'file_id.diz' and is a legacy of the BBS era of file hosting.
The summary text can be used as a readme, preview, or viewed in the browser.
func Encoder ¶
Encoder returns the encoding for the model file entry. Based on the platform and section. Otherwise it will attempt to determine the encoding from the file byte content.
func InformationText ¶ added in v1.9.13
func InformationText(buf, ruf *bytes.Buffer, sizeLimit int64, art *models.File, download, extra dir.Directory) error
InformationText writes the content of either the file download or an extracted text file to the buffers. The text is intended to be used as a readme, preview or an in-browser viewer.
Both the buf buffer and the ruf rune buffer are reset before writing.
func InsertDiz ¶ added in v1.5.1
InsertDiz inserts the FILE_ID.DIZ content into the existing byte content.
func NoScreenshot ¶
NoScreenshot returns true when the file entry should not attempt to display a screenshot. This is based on the platform, section or if the screenshot is missing on the server.
Types ¶
This section is empty.