-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationfeatureNew feature or requestNew feature or request
Description
Hello, thank you for a great library!
Sometimes there is a need to pass as an ENV variable, not a single value, but a whole struct to override all the fields inside the struct at once. This might probably be needed in highly configurable applications, where the number of exposed config params is big enough.
To solve this issue generically, the lib can give developers the ability to set a custom Unmarshaler/Setter for a type.
A typical interface to support this feature might look like this:
type Setter interface {
SetValue(string) error
}Examples from other libs:
- https://github.com/kelseyhightower/envconfig#custom-decoders
- https://github.com/ilyakaznacheev/cleanenv#supported-types
Also, please add a README.md section with information about supported data types/struct tags. Like in the: https://github.com/kelseyhightower/envconfig#supported-struct-field-types
cristaloleg
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationfeatureNew feature or requestNew feature or request