first commit
This commit is contained in:
23
pkg/config/options.go
Normal file
23
pkg/config/options.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package config
|
||||
|
||||
type (
|
||||
// Option defines the method to customize the config options.
|
||||
Option func(opt *options)
|
||||
|
||||
options struct {
|
||||
env bool
|
||||
}
|
||||
)
|
||||
|
||||
// UseEnv customizes the config to use environment variables.
|
||||
func UseEnv() Option {
|
||||
return func(opt *options) {
|
||||
opt.env = true
|
||||
}
|
||||
}
|
||||
|
||||
func SetEnv(f bool) Option {
|
||||
return func(opt *options) {
|
||||
opt.env = f
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user