添加elasticsearch操作api

master
a7458969 2020-03-20 23:13:04 +08:00
parent 92404cc17d
commit 0a452fe617
2 changed files with 3 additions and 4 deletions

View File

@ -22,11 +22,10 @@ func InitELK() {
if nil != e{
logs.Error(e.Error())
gElkEngine.cli = nil
}
}
func (*ElkEngine)Search() (error) {
func (*ElkEngine)Search(index string) (error) {
if nil != gElkEngine.cli{
}

View File

@ -24,12 +24,12 @@ func Init() {
//InitMongoDb()
fmt.Print("api runmode is " + config.ApiConfig().RunMode)
if config.ApiConfig().RunMode == "debug"{
blogDb = Database{Type: string(""), DB: initMysql(blogConf)}
blogDb = Database{Type: string(""), DB: initMysqlTLS(blogConf)}
}else{
blogDb = Database{Type: string(""), DB: initMysqlTLS(blogConf)}
}
if config.ApiConfig().RunMode == "debug"{
gDb = Database{Type: string(""), DB: initMysql(mysqlconf)}
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
}else{
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
}