parallel_downloader

package module
v0.0.0-...-985536d Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 8 Imported by: 0

README

Parallel downloader

Parallel downloader is a tool for downloading files in parallel.

Usage

go run cmd/main.go \
  -url https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2018-05.parquet \
  -output yellow_tripdata_2018-05.parquet

References

https://www.353solutions.com/c/znga/dld.html

Documentation

Overview

Package parallel_downloader provides a simple way to download files in parallel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEmptyFile

func CreateEmptyFile(path string, size int64) error

CreateEmptyFile creates an empty file with the given size

func DownloadChunk

func DownloadChunk(url string, destFile *os.File, offset, size int64, retries int, wg *sync.WaitGroup, ch chan<- error)

DownloadChunk downloads a portion of the file and writes it to the correct offset in the destination file

func GetFileHandle

func GetFileHandle(path string) *os.File

GetFileHandle opens the file for writing and seeks to the specified offset

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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