url

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHashicorpUrl

func BuildHashicorpUrl(
	name,
	version,
	os,
	arch string,
) string

Returns a Hashicorp URL.

Example:

("packer", "1.7.4", "windows", "amd64") -> "https://releases.hashicorp.com/packer/1.7.4/packer_1.7.4_windows_amd64.zip"

func Download

func Download(
	url,
	path string,
	bytesDownloadedChan chan<- int,
) error

Downloads the associated file from the given URL to the given path. Sends the number of bytes downloaded to the given channel.

Example:

("https://releases.hashicorp.com/packer/1.7.4/packer_1.7.4_windows_amd64.zip", "/home/dev/download", bytesDownloadedChan) -> nil

func GetContentLength

func GetContentLength(
	url string,
) (
	int64,
	error,
)

Returns the content length of the given URL.

Example:

("https://releases.hashicorp.com/packer/1.7.4/packer_1.7.4_windows_amd64.zip") -> 123456789, nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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