Documentation ¶
Overview ¶
Package application providers helpers used by the command-line entry points of all versions of Relay.
Index ¶
Constants ¶
const DefaultConfigPath = "/etc/ld-relay.conf"
DefaultConfigPath is the default configuration file path.
Variables ¶
This section is empty.
Functions ¶
func DescribeRelayVersion ¶
DescribeRelayVersion returns the same version string unless it is a prerelease build, in which case it is reformatted to change "+xxx" into "(build xxx)".
func StartHTTPServer ¶
func StartHTTPServer( port int, handler http.Handler, tlsEnabled bool, tlsCertFile, tlsKeyFile string, tlsMinVersion uint16, loggers ldlog.Loggers, ) (*http.Server, <-chan error)
StartHTTPServer starts the server, with or without TLS. It returns immediately, starting the server on a separate goroutine; if the server fails to start up, it sends an error to the error channel.
Types ¶
type Options ¶
type Options struct { ConfigFile string AllowMissingFile bool UseEnvironment bool PrintVersion bool }
Options represents all options that can be set from the command line.
func ReadOptions ¶
ReadOptions reads and validates the command-line options.
The configuration parameter behavior is as follows:
1. If you specify --version, relay prints a line to standard out of its current version and stop execution, instead of doing anything below. 2. If you specify --config $FILEPATH, it loads that file. Failure to find it or parse it is a fatal error, unless you also specify --allow-missing-file. 3. If you specify --from-env, it creates a configuration from environment variables as described in README. 4. If you specify both, the file is loaded first, then it applies changes from variables if any. 5. Omitting all options is equivalent to explicitly specifying --config /etc/ld-relay.conf.
func (Options) DescribeConfigSource ¶
DescribeConfigSource returns a human-readable phrase describing whether the configuration comes from a file, from variables, or both.