You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
package gateway
|
|
|
|
import (
|
|
"yunyan/modules"
|
|
|
|
"yunyan/lego/utils/mapstructure"
|
|
)
|
|
|
|
/*
|
|
网关模块 参数定义
|
|
*/
|
|
|
|
type (
|
|
Options struct {
|
|
modules.Options
|
|
GinDebug bool //web引擎日志开关
|
|
ListenPort int //websocket 监听端口
|
|
IsSign bool //是否开启签名验证
|
|
SignKey string //签名key
|
|
TokenKey string //token key
|
|
WhiteList []string //不需要登录验证的接口白名单
|
|
WechatWebAppID string //微信网页登录AppID
|
|
WechatWebSecret string //微信网页登录Secret
|
|
WeChatTokenURL string //微信网页登录换票接口URL
|
|
AppScheme string //iOS App自定义URL Scheme(与App端一致)
|
|
EncryptKey string //响应加密 AES-CBC key,长度必须为 16/24/32 字节;为空表示禁用加密
|
|
}
|
|
)
|
|
|
|
// LoadConfig 配置文件序列化为Options
|
|
func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
|
if settings != nil {
|
|
if err = this.Options.LoadConfig(settings); err != nil {
|
|
return
|
|
}
|
|
if err = mapstructure.Decode(settings, this); err != nil {
|
|
return
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|