31 lines
594 B
Go
31 lines
594 B
Go
package gateway
|
|
|
|
import (
|
|
"go_dreamfactory/lego/utils/mapstructure"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
/*
|
|
网关模块 参数定义
|
|
*/
|
|
|
|
type (
|
|
Options struct {
|
|
modules.Options
|
|
GinDebug bool //web引擎日志开关
|
|
ListenPort int //websocket 监听端口
|
|
SpanServiceTag string //跨服集群
|
|
}
|
|
)
|
|
|
|
// 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
|
|
}
|