clipr

package module
v0.0.0-...-5330e1b Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 10 Imported by: 0

README

clipr

Travis Build Status Go Report Card Coverage report Go Reference

Simple concurrent command-line downloader for (almost)all online resources, written in Go.

Install

go get -u github.com/eddogola/clipr/...

Usage

Use as a program
With progress bar
$ clipr --location . --progress-bar http://wallpaperswide.com/download/spider_man_14-wallpaper-1366x768.jpg
downloading spider_man_14-wallpaper-1366x768.jpg   9% |█             | (52/543 kB, 11.985 kB/s) [4s:40s]
successfully saved ./spider_man_14-wallpaper-1366x768.jpg
Without progress bar
$ clipr --location . http://wallpaperswide.com/download/spider_man_14-wallpaper-1366x768.jpg
successfully saved ./spider_man_14-wallpaper-1366x768.jpg
Use as a library
// download the spider man wallpaper
url := "http://wallpaperswide.com/download/spider_man_14-wallpaper-1366x768.jpg"
rs := clipr.Resource{URL: url}
err := rs.SetUp()
filePath, err = rs.Download("/home/")

Contributing

Pull requests are welcome. Feel free to...

  • Add new features
  • Fix bugs
  • Suggest improvements

License

MIT

Documentation

Overview

Package clipr provides a Resource struct with methods to download online resources

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config type with options for the download

type Resource

type Resource struct {
	URL      string
	FileSize int
	FileName string
	// contains filtered or unexported fields
}

Resource type for online resource to be downloaded: url, size, filename, Download(), getFilename()

func (*Resource) ConfigSetProgressBarVisibility

func (rs *Resource) ConfigSetProgressBarVisibility(visible bool)

ConfigSetProgressBarVisibility sets the option of showing a progressbar on or off

func (*Resource) Download

func (rs *Resource) Download(location, fileName string) (filePath string, err error)

Download saves the Resource to location

func (*Resource) SetUp

func (rs *Resource) SetUp() (err error)

SetUp initializes a Resource's FileName, FileSize, resp

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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