magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

Add environment variable overrides for file loaded properties #30

Open svdberg opened 6 years ago

svdberg commented 6 years ago

We internally use the functionality of overriding loaded properties with prefixed environment variables. We convert the names of these env variables to property keys with a simple replacement scheme. This PR implements this logic. Feel free to do anything with it you like, just sharing in case there is any interest in this approach.

Example: thrift.client=proxy can be overridden with the PREFIX_THRIFT_CLIENT environment variable, where PREFIX is configurable.