Documentation ¶
Index ¶
- type Ch
- type Data
- func (d *Data) BindwithFiles(procs int) error
- func (d Data) DirName() string
- func (d Data) FileName() string
- func (d Data) FileSize() uint64
- func (d Data) IsFree(split uint64) error
- func (d *Data) MakeRange(i, split, procs uint64) Range
- func (d Data) ProgressBar(ctx context.Context, ch *Ch)
- func (d *Data) SetDirName(path, filename string, procs int)
- func (d *Data) SetFileName(output string)
- func (d *Data) SetFileSize(size uint64)
- func (d Data) SplitFilePath(output string) (string, string, error)
- func (d *Data) URLFileName(url string)
- type Options
- type Pget
- type Range
- type Utils
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data struct has file of relational data
func (*Data) BindwithFiles ¶
BindwithFiles function for file binding after split download
func (Data) ProgressBar ¶
ProgressBar is to show progressbar
func (*Data) SetDirName ¶
SetDirName set to Data structs member
func (*Data) SetFileName ¶
SetFileName set to Data structs member
func (*Data) SetFileSize ¶
SetFileSize set to Data structs member
func (Data) SplitFilePath ¶
SplitFilePath will return filename and path from input
func (*Data) URLFileName ¶
URLFileName set to Data structs member using url
type Options ¶
type Options struct { Help bool `short:"h" long:"help" description:"print usage and exit"` Version bool `short:"v" long:"version" description:"display the version of pget and exit"` Procs int `short:"p" long:"procs" description:"split ratio to download file"` Output string `short:"o" long:"output" description:"output file to PATH or FILENAME"` Timeout int `short:"t" long:"timeout" description:"timeout of checking request in seconds"` Update bool `long:"check-update" description:"check if there is update available"` Trace bool `long:"trace" description:"display detail error messages"` }
Options struct for parse command line arguments
type Pget ¶
Pget structs
func (Pget) MakeResponse ¶
MakeResponse return *http.Response include context and range header
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
Range struct for range access
type Utils ¶
type Utils interface { SplitFilePath(string) (string, string, error) ProgressBar(context.Context, *Ch) BindwithFiles(int) error IsFree(uint64) error MakeRange(uint64, uint64, uint64) Range // like setter SetFileName(string) URLFileName(string) SetDirName(string, string, int) SetFileSize(uint64) // like getter FileName() string FileSize() uint64 DirName() string }
Utils interface indicate function
Click to show internal directories.
Click to hide internal directories.