getparty

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: BSD-3-Clause Imports: 27 Imported by: 0

README

getparty Build Status

Console download manager

showcase

Installation

getparty requires Go 1.7 or later.

$ go install github.com/vbauerster/getparty/cmd/getparty

Usage

Usage:
  getparty [OPTIONS] url

Application Options:
  -p, --parts=n                               number of parts (default: 2)
  -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 [...file|stdin]           pickup the fastest mirror
  -u, --username=                             basic http auth username
      --password=                             basic http auth password
      --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

This section is empty.

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"`
	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 [...file|stdin]" description:"pickup the fastest mirror"`
	AuthUser     string `short:"u" long:"username" description:"basic http auth username"`
	AuthPass     string `long:"password" description:"basic http auth password"`
	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
	Skip     bool
}

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
	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