network

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCEPT_RANGE_HEADER   = "Accept-Ranges"
	CONTENT_LENGTH_HEADER = "Content-Length"
)
View Source
const (
	TAGS_URL          = "https://go.googlesource.com/go/+refs"
	BASE_DOWNLOAD_URL = "https://go.googlesource.com/go/+archive/%s.tar.gz"
)

Variables

This section is empty.

Functions

func Download

func Download(url string, skiptls bool, conn int64, forceClean bool) error

Download the contents of the given URL

Types

type HttpDownloader

type HttpDownloader struct {
	// contains filtered or unexported fields
}

Downloader structure - For downloading a file this is the structure we need to maintain

func NewDownloader

func NewDownloader(url string, parts int64, skipTls bool) *HttpDownloader

Initializes a downloader structure defining a download with values and returns it

func (*HttpDownloader) ClearPreviousDownload

func (d *HttpDownloader) ClearPreviousDownload() error

Clear/Remove already downloaded parts or file form downloads directory

func (*HttpDownloader) Do

func (d *HttpDownloader) Do(doneChan chan bool, fileChan chan string, errorChan chan error, interruptChan chan bool)

func (*HttpDownloader) VerifyDownloadDestination

func (d *HttpDownloader) VerifyDownloadDestination() error

Check if the parts and the file does not already exist in the download directory Return error if they are already present.

type PartFile

type PartFile struct {
	Url       string
	Path      string
	RangeFrom int64
	RangeTo   int64
}

PartFile Structure

type Release

type Release struct {
	Name        string
	DownloadUrl string
}

func ParseGoReleases

func ParseGoReleases(shouldLog bool) ([]Release, error)

Parses the available release of golang to install

Jump to

Keyboard shortcuts

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