1 Star 0 Fork 0

非空非零/jupiter

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
jupiter_option.go 566 Bytes
Copy Edit Raw Blame History
renzhentao authored 2021-06-21 15:02 . 1
package jupiter
import "gitee.com/nonull/eden/pkg/conf"
type Option func(a *Application)
type Disable int
const (
DisableParserFlag Disable = 1
DisableLoadConfig Disable = 2
DisableDefaultGovernor Disable = 3
)
func (a *Application) WithOptions(options ...Option) {
for _, option := range options {
option(a)
}
}
func WithConfigParser(unmarshaller conf.Unmarshaller) Option {
return func(a *Application) {
a.configParser = unmarshaller
}
}
func WithDisable(d Disable) Option {
return func(a *Application) {
a.disableMap[d] = true
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nonull/eden.git
git@gitee.com:nonull/eden.git
nonull
eden
jupiter
v0.3.1

Search