Secret implementation of config. Supporting config merge (#2027)
Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user