24 lines
423 B
Go
24 lines
423 B
Go
package timer
|
|
|
|
import (
|
|
"go_dreamfactory/lego/utils/mapstructure"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
type (
|
|
Options struct {
|
|
modules.Options
|
|
}
|
|
)
|
|
|
|
// LoadConfig 配置文件序列化为Options
|
|
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
|
if settings != nil {
|
|
if err = this.Options.LoadConfig(settings); err != nil {
|
|
return
|
|
}
|
|
err = mapstructure.Decode(settings, this)
|
|
}
|
|
return
|
|
}
|