Documentation
¶
Index ¶
- Variables
- type Options
- func (o *Options) Append(opts ...*Options)
- func (o *Options) Merge(prefix string, options map[string]interface{})
- func (o *Options) MergeYaml(yamlData []byte) error
- func (o *Options) MergeYamlFile(filePath string) error
- func (o *Options) Section(name string) *Options
- func (o *Options) Value(name string) interface{}
- func (o *Options) WithOption(name string, value interface{})
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options 配置集合
func WithOption ¶
WithOption 通过设置一个配置值来快速创建一个配置结合
@name 配置项名称 格式为 xx:xx:xx @value 配置项值 returns @*Options 配置集合
func (*Options) MergeYaml ¶
MergeYaml 向配置集合中合并来自 yaml 数据的配置集合
@yamlData yaml 数据 errors ErrEmptyOptionsYaml Yaml数据为空 ErrResolveOptionsYaml Yaml数据解析失败
func (*Options) MergeYamlFile ¶
MergeYamlFile 向配置集合中合并来自 yaml 文件的配置集合 @filePath 配置文件路径
errors ErrOpenOptionsFile 打开配置文件失败
func (*Options) Value ¶
Value 查询指定配置项的值,未查询到时将返回 nil
@name 配置项名称 格式为 xx:xx:xx returns @interface 配置项值
Click to show internal directories.
Click to hide internal directories.