Ai
1 Star 0 Fork 0

非空非零/jupiter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
jupiter_option.go 566 Bytes
一键复制 编辑 原始数据 按行查看 历史
renzhentao 提交于 2021-06-21 15:02 +08:00 . 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
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nonull/eden.git
git@gitee.com:nonull/eden.git
nonull
eden
jupiter
v0.3.1

搜索帮助