Partial success
This commit is contained in:
parent
99756041bc
commit
efcce8a632
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -22,5 +22,6 @@ func Listen() {
|
||||
}
|
||||
|
||||
func handle(msg *stomp.Message) {
|
||||
log.Msg.Info("STOMP message received")
|
||||
fmt.Println(msg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user