config

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMinSplitSize          = 10 * 1024 * 1024
	DefaultMinSplitSizeFormatted = "10 MiB"
	DefaultConnectTimeout        = 1 * time.Minute
	DefaultTransferTimeout       = 20 * time.Second
	DefaultMaxConnections        = 3
	DefaultAutoSaveControl       = 15 * time.Second
	DefaultRetryDelay            = 2 * time.Second
	DefaultMaxRetries            = 0
)

Variables

View Source
var C = &Config{
	MaxLogLevel:   LogNone,
	ProgressLevel: ProgressNone,

	Force:       false,
	Preallocate: true,

	ConnectTimeout:  DefaultConnectTimeout,
	TransferTimeout: DefaultTransferTimeout,

	Resume:          true,
	AutoSaveControl: DefaultAutoSaveControl,

	RetryDelay: DefaultRetryDelay,
	MaxRetries: DefaultMaxRetries,

	DownloadDir:  "./",
	DownloadName: "",

	MinSplitSize:   DefaultMinSplitSize,
	MaxConnections: DefaultMaxConnections,
}
View Source
var Version string
View Source
var WG = &sync.WaitGroup{}

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxLogLevel LogLevel
	Debug       bool

	ProgressLevel ProgressLevel
	TaskWidth     int
	TaskFormat    string

	Force       bool
	Preallocate bool

	ConnectTimeout  time.Duration
	TransferTimeout time.Duration

	Resume          bool
	AutoSaveControl time.Duration

	RetryDelay time.Duration
	MaxRetries int

	DownloadDir  string
	DownloadName string

	MinSplitSize   int64
	MaxConnections int64

	UserAgent      string
	UserAgentExtra string
}

func (*Config) SetUserAgent added in v0.1.3

func (c *Config) SetUserAgent()

type LogLevel

type LogLevel int
const (
	LogNone LogLevel = iota
	LogStandard
	LogVerbose
)

type ProgressLevel

type ProgressLevel int
const (
	ProgressNone ProgressLevel = iota
	ProgressStatic
	ProgressDynamic
)

Jump to

Keyboard shortcuts

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