add get cluster config
This commit is contained in:
7
db/db.go
7
db/db.go
@@ -9,12 +9,12 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Client *mongo.Client
|
||||
UserCollection, Vclusters_details *mongo.Collection
|
||||
Client *mongo.Client
|
||||
UserCollection, Vclusters_details, Host_cluster_details *mongo.Collection
|
||||
)
|
||||
|
||||
func InitDB() {
|
||||
clientOptions := options.Client().ApplyURI("mongodb://root:example@192.168.1.10:27017/")
|
||||
clientOptions := options.Client().ApplyURI("mongodb://root:example@192.168.2.177:27017/")
|
||||
client, err := mongo.Connect(context.TODO(), clientOptions)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -22,4 +22,5 @@ func InitDB() {
|
||||
|
||||
UserCollection = client.Database("vcluster").Collection("users")
|
||||
Vclusters_details = client.Database("vcluster").Collection("vclusters_details")
|
||||
Host_cluster_details = client.Database("vcluster").Collection("hostdetail")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user