storj/pkg
Jeff Wendling e74cac52ab
Command line flags features and cleanup (#2068)
* change BindSetup to be an option to Bind
* add process.Bind to allow composite structures
* hack fix for noprefix flags
* used tagged version of structs

Before this PR, some flags were created by calling `cfgstruct.Bind` and having their fields create a flag. Once the flags were parsed, `viper` was used to acquire all the values from them and config files, and the fields in the struct were set through the flag interface.

This doesn't work for slices of things on config structs very well, since it can only set strings, and for a string slice, it turns out that the implementation in `pflag` appends an entry rather than setting it.

This changes three things:

1. Only have a `Bind` call instead of `Bind` and `BindSetup`, and make `BindSetup` an option instead.
2. Add a `process.Bind` call that takes in a `*cobra.Cmd`, binds the struct to the command's flags, and keeps track of that struct in a global map keyed by the command.
3. Use `viper` to get the values and load them into the bound configuration structs instead of using the flags to propagate the changes.

In this way, we can support whatever rich configuration we want in the config yaml files, while still getting command like flags when important.
2019-05-29 17:56:22 +00:00
..
accounting Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
audit Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
auth Enable gocritic linter (#2051) 2019-05-29 09:14:25 -04:00
bwagreement handle database error checks properly (#1796) 2019-04-23 14:13:57 +03:00
certdb Unite all cryptographic signing and verifying (#1244) 2019-02-07 14:39:20 -06:00
certificates Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
cfgstruct Command line flags features and cleanup (#2068) 2019-05-29 17:56:22 +00:00
datarepair properly check last iteration of checker (#2040) 2019-05-23 18:14:08 +02:00
dht Refactor pb.Node protobuf (#1785) 2019-04-22 12:07:50 +03:00
discovery Enable gocritic linter (#2051) 2019-05-29 09:14:25 -04:00
eestream Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
encryption Enable gocritic linter (#2051) 2019-05-29 09:14:25 -04:00
identity Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
kademlia Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
macaroon Enable gocritic linter (#2051) 2019-05-29 09:14:25 -04:00
metainfo/kvmetainfo server side macaroons (#1945) 2019-05-24 10:51:27 -06:00
miniogw server side macaroons (#1945) 2019-05-24 10:51:27 -06:00
overlay add Reverify to auditing (#2041) 2019-05-27 14:13:47 +03:00
pb filter duplicate node IPs (#1890) 2019-05-22 16:06:27 -04:00
peertls Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
pkcrypto Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
process Command line flags features and cleanup (#2068) 2019-05-29 17:56:22 +00:00
ranger Enable gocritic linter (#2051) 2019-05-29 09:14:25 -04:00
server Move pointerdb.Service to satellite (#1826) 2019-04-25 10:46:32 +02:00
storage Enable Scopelint Linter (#2049) 2019-05-29 09:30:16 -04:00
storj Enable gocritic linter (#2051) 2019-05-29 09:14:25 -04:00
stream remove utils.CombineErrors and utils.ErrorGroup (#1603) 2019-03-29 14:30:23 +02:00
telemetry Cleanup repository a bit (#1203) 2019-02-01 20:21:00 +02:00
transport filter duplicate node IPs (#1890) 2019-05-22 16:06:27 -04:00