Documentation
¶
Overview ¶
Package render provides the file content rendering for the web server.
Index ¶
- Variables
- func DescriptorText(buf *bytes.Buffer, art *models.File, extra dir.Directory) error
- func Encoder(art *models.File, r io.Reader) encoding.Encoding
- func HelperText(buf *bytes.Buffer, art *models.File, extra dir.Directory) error
- func InformationText(buf, ruf *bytes.Buffer, sizeLimit int64, art *models.File, ...) error
- func InsertPrefix(p []byte, prefix []byte) []byte
- func InsertSuffix(p []byte, suffix []byte) []byte
- func NoScreenshot(art *models.File, previewPath string) bool
- func Viewer(art *models.File) bool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DescriptorText ¶ added in v1.10.8
DescriptorText (File ID - Description In ZIP) returns the content of archive file descriptor. Usually this brief summary text is named 'FILE_ID.DescriptorText' 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 HelperText ¶ added in v1.10.8
HelperText returns the content of a helper text file. These optional texts can be secondary NFOs, READMEs, or additional instructions.
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 InsertPrefix ¶ added in v1.10.8
InsertPrefix injects content before the existing byte content. This is usually to inject FILE_ID.DIZ text files.
func InsertSuffix ¶ added in v1.10.8
InsertSuffix injects content after the existing byte content. This is usually to inject an additional helper text file.
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.