|
@@ -1,14 +1,13 @@
|
|
|
package public
|
|
|
|
|
|
import (
|
|
|
- "log"
|
|
|
- "strings"
|
|
|
-
|
|
|
util "app.yhyue.com/moapp/jybase/common"
|
|
|
elastic "app.yhyue.com/moapp/jybase/esv1"
|
|
|
+ es "app.yhyue.com/moapp/jybase/esv7"
|
|
|
m "app.yhyue.com/moapp/jybase/mongodb"
|
|
|
"app.yhyue.com/moapp/jybase/mysql"
|
|
|
"app.yhyue.com/moapp/jybase/redis"
|
|
|
+ "log"
|
|
|
)
|
|
|
|
|
|
var (
|
|
@@ -61,8 +60,10 @@ type mgoConf struct {
|
|
|
}
|
|
|
|
|
|
type esConf struct {
|
|
|
- Address string
|
|
|
- Size int
|
|
|
+ Address string
|
|
|
+ Size int
|
|
|
+ UserName string
|
|
|
+ Password string
|
|
|
}
|
|
|
type redisConf struct {
|
|
|
Address string
|
|
@@ -85,11 +86,8 @@ func init() {
|
|
|
}
|
|
|
|
|
|
if DbConf.Elasticsearch.Doc != nil {
|
|
|
- EsDoc = &elastic.Elastic{
|
|
|
- Addrs: strings.Split(DbConf.Elasticsearch.Doc.Address, ","),
|
|
|
- I_size: DbConf.Elasticsearch.Doc.Size,
|
|
|
- }
|
|
|
- EsDoc.InitElasticSize()
|
|
|
+ es.InitElasticSizeByAuth(DbConf.Elasticsearch.Doc.Address, DbConf.Elasticsearch.Doc.Size,
|
|
|
+ DbConf.Elasticsearch.Doc.UserName, DbConf.Elasticsearch.Doc.Password)
|
|
|
log.Println("初始化 doc elasticsearch")
|
|
|
}
|
|
|
|