downloader

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CHUNK_SIZE         = 1024 * 8
	DEFAULT_RATE_LIMIT = 50
	COMPRESS_LEVEL     = 1
)

Variables

This section is empty.

Functions

func AddDownloadHandler

func AddDownloadHandler(prefix string, app *appsrv.Application)

Types

type SDownloadProvider

type SDownloadProvider struct {
	// contains filtered or unexported fields
}

func NewDownloadProvider

func NewDownloadProvider(w http.ResponseWriter, compress, sparse bool, rateLimit int) *SDownloadProvider

func (*SDownloadProvider) Start

func (d *SDownloadProvider) Start(
	prepareDownload func() error, onDownloadComplete func(),
	downloadFilePath string, headers http.Header,
) error

type SGuestDownloadProvider

type SGuestDownloadProvider struct {
	*SDownloadProvider
	// contains filtered or unexported fields
}

func NewGuestDownloadProvider

func NewGuestDownloadProvider(
	w http.ResponseWriter, compress, sparse bool, rateLimit int, sid string,
) *SGuestDownloadProvider

func (*SGuestDownloadProvider) Start

func (s *SGuestDownloadProvider) Start() error

type SImageCacheDownloadProvider

type SImageCacheDownloadProvider struct {
	*SDownloadProvider
	// contains filtered or unexported fields
}

func NewImageCacheDownloadProvider

func NewImageCacheDownloadProvider(
	w http.ResponseWriter, compress, sparse bool, rateLimit int, imageId string,
) *SImageCacheDownloadProvider

func (*SImageCacheDownloadProvider) HandlerHead

func (s *SImageCacheDownloadProvider) HandlerHead() error

func (*SImageCacheDownloadProvider) Start

type SImageDownloadProvider

type SImageDownloadProvider struct {
	*SDownloadProvider
	// contains filtered or unexported fields
}

func NewImageDownloadProvider

func NewImageDownloadProvider(w http.ResponseWriter, compress, sparse bool, rateLimit int, disk storageman.IDisk, compressFormat string) *SImageDownloadProvider

func (*SImageDownloadProvider) HandlerHead

func (i *SImageDownloadProvider) HandlerHead() error

func (*SImageDownloadProvider) Start

func (i *SImageDownloadProvider) Start() error

type SSnapshotDownloadProvider

type SSnapshotDownloadProvider struct {
	*SDownloadProvider
	// contains filtered or unexported fields
}

func NewSnapshotDownloadProvider

func NewSnapshotDownloadProvider(
	w http.ResponseWriter, compress, sparse bool, rateLimit int, snapshotPath string,
) *SSnapshotDownloadProvider

func (*SSnapshotDownloadProvider) HandlerHead

func (s *SSnapshotDownloadProvider) HandlerHead() error

func (*SSnapshotDownloadProvider) Start

func (s *SSnapshotDownloadProvider) Start() error

Jump to

Keyboard shortcuts

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