Skip to content
Snippets Groups Projects

Add basic application framework and example application to show interaction between events an NBI

Merged Ghost User requested to merge istaester/init-application-framework into develop
All threads resolved!
3 files
+ 35
16
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -5,7 +5,6 @@ import (
"log"
"time"
"code.fbi.h-da.de/danet/gosdn/controller/config"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
@@ -14,13 +13,14 @@ const (
// Timeout operations after N seconds
connectTimeout = 5
// DatabaseName is the name of the mongoDB database used.
DatabaseName = "gosdn"
//mongoConnection = "mongodb://root:example@localhost"
DatabaseName = "gosdn"
mongoConnection = "mongodb://root:example@localhost:27017"
)
// GetMongoConnection Retrieves a client to the MongoDB
func GetMongoConnection() (*mongo.Client, context.Context, context.CancelFunc) {
mongoConnection := config.DatabaseConnection
// TODO: Fix getting connection from config package
// mongoConnection := config.DatabaseConnection
client, err := mongo.NewClient(options.Client().ApplyURI(mongoConnection))
if err != nil {
log.Printf("Failed to create client: %v", err)
Loading