2023-03-03 14:43:11 +01:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
2023-12-04 14:46:36 +01:00
|
|
|
"cloud.o-forge.io/core/oc-catalog/conf"
|
2023-03-03 14:43:11 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func Init() {
|
2023-12-04 14:46:36 +01:00
|
|
|
// Discoveryinit() //First init DC name
|
|
|
|
|
2024-02-15 10:52:29 +01:00
|
|
|
// var DBpoint string
|
|
|
|
// var err error
|
2023-10-31 11:23:39 +01:00
|
|
|
|
2024-02-15 10:52:29 +01:00
|
|
|
DCName := conf.GetConfig().DCNAME
|
|
|
|
DBPoint := conf.GetConfig().DBPOINT
|
2023-12-04 14:46:36 +01:00
|
|
|
|
2024-02-15 10:52:29 +01:00
|
|
|
// DBpoint = os.Getenv("DOCKER_DBPOINT")
|
2023-12-04 14:46:36 +01:00
|
|
|
// if len(DBpoint) == 0 {
|
|
|
|
// DBpoint, err = beego.AppConfig.String("DBPOINT")
|
|
|
|
// if err != nil {
|
|
|
|
// logs.Critical("DBPOINT URI error: %v", err)
|
|
|
|
// panic(err)
|
|
|
|
// }
|
2024-02-15 10:52:29 +01:00
|
|
|
|
2023-12-04 14:46:36 +01:00
|
|
|
// }
|
2023-03-03 14:43:11 +01:00
|
|
|
|
2024-02-15 10:52:29 +01:00
|
|
|
// Mongoinit(DC_NAME + "-" + DBpoint)
|
|
|
|
Mongoinit(DCName + "-" + DBPoint )
|
|
|
|
// Mongoinit("beego-demo")
|
2023-03-03 14:43:11 +01:00
|
|
|
|
|
|
|
}
|