fs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDataDir

func CreateDataDir(dirPath string)

CreateDataDir makes a directory for the data dir of active coin's daemon at app's path context

func Download

func Download(url string, downloadTofileName string)

Download performs file download of the given url this method provides no feedback to the system

func DownloadExtract

func DownloadExtract(url string, assetName string) error

DownloadExtract sets up and runs the functions needed for downloading and extracting of assets

func Exists

func Exists(name string) bool

Exists reports if the named file or directory exists

func Extract

func Extract(assetName string, downloadLocation string, extractPath string)

Extract will call Unzip or Untar depending on the detected file extension

func GetCurrentPath

func GetCurrentPath() (string, error)

GetCurrentPath gets the path of the go app

func Untar

func Untar(gzStream string, dst string) error

Untar takes a gzStream and destination path; opens gzStream, creates new reader, checks headers passes on target and header to

func Unzip

func Unzip(src, dest string) error

Unzip takes a src and destination path and unzips accordingly

Types

type WriteCounter

type WriteCounter struct {
	Total uint64
}

WriteCounter counts the number of bytes written to it

func (WriteCounter) PrintProgress

func (wc WriteCounter) PrintProgress()

PrintProgress will print current status of download

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

wc writes bytes and prints progress

Jump to

Keyboard shortcuts

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