test loading secret key
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-12-27 17:29:02 +11:00
parent ca316e7086
commit 9203e09d2d
5 changed files with 39 additions and 3 deletions

View File

@@ -15,6 +15,7 @@ import (
)
var db *sqlx.DB
var secretKey string
const (
sqlFile = "smt.db"
@@ -80,6 +81,11 @@ func ConnectDatabase() {
//defer db.Close()
}
func LoadSecretKey(key string) {
// Store the secret key so that we can access it when encrypting/decrypting
secretKey = key
}
func DisconnectDatabase() {
log.Printf("DisconnectDatabase called")
defer db.Close()