Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HomeDir is the user home. HomeDir string // UseHTTPS indicates whether to use HTTPS protocol. UseHTTPS bool // CommandLine stores all the command line parameters. CommandLine CommandParam // RegProto is the protocol(HTTP/HTTPS) of images registry. RegProto string // RegDomain is the domain of images registry. RegDomain string // DFPattern is the url patterns. Dfdaemon starts downloading by P2P if the downloading url matches DFPattern. DFPattern = make(map[string]*regexp.Regexp) // Properties holds all properties get from dfdaemon's config file. Properties *config.Properties )
Functions ¶
func MatchDfPattern ¶
MatchDfPattern returns true if location matches DFPattern, otherwise returns false.
func UpdateDFPattern ¶
func UpdateDFPattern(reg string)
UpdateDFPattern is to update DFPattern from the giving string(CommandParam.DownRule).
Types ¶
type CommandParam ¶
type CommandParam struct {
// DfPath `dfget` path.
DfPath string
// DFRepo stores temporary data generated by dfdaemon,
// default: `$HOME/.small-dragonfly/dfdaemon/data/`.
DFRepo string
// RateLimit limit net speed,
// format:xxxM/K.
RateLimit string
// Call system name.
CallSystem string
// Filter specified url fields.
URLFilter string
// Notbs not try back source to download if throw exception.
Notbs bool
// HostIP dfdaemon host ip, default: 127.0.0.1.
HostIP string
// Registry addr and must exist if dfdaemon is used to mirror mode,
// format: https://xxx.xx.x:port or http://xxx.xx.x:port.
Registry string
// TrustHosts includes the trusted hosts as keys of the map which dfdaemon forward their
// requests directly when dfdaemon is used to http_proxy mode.
TrustHosts map[string]string
}
CommandParam is a struct that stores all the command line parameters
Click to show internal directories.
Click to hide internal directories.