Skip to content

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

@skovtunenko

Description

@skovtunenko

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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationfeatureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions