config pb
This commit is contained in:
parent
08100eb57f
commit
e3a7703bc5
@ -2,9 +2,7 @@ package mongo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
@ -41,21 +39,11 @@ type MongoDB struct {
|
||||
|
||||
func (m *MongoDB) Init(collections []string, config MongoConf) {
|
||||
// var baseConfig string
|
||||
var err error
|
||||
var conf map[string]string
|
||||
m.Logger = logs.CreateLogger("oc-lib", "")
|
||||
ResourceMap = make(map[string]interface{})
|
||||
|
||||
logger := logs.CreateLogger("oclib", "")
|
||||
|
||||
db_conf, err := os.ReadFile("tests/oclib_conf.json")
|
||||
if err != nil {
|
||||
logger.Fatal().Msg("Could not find configuration file")
|
||||
}
|
||||
json.Unmarshal(db_conf, &conf)
|
||||
|
||||
logger.Info().Msg("Connecting to" + config.GetUrl())
|
||||
|
||||
MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user