Partial success

This commit is contained in:
Fred Boniface 2023-07-19 01:18:55 +01:00
parent 99756041bc
commit efcce8a632
5 changed files with 9 additions and 6 deletions

View File

@ -4,12 +4,12 @@ import (
"fmt"
"git.fjla.uk/owlboard/go-types/pkg/database"
"git.fjla.uk/owlboard/mq-client/helpers"
"git.fjla.uk/owlboard/mq-client/log"
)
func init() {
fmt.Println("dbAccess/access.init() Will be used to push the component version number to the database")
fmt.Printf("Version: %s\n", helpers.Version)
log.Msg.Info("Pushing mq-client version to database")
fmt.Println("ACTUALLY DO THIS HERE!")
}
func PutManyServices(collection string, data []database.Service) bool {

View File

@ -50,7 +50,7 @@ func initDataAccess() *mongo.Client {
fmt.Println(err)
log.Msg.Fatal("Error connecting to database: " + err.Error())
} else {
log.Msg.Info("Connected to Database")
log.Msg.Info("Database connection successful")
}
return client
}

View File

@ -23,6 +23,6 @@ func getRuntime() string {
if runtimeEnv == "" {
runtimeEnv = "unknown"
}
log.Msg.Info(fmt.Sprintf("Runtime mode: %s", runtimeEnv))
log.Msg.Debug(fmt.Sprintf("Runtime mode: %s", runtimeEnv))
return runtimeEnv
}

View File

@ -20,6 +20,7 @@ func getCredentials() nrodCredential {
if nrod_user == "" || nrod_pass == "" {
log.Msg.Fatal("No NROD Credentials provided")
}
log.Msg.Debug("NROD Credentials loaded for user: " + nrod_user)
return nrodCredential{
user: nrod_user,
pass: nrod_pass,
@ -38,7 +39,8 @@ func dial() *stomp.Conn {
if err != nil {
log.Msg.Fatal("Unable to connect to STOMP Client", zap.String("err", err.Error()))
}
defer disconnect(conn)
//defer disconnect(conn) // This exits as soon as the function has returned
log.Msg.Info("Initialised STOMP Client")
return conn
}

View File

@ -22,5 +22,6 @@ func Listen() {
}
func handle(msg *stomp.Message) {
log.Msg.Info("STOMP message received")
fmt.Println(msg)
}