options

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// DfPath `dfget` path.
	DfPath string

	// DFRepo the default value is `$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 indicates whether to not back source to download when p2p fails.
	Notbs bool

	// MaxProcs the maximum number of CPUs that the dfdaemon can use.
	MaxProcs int

	// Version show version.
	Version bool

	// Verbose indicates whether to be verbose.
	// If set true, log level will be 'debug'.
	Verbose bool

	// HostIP dfdaemon host ip, default: 127.0.0.1.
	HostIP string

	// Port that dfdaemon will listen, default: 65001.
	Port uint

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

	// The regex download the url by P2P if url matches,
	// format:reg1,reg2,reg3.
	DownRule string

	// Cert file path,
	CertFile string

	// Key file path.
	KeyFile string

	// TrustHosts includes the trusted hosts which dfdaemon forward their
	// requests directly when dfdaemon is used to http_proxy mode.
	TrustHosts []string

	// ConfigPath is the path of dfdaemon's configuration file.
	// default value is: /etc/dragonfly/dfdaemon.yml
	ConfigPath string
}

Options is the configuration

func NewOption

func NewOption() *Options

NewOption returns the default options.

func (*Options) AddFlags

func (o *Options) AddFlags(fs *flag.FlagSet)

AddFlags add flags to the specified FlagSet.

Jump to

Keyboard shortcuts

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