Open MaxJa4 opened 1 year ago
Closes #130
Exposing Lookup to the user enables them to use a custom LookupEnv function. This way, any custom logic like the _FILE convention mentioned in #130 can be supported on the application side.
Lookup
LookupEnv
Example taken and adapted from offen/docker-volume-backup:
envconfig.Lookup = func(key string) (string, bool) { location, ok := os.LookupEnv(key + "_FILE") if ok { contents, err := os.ReadFile(location) if err != nil { return "", false } return string(contents), true } return os.LookupEnv(key) } if err := envconfig.Process("", &config); err != nil { panic(err) } ...
Closes #130
Exposing
Lookup
to the user enables them to use a customLookupEnv
function. This way, any custom logic like the _FILE convention mentioned in #130 can be supported on the application side.Example taken and adapted from offen/docker-volume-backup: