Secret implementation of config. Supporting config merge (#2027)

Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
Janos Dobronszki
2020-09-29 15:30:51 +02:00
committed by GitHub
parent d246ccbeef
commit 87e898f4fc
5 changed files with 364 additions and 17 deletions

View File

@@ -27,16 +27,17 @@ type Value interface {
}
type Options struct {
// Is the value being read a secret?
// If true, the Config will try to decode it with `SecretKey`
Secret bool
}
// Option sets values in Options
type Option func(o *Options)
func Secret(isSecret bool) Option {
func Secret(b bool) Option {
return func(o *Options) {
o.Secret = isSecret
o.Secret = b
}
}
type Secrets interface {
Config
}