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.
 
 
 
 
 
 

42 lines
1.3 KiB

/*
服务配置管理模块 —— 装在每个「持有业务凭据 sys 客户端」的业务服务里(当前 home / api)。
职责只有一个:接收集群内下发的「业务功能配置变更」通知,重载**本服务**持有的 sys 客户端。
为什么独立成模块而不是塞进 user/api:
- 它是运维/管理面,不该寄生在终端用户接口模块里(权限与语义边界完全不同);
- 每个业务服务都持有各自的 sys 客户端(home 有 email/sms/auth/pay,api 也有 email),
只重载其中一个,另一个照旧用着旧凭据——必须每个服务各自重载。
下发路径:console --HTTPS+HMAC--> gateway --rpcx--> api 服务(业务侧管理入口)
└─ 扇出 rpcx 给 comm.ModuleConfigServices 各服务
*/
package svccfg
import (
"yunyan/comm"
"yunyan/lego/core"
"yunyan/modules"
)
func NewModule() core.IModule {
return new(SvcCfg)
}
type SvcCfg struct {
modules.ModuleBase
cfg *configComp
}
func (this *SvcCfg) GetType() core.M_Modules {
return comm.ModuleSvcCfg
}
func (this *SvcCfg) NewOptions() (options core.IModuleOptions) {
return new(modules.Options)
}
func (this *SvcCfg) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.cfg = this.RegisterComp(new(configComp)).(*configComp)
}