This commit is contained in:
aozhiwei 2020-10-28 14:13:15 +08:00
parent d10e631684
commit 1ba269fb20
6 changed files with 57 additions and 4 deletions

View File

@ -15,15 +15,17 @@ func (this *App_) Init() {
f5.App.SetPkgName("analyseapi")
this.App_.Init()
G.MetaMgr = new(MetaMgr).Init()
G.HttpServer = new(f5.HttpServer).Init()
G.RiskMgr = new(RiskMgr).Init()
G.GameLog = new(GameLog).Init()
G.HttpServer = new(f5.HttpServer).Init()
G.HttpServer.Start(G.MetaMgr.GetServer(1).GetListenPort());
}
func (this *App_) UnInit() {
G.GameLog.UnInit()
G.HttpServer.UnInit()
G.GameLog.UnInit()
G.RiskMgr.UnInit()
G.MetaMgr.UnInit()
this.App_.UnInit()
}

View File

@ -8,6 +8,7 @@ type GlobalVar struct {
MetaMgr *MetaMgr
HttpServer *f5.HttpServer
GameLog *GameLog
RiskMgr *RiskMgr
}
var G *GlobalVar = &GlobalVar{}

View File

@ -1,7 +1,9 @@
package main
import "f5"
import "mt"
import (
"f5"
"mt"
)
const (
MT_SERVER_INFO = 0

View File

@ -5,3 +5,11 @@ import "mt"
type MtwServerInfo struct {
*mt.ServerInfo
}
type MtwWhiteList struct {
*mt.WhiteList
}
type MtwBlackList struct {
*mt.BlackList
}

View File

@ -0,0 +1,20 @@
package main
type RiskMgr struct {
}
func (this* RiskMgr) Init() *RiskMgr {
return this
}
func (this* RiskMgr) UnInit() {
}
func (this* RiskMgr) InWhiteList(ip string) bool {
return false
}
func (this* RiskMgr) InBlackList(ip string) bool {
return false
}

View File

@ -13,3 +13,23 @@ message ServerInfoMetas
{
repeated ServerInfo values = 1;
}
message WhiteList
{
repeated string ip_tables = 1;
}
message WhiteListMetas
{
repeated WhiteList values = 1;
}
message BlackList
{
repeated string ip_tables = 1;
}
message BlackListMetas
{
repeated WhiteList values = 1;
}