download

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package download handles the client file downloads.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNone = errors.New("not found")
	ErrStat = errors.New("file download stored on this server cannot be found")
)

Functions

func Checksum

func Checksum(c echo.Context, id string) error

Checksum serves the checksums for the requested file. The response is a text file named "checksums.txt" with the checksum and filename. The id string is the UID filename of the requested file.

Types

type Download

type Download struct {
	Path   string // Path is the absolute path to the download directory.
	Inline bool   // Inline is true if the file should attempt to display in the browser.
}

Download configuration.

func (Download) HTTPSend

func (d Download) HTTPSend(c echo.Context, logger *zap.SugaredLogger) error

HTTPSend serves files to the client and prompts for a save location. The download relies on the URL ID parameter to determine the requested file.

Jump to

Keyboard shortcuts

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