shared

package
v0.0.0-...-9998b90 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdLineOpts = []CmdLineOpt{{
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}}

CmdLineOpts are all command-line Options of AdGuard Home.

Functions

func InitCmdLineOpts

func InitCmdLineOpts()

InitCmdLineOpts completes initialization of the global command-line option slice. It must only be called once.

func ParseCmdOpts

func ParseCmdOpts(cmdName string, args []string) (o Options, eff Effect, err error)

ParseCmdOpts parses the command-line arguments into Options and effects.

func PrintHelp

func PrintHelp(exec string)

PrintHelp prints the entire help message. It exits with an error code if there are any I/O errors.

Types

type CmdLineOpt

type CmdLineOpt struct {
	// contains filtered or unexported fields
}

CmdLineOpt contains the data for a single command-line option. Only one of updateWithValue, updateNoValue, and effect must be present.

type Effect

type Effect func() (err error)

Effect is the type for functions used for their side effects.

type Options

type Options struct {
	// confFilename is the path to the configuration file.
	ConfFilename string

	// workDir is the path to the working directory where AdGuard Home stores
	// filter data, the query log, and other data.
	WorkDir string

	// logFile is the path to the log file.  If empty, AdGuard Home writes to
	// stdout; if "syslog", to syslog.
	LogFile string

	// pidFile is the file name for the file to which the PID is saved.
	PidFile string

	// serviceControlAction is the service action to perform.  See
	// [service.ControlAction] and [handleServiceControlAction].
	ServiceControlAction string

	// bindHost is the address on which to serve the HTTP UI.
	//
	// Deprecated: Use bindAddr.
	BindHost netip.Addr

	// bindPort is the port on which to serve the HTTP UI.
	//
	// Deprecated: Use bindAddr.
	BindPort uint16

	// bindAddr is the address to serve the web UI on.
	BindAddr netip.AddrPort

	// checkConfig is true if the current invocation is only required to check
	// the configuration file and exit.
	CheckConfig bool

	// disableUpdate, if set, makes AdGuard Home not check for updates.
	DisableUpdate bool

	// performUpdate, if set, updates AdGuard Home without GUI and exits.
	PerformUpdate bool

	// verbose shows if verbose logging is enabled.
	Verbose bool

	// runningAsService flag is set to true when Options are passed from the
	// service runner
	//
	// TODO(a.garipov): Perhaps this could be determined by a non-empty
	// serviceControlAction?
	RunningAsService bool

	// glinetMode shows if the GL-Inet compatibility mode is enabled.
	GlinetMode bool

	// NoEtcHosts flag should be provided when /etc/hosts file shouldn't be
	// used.
	NoEtcHosts bool

	// localFrontend forces AdGuard Home to use the frontend files from disk
	// rather than the ones that have been compiled into the binary.
	LocalFrontend bool
}

Options represents the command-line Options.

Jump to

Keyboard shortcuts

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