download

package
v0.0.0-...-fbb6d32 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultChunkSize sets the size of the chunks to be downloaded using HTTP
	// requests by bytes range
	DefaultChunkSize = 1_048_576

	// DefaultMaxRetries sets the maximum download attempt for each chunk
	DefaultMaxRetries = uint(32)

	// DefaultMaxParallel sets the maximum parallels downloads per server
	DefaultMaxParallel = 16

	// DefaultTimeout sets the timeout for each HTTP request
	DefaultTimeout = 3 * time.Minute
)
View Source
const (

	// FederalRevenueUpdatedAt is a file that contains the date the data was
	// extracted by the Federal Revenue
	FederalRevenueUpdatedAt = "updated_at.txt"
)

Variables

This section is empty.

Functions

func Download

func Download(dir string, timeout time.Duration, skip, restart bool, parallel int, retries uint, chunkSize int64) error

Download all the files (might take days).

func DownloadFromMirror

func DownloadFromMirror(mirror string, dir string, timeout time.Duration, skip, restart bool, parallel int, retries uint, chunkSize int64) error

Download all the files from the project's mirror

func HasUpdate

func HasUpdate(dir string) error

HasUpdate checks if there is an update available.

func URLs

func URLs(dir string, skip bool) error

URLs shows the URLs to be downloaded.

func UpdatedAt

func UpdatedAt() error

UpdatedAt shows the updated at of the files to be downloaded.

Types

type MirrorFile

type MirrorFile struct {
	URL  string `json:"url"`
	Size uint   `json:"size"`
}

type MirrorGroup

type MirrorGroup struct {
	Name string       `json:"name"`
	URLs []MirrorFile `json:"urls"`
}

type MirrorResponse

type MirrorResponse struct {
	Data []MirrorGroup `json:"data"`
}

Jump to

Keyboard shortcuts

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