getparty

package module
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: BSD-3-Clause Imports: 29 Imported by: 0

README

getparty Build Status

HTTP Download Manager with multi-parts

showcase

Installation

Homebrew
$ brew tap vbauerster/getparty
$ brew install getparty
Manual
$ go get -u github.com/vbauerster/getparty
$ cd $GOPATH/src/github.com/vbauerster/getparty/cmd/getparty
$ go install

Usage

Usage:
  getparty [OPTIONS] url

Application Options:
  -p, --parts=n                               number of parts (default: 2)
  -t, --timeout=sec                           context timeout (default: 15)
  -o, --output=filename                       user defined output
  -c, --continue=state.json                   resume download from the last session
  -a, --user-agent=[chrome|firefox|safari]    User-Agent header (default: chrome)
  -b, --best-mirror                           pickup the fastest mirror
  -q, --quiet                                 quiet mode, no progress bars
  -u, --username=                             basic http auth username
      --password=                             basic http auth password
      --header=key:value                      arbitrary http header
      --no-check-certificate                  don't validate the server's certificate
      --debug                                 enable debug to stderr
      --version                               show version

Help Options:
  -h, --help                                  Show this help message
Best mirror example:

cat mirrors.txt | getparty -p 8 -b

License

BSD 3-Clause

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGiveUp  = fmt.Errorf("give up after %d tries", maxTry)
	ErrNilBody = errors.New("nil body")
)

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Out, Err io.Writer
	// contains filtered or unexported fields
}

func (Cmd) Exit

func (cmd Cmd) Exit(err error) int

func (*Cmd) Run

func (cmd *Cmd) Run(args []string, version string) (err error)

type ExpectedError

type ExpectedError struct {
	Err error
}

func (ExpectedError) Error

func (e ExpectedError) Error() string

type Options

type Options struct {
	Parts              uint              `short:"p" long:"parts" value-name:"n" default:"2" description:"number of parts"`
	Timeout            uint              `short:"t" long:"timeout" value-name:"sec" default:"15" description:"context timeout"`
	OutFileName        string            `short:"o" long:"output" value-name:"filename" description:"user defined output"`
	JSONFileName       string            `short:"c" long:"continue" value-name:"state.json" description:"resume download from the last session"`
	UserAgent          string            `short:"a" long:"user-agent" choice:"chrome" choice:"firefox" choice:"safari" default:"chrome" description:"User-Agent header"`
	BestMirror         bool              `short:"b" long:"best-mirror" description:"pickup the fastest mirror"`
	Quiet              bool              `short:"q" long:"quiet" description:"quiet mode, no progress bars"`
	AuthUser           string            `short:"u" long:"username" description:"basic http auth username"`
	AuthPass           string            `long:"password" description:"basic http auth password"`
	HeaderMap          map[string]string `long:"header" value-name:"key:value" description:"arbitrary http header"`
	InsecureSkipVerify bool              `long:"no-check-certificate" description:"don't validate the server's certificate"`
	Debug              bool              `long:"debug" description:"enable debug to stderr"`
	Version            bool              `long:"version" description:"show version"`
}

Options struct, represents cmd line options

type Part

type Part struct {
	FileName string
	Start    int64
	Stop     int64
	Written  int64
	Elapsed  time.Duration
	Skip     bool
	// contains filtered or unexported fields
}

Part represents state of each download part

type Session

type Session struct {
	Location          string
	SuggestedFileName string
	ContentMD5        string
	AcceptRanges      string
	StatusCode        int
	ContentLength     int64
	ContentType       string
	HeaderMap         map[string]string
	Parts             []*Part
}

Session represents download session state

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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