deprecated-oc-catalog/services/init.go
2023-03-03 14:43:11 +01:00

29 lines
452 B
Go

package services
import (
"os"
"github.com/beego/beego/v2/core/logs"
beego "github.com/beego/beego/v2/server/web"
)
func Init() {
Discoveryinit() //First init DC name
var DBpoint string
var err error
DBpoint = os.Getenv("DOCKER_DBPOINT")
if len(DBpoint) == 0 {
DBpoint, err = beego.AppConfig.String("DBPOINT")
if err != nil {
logs.Critical("DBPOINT URI error: %v", err)
panic(err)
}
}
Mongoinit(DC_NAME + "-" + DBpoint)
}