添加elasticsearch操作api
parent
92404cc17d
commit
0a452fe617
|
@ -22,11 +22,10 @@ func InitELK() {
|
||||||
if nil != e{
|
if nil != e{
|
||||||
logs.Error(e.Error())
|
logs.Error(e.Error())
|
||||||
gElkEngine.cli = nil
|
gElkEngine.cli = nil
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ElkEngine)Search() (error) {
|
func (*ElkEngine)Search(index string) (error) {
|
||||||
if nil != gElkEngine.cli{
|
if nil != gElkEngine.cli{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,12 @@ func Init() {
|
||||||
//InitMongoDb()
|
//InitMongoDb()
|
||||||
fmt.Print("api runmode is " + config.ApiConfig().RunMode)
|
fmt.Print("api runmode is " + config.ApiConfig().RunMode)
|
||||||
if config.ApiConfig().RunMode == "debug"{
|
if config.ApiConfig().RunMode == "debug"{
|
||||||
blogDb = Database{Type: string(""), DB: initMysql(blogConf)}
|
blogDb = Database{Type: string(""), DB: initMysqlTLS(blogConf)}
|
||||||
}else{
|
}else{
|
||||||
blogDb = Database{Type: string(""), DB: initMysqlTLS(blogConf)}
|
blogDb = Database{Type: string(""), DB: initMysqlTLS(blogConf)}
|
||||||
}
|
}
|
||||||
if config.ApiConfig().RunMode == "debug"{
|
if config.ApiConfig().RunMode == "debug"{
|
||||||
gDb = Database{Type: string(""), DB: initMysql(mysqlconf)}
|
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
|
||||||
}else{
|
}else{
|
||||||
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
|
gDb = Database{Type: string(""), DB: initMysqlTLS(mysqlconf)}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue