A decoder for initializing structs from environment variables would be a nice addition to this package.
struct MyConfigVars: Decodable {
var mysqlURL: String
var googleToken: String
var fooID: Int
}
var env = try Environment.detect()
let myConfig = try EnvironmentDecoder().decode(MyConfigVars.self, from: env)
print(myConfig.mysqlURL) // String
This decoder would automatically translate camelCase var names to UPPER_SNAKE_CASE.
A decoder for initializing structs from environment variables would be a nice addition to this package.
This decoder would automatically translate
camelCase
var names toUPPER_SNAKE_CASE
.