download

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDownloadedPath

func GetDownloadedPath(contentURL string, downloadDestinationPath string, overwrite bool) string

GetDownloadedPath downloads the content using suitable downloader and then returns the downloaded file path

func IsRemotePath

func IsRemotePath(str string) bool

IsRemotePath checks if the provided string is a valid remote path or not

Types

type DownloadOptions

type DownloadOptions struct {
	ContentURL              string
	DownloadDestinationPath string
	Overwrite               bool
}

DownloadOptions stores options for the downloader

type Downloader

type Downloader interface {
	Download(DownloadOptions) (string, error)
}

Downloader defines interface for downloaders

type HTTPContent

type HTTPContent struct {
	ContentFilePath string
}

HTTPContent stores remote content config

func (*HTTPContent) Download

func (content *HTTPContent) Download(downloadOptions DownloadOptions) (string, error)

Download downloads content from the given content URL

Jump to

Keyboard shortcuts

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