add get cluster config

This commit is contained in:
Ybehrooz
2025-05-25 20:45:25 +03:30
parent 393a7650c1
commit 419ba18705
4 changed files with 104 additions and 7 deletions

View File

@@ -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")
}