Skip to content

Support configuration via command line arguments #79

@magiconair

Description

@magiconair

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions