26 lines
420 B
Go
26 lines
420 B
Go
package web
|
|
|
|
import (
|
|
"go_dreamfactory/lego/utils/mapstructure"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
type (
|
|
Options struct {
|
|
modules.Options
|
|
WebDir string
|
|
Port int
|
|
Key string
|
|
}
|
|
)
|
|
|
|
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
|
|
}
|