1
This commit is contained in:
parent
f819ba925e
commit
7c03940082
@ -29,6 +29,17 @@ func (this *MetaMgr) Init() *MetaMgr {
|
|||||||
Idx: MT_SERVER_INFO,
|
Idx: MT_SERVER_INFO,
|
||||||
RawMeta: (*mt.ServerInfoMetas)(nil),
|
RawMeta: (*mt.ServerInfoMetas)(nil),
|
||||||
WrapMeta: (*MtwServerInfo)(nil)},
|
WrapMeta: (*MtwServerInfo)(nil)},
|
||||||
|
f5.MetaClass{
|
||||||
|
PrimKey: "InstanceId",
|
||||||
|
FileName: configDir + "mysql.cluster.json",
|
||||||
|
Idx: MT_MYSQL_CONF,
|
||||||
|
RawMeta: (*mt.MysqlConfMetas)(nil),
|
||||||
|
WrapMeta: (*MtwMysqlConf)(nil)},
|
||||||
|
f5.MetaClass{
|
||||||
|
FileName: configDir + "gamepay_backend.json",
|
||||||
|
Idx: MT_GAME_CONF,
|
||||||
|
RawMeta: (*mt.GameConfMetas)(nil),
|
||||||
|
WrapMeta: (*MtwGameConf)(nil)},
|
||||||
}
|
}
|
||||||
this.MetaMgr.RegisterMetaClasses(metaClasses)
|
this.MetaMgr.RegisterMetaClasses(metaClasses)
|
||||||
this.Load()
|
this.Load()
|
||||||
@ -47,3 +58,15 @@ func (this *MetaMgr) GetServer(instance_id int32) *MtwServerInfo {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *MetaMgr) GetCurrServer() *MtwServerInfo {
|
||||||
|
return this.GetServer(int32(f5.App.GetInstanceId()))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MetaMgr) GetMysqlCluster() []*MtwMysqlConf {
|
||||||
|
return this.GetMetaList(MT_MYSQL_CONF).([]*MtwMysqlConf)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MetaMgr) GetGameConfs() []*MtwGameConf {
|
||||||
|
return this.GetMetaList(MT_GAME_CONF).([]*MtwGameConf)
|
||||||
|
}
|
||||||
|
@ -5,3 +5,11 @@ import "mt"
|
|||||||
type MtwServerInfo struct {
|
type MtwServerInfo struct {
|
||||||
*mt.ServerInfo
|
*mt.ServerInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MtwMysqlConf struct {
|
||||||
|
*mt.MysqlConf
|
||||||
|
}
|
||||||
|
|
||||||
|
type MtwGameConf struct {
|
||||||
|
*mt.GameConf
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user