Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

rlaskowski/simpleclient

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simpleclient

Simple http client to help downloading resources

Install

go get github.com/rlaskowski/simpleclient

Example

This example show how to download file from url

fs := simpleclient.NewFileStream("/home/examplepath")

url := "http://ipv4.download.thinkbroadband.com/200MB.zip"

_, err := fs.Download(url, func(streaminfo simpleclient.StreamInfo) error {
  if streaminfo.WrittenBytes > 0 {
		log.Printf("Written: %.2f percent", streaminfo.ProgressInPercent())
	}

	if streaminfo.Complete {
		log.Print("Complete")
	}

	return nil
})

if err != nil {
    return err
}

About

Simple http client to help downloading resources

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.