Documentation
¶
Index ¶
- func BuildURLSlice(urls []string, inputFile string) []string
- func DownloadWorker(i int, wg *sync.WaitGroup, chunks chan download, bs int, finished chan header)
- func Monitoring(files []*File, done chan bool, d chan download, quiet bool)
- func NewClient() (*http.Client, error)
- func RebalanceChunks(h chan header, d chan download, files []*File)
- type Chunk
- type ConsoleMonitoring
- type File
- type GoXel
- type Message
- func NewErrorMessage(context string, content string) Message
- func NewErrorMessageForFile(fileID uint32, context string, content string) Message
- func NewInfoMessage(context string, content string) Message
- func NewInfoMessageForFile(fileID uint32, context string, content string) Message
- func NewMessageForFile(fileID uint32, context string, content string, t MessageType) Message
- func NewWarningMessage(context string, content string) Message
- func NewWarningMessageForFile(fileID uint32, context string, content string) Message
- type MessageType
- type QuietMonitoring
- type StandardURLPreprocessor
- type URLPreprocessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildURLSlice ¶
BuildURLSlice builds the initial URLs list containing URLs from command line and input file
func DownloadWorker ¶
DownloadWorker is the worker functions that processes the download of one Chunk. It takes a WaitGroup to ensure all workers have finished before exiting the program. It also takes a Channel of Chunks to receive the chunks to download.
func Monitoring ¶
Monitoring handles the files' termination and monitoring
func NewClient ¶
NewClient returns a HTTP client with the requested configuration It supports HTTP and SOCKS proxies
func RebalanceChunks ¶
func RebalanceChunks(h chan header, d chan download, files []*File)
RebalanceChunks ensures new connections have a chunk attributed to help delayed ones
Types ¶
type Chunk ¶
Chunk stores a part of a file being downloaded
func (*Chunk) BuildProgress ¶
BuildProgress builds the progress display for a specific Chunk "-" means downloaded during this process " " means not yet downloaded
type ConsoleMonitoring ¶
type ConsoleMonitoring struct {
// contains filtered or unexported fields
}
ConsoleMonitoring monitors the current downloads and display the speed and progress for each files
type File ¶
type File struct {
URL, Output, OutputWork string
Chunks []Chunk
Finished, Valid, Initialized bool
Error string
Size, Initial uint64
Progress []string
Mux sync.Mutex
ID uint32
}
File stores a file to be downloaded
func (*File) BuildChunks ¶
BuildChunks builds the Chunks slice for each part of the file to be downloaded It retrieves existing metadata file in order to resume downloads. Each created chunk is sent to the channel past in parameters. The nbrPerFile parameter determines the max number of splits for each file. In case the download is being resumed, the nbrPerFile is ignored in favor of the number stored in the metadata file.
func (*File) BuildProgress ¶
BuildProgress builds the progress display for a specific File "-" means downloaded during this process " " means not yet downloaded "+" means already downloaded during a previous process (resumed)
func (*File) ResumeChunks ¶
ResumeChunks tries to resume the current download by checking if the file exists and is valid
func (*File) UpdateStatus ¶
UpdateStatus returns the current status of the download The first returned value is the progress percentage The second returned value is the number of active connections for this file The third returned value is the number of bytes downloaded The last returned value is the number of bytes downloaded during this session
type GoXel ¶
type GoXel struct {
IgnoreSSLVerification, OverwriteOutputFile, Quiet, Scroll, Resume bool
OutputDirectory, InputFile, Proxy string
MaxConnections, MaxConnectionsPerFile, BufferSize int
Headers map[string]string
URLs []string
}
GoXel structure contains all the parameters to be used for the GoXel accelerator Credentials can either be passed in command line arguments or using the following environment variables: - GOXEL_ALLDEBRID_USERNAME - GOXEL_ALLDEBRID_PASSWD
type Message ¶
type Message struct { FileID uint32 Content, Context string Type MessageType }
Message contains global messages to be displayed by monitoring
func NewErrorMessage ¶
NewErrorMessage builds an Error message with no related file
func NewErrorMessageForFile ¶
NewErrorMessageForFile builds an Error message with a related file
func NewInfoMessage ¶
NewInfoMessage builds an Info message with no related file
func NewInfoMessageForFile ¶
NewInfoMessageForFile builds an Info message with a related file
func NewMessageForFile ¶
func NewMessageForFile(fileID uint32, context string, content string, t MessageType) Message
NewMessageForFile builds a standard Message
func NewWarningMessage ¶
NewWarningMessage builds a Warning message with no related file
type MessageType ¶
type MessageType int
MessageType identifies the severity of the message
const ( Info MessageType = iota + 1 Warning Error )
Message Severities
func (MessageType) String ¶
func (t MessageType) String() string
type QuietMonitoring ¶
type QuietMonitoring struct {
// contains filtered or unexported fields
}
QuietMonitoring only ensures the Files are synced every Xs
type StandardURLPreprocessor ¶
type StandardURLPreprocessor struct{}
StandardURLPreprocessor ensures the URL is correct and trims it
type URLPreprocessor ¶
type URLPreprocessor interface {
// contains filtered or unexported methods
}
URLPreprocessor defines the interface for the URL processors New processors can easily be added to transform input URLs for example