artifact

package
v0.0.0-...-3f59448 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package artifact contains utilities for working downloading files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileCopy

func FileCopy(log log.T, destinationPath string, src io.Reader) (written int64, err error)

FileCopy copies the content from reader to destinationPath file

func Md5HashValue

func Md5HashValue(log log.T, filePath string) (hash string, err error)

Md5HashValue gets the md5 hash value

func Sha256HashValue

func Sha256HashValue(log log.T, filePath string) (hash string, err error)

Sha256HashValue gets the sha256 hash value

func VerifyHash

func VerifyHash(log log.T, input DownloadInput, output DownloadOutput) (match bool, err error)

VerifyHash verifies the hash of the url file as per specified hash algorithm type and its value

Types

type DownloadInput

type DownloadInput struct {
	SourceURL            string
	DestinationDirectory string
	SourceHashValue      string
	SourceHashType       string
}

DownloadInput specifies the input to file download operation

type DownloadOutput

type DownloadOutput struct {
	LocalFilePath string
	IsUpdated     bool
	IsHashMatched bool
}

DownloadOutput holds the result of file download operation.

func Download

func Download(log log.T, input DownloadInput) (output DownloadOutput, err error)

Download is a generic utility which attempts to download smartly.

Jump to

Keyboard shortcuts

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