PR #63 spawned the discussion on supporting command line arguments in addition to environment variables. The suggested approach was to use github.com/spf13/viper also to reduce the amount of homegrown code.
The PR requires updates to two other projects which all have not been merged yet and adds three more libraries to the code. Also or because of this, the PR has been stale for a couple of weeks now. However, credit for the idea and the motivation belongs to @doublerebel.
I like the idea of supporting command line arguments and came up with an implementation that uses the flag.FlagSet from the Go standard library to achieve the same thing. All values can now be set either via command line, environment or properties. Environment variables are case insensitive and support an optional FABIO_ prefix. So both PROXY_ADDR and FABIO_PROXY_ADDR are valid but the FABIO_ prefixed values are preferred.
As an added bonus the github.com/magiconair/properties library was updated to 1.7.0 which now supports loading properties files from URLs.
PR #63 spawned the discussion on supporting command line arguments in addition to environment variables. The suggested approach was to use
github.com/spf13/viperalso to reduce the amount of homegrown code.The PR requires updates to two other projects which all have not been merged yet and adds three more libraries to the code. Also or because of this, the PR has been stale for a couple of weeks now. However, credit for the idea and the motivation belongs to @doublerebel.
I like the idea of supporting command line arguments and came up with an implementation that uses the
flag.FlagSetfrom the Go standard library to achieve the same thing. All values can now be set either via command line, environment or properties. Environment variables are case insensitive and support an optionalFABIO_prefix. So bothPROXY_ADDRandFABIO_PROXY_ADDRare valid but theFABIO_prefixed values are preferred.As an added bonus the
github.com/magiconair/propertieslibrary was updated to 1.7.0 which now supports loading properties files from URLs.