Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support any type that implements Setter (or any other similar) interface #128

Open
skovtunenko opened this issue Jul 19, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation feature New feature or request

Comments

@skovtunenko
Copy link

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:


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 cristaloleg self-assigned this Jul 19, 2022
@cristaloleg cristaloleg added documentation Improvements or additions to documentation feature New feature or request labels Jul 19, 2022
@cristaloleg
Copy link
Member

Thanks, will take a look shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants