downloadhelpermdl

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EMPTY_STR                       = ""
	HTTP_PROTOCOL                   = "http"
	FILE_PRESENT_CHECK_ERROR        = 0
	FILE_PRESENT_AT_DESTINATION     = 1
	FILE_NOT_PRESENT_AT_DESTINATION = 2
	WAIT_TIME_DURATION              = 2000
	MIN_FILE_SIZE                   = 1
)

Constants Required

Variables

This section is empty.

Functions

func DeleteBackup

func DeleteBackup(filePath string) error

DeleteBackup Deletes Backup

func DownloadFile

func DownloadFile(params *DownloadHelper) (bool, error)

Download File From Cloud With / Without Hash Checking params : DownloadParameter, consists of different aspects of downloading

Types

type DownloadHelper

type DownloadHelper struct {
	DownloadParam DownloadParameter
	// contains filtered or unexported fields
}

DownloadHelper - Struct

func GetDownloadHelper

func GetDownloadHelper(sourceURL, destinationPath string, retryCount int) *DownloadHelper

GetDownloadHelper Gives you download helper from where you can run steps

func (*DownloadHelper) AddParamsCacheBurst

func (dh *DownloadHelper) AddParamsCacheBurst(isCacheBurst bool) *DownloadHelper

AddParamsFileHashed - method to add fileHashedValue at runtime

func (*DownloadHelper) AddParamsFileHashed

func (dh *DownloadHelper) AddParamsFileHashed(fileHashedValue string) *DownloadHelper

AddParamsFileHashed - method to add fileHashedValue at runtime

func (*DownloadHelper) AddParamsJWT

func (dh *DownloadHelper) AddParamsJWT(jwtToken string) *DownloadHelper

AddParamsJWT - method to add jwtToken at runtime

func (*DownloadHelper) AddRequestTimeout

func (dh *DownloadHelper) AddRequestTimeout(requestTimeOutValue int64) *DownloadHelper

func (*DownloadHelper) Run

func (dh *DownloadHelper) Run() *DownloadHelper

Run all Steps one by one

type DownloadParameter

type DownloadParameter struct {
	DownloadError error
	// contains filtered or unexported fields
}

Structure DownloadParameter: with different parameters which can be received for downloading the file

Jump to

Keyboard shortcuts

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