render

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package render provides the file content rendering for the web server.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDownload  = errors.New("download file cannot be stat")
	ErrFileModel = errors.New("file model is nil")
	ErrFilename  = errors.New("file model filename is empty")
	ErrUUID      = errors.New("file model uuid is empty")
)

Functions

func Encoder

func Encoder(art *models.File, r io.Reader) encoding.Encoding

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 NoScreenshot

func NoScreenshot(art *models.File, previewPath string) bool

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.

func Read

func Read(art *models.File, downloadDir, extraDir string) ([]byte, error)

Read returns the content of either the file download or an extracted text file. The text is intended to be used as a readme, preview or an in-browser viewer.

func Viewer

func Viewer(art *models.File) bool

Viewer returns true if the file entry should display the file download in the browser plain text viewer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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