download

package
v0.0.0-...-139d814 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxRetries    = 3
	RetryInterval = time.Second
)

Functions

func AdvanceDownload

func AdvanceDownload(ctx echo.Context, options ...Options) (*uploadClient.Result, string, error)

func Crop

func Crop(
	result *uploadClient.Result,
	fileM *modelFile.File,
	reader io.Reader,
	storer upload.Storer,
	config *Config,
) (string, error)

func Download

func Download(ctx echo.Context, options ...Options) (*uploadClient.Result, string, error)

Types

type Config

type Config struct {
	echo.Context
	ID            string
	FileURL       string
	Checkin       bool
	Watermark     *image.WatermarkOptions
	Crop          *imageproxy.Options
	PrepareData   *uploadPrepare.PrepareData
	NoticeSender  notice.Noticer
	Progress      *notice.Progress
	MaxMB         int64
	MaxRetries    int
	RetryInterval time.Duration
	DisableChunk  bool
}

func NewConfig

func NewConfig(ctx echo.Context) *Config

type Options

type Options func(*Config)

func OptionsCheckin

func OptionsCheckin(on bool) Options

func OptionsCrop

func OptionsCrop(opt *imageproxy.Options) Options

func OptionsDisableChunk

func OptionsDisableChunk(disableChunk bool) Options

func OptionsFileURL

func OptionsFileURL(fileURL string) Options

func OptionsID

func OptionsID(id string) Options

func OptionsMaxMB

func OptionsMaxMB(maxMB int64) Options

func OptionsNoticeSender

func OptionsNoticeSender(noticeSender notice.Noticer) Options

func OptionsPrepareData

func OptionsPrepareData(data *uploadPrepare.PrepareData) Options

func OptionsProgress

func OptionsProgress(pro *notice.Progress) Options

func OptionsWatermark

func OptionsWatermark(opt *image.WatermarkOptions) Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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