mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-26 06:37:01 +02:00
Removed GetMySQLDbConnectionDetails()
This commit is contained in:
+1
-21
@@ -76,25 +76,6 @@ func DeleteEmptySlices(s []string) []string {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMySQLDbConnectionDetails : Returns the necessary string as connection info for SQL.db()
|
|
||||||
func GetMySQLDbConnectionDetails() string {
|
|
||||||
|
|
||||||
var apiEnv map[string]string
|
|
||||||
apiEnv, err := godotenv.Read(GetPath("apiEnvFileLocation"))
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal("Error loading .env file")
|
|
||||||
}
|
|
||||||
|
|
||||||
Dbhost := "127.0.0.1:" + apiEnv["HOST_MACHINE_MYSQL_PORT"]
|
|
||||||
Dbname := apiEnv["MYSQL_DATABASE"]
|
|
||||||
Dbuser := apiEnv["MYSQL_USER"]
|
|
||||||
Dbpass := apiEnv["MYSQL_PASSWORD"]
|
|
||||||
|
|
||||||
return Dbuser + ":" + Dbpass + "@tcp(" + Dbhost + ")/" + Dbname
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSQLiteDbConnectionDetails : Returns the necessary string as connection info for SQL.db()
|
// GetSQLiteDbConnectionDetails : Returns the necessary string as connection info for SQL.db()
|
||||||
func GetSQLiteDbConnectionDetails() string {
|
func GetSQLiteDbConnectionDetails() string {
|
||||||
|
|
||||||
@@ -127,8 +108,7 @@ func GetPath(pathKey string) string {
|
|||||||
targetPath := ""
|
targetPath := ""
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// log.Println("Project .env file not found withing project root. Using only hardcoded path variables.")
|
fmt.Println("Project .env file not found withing project root. Using only hardcoded path variables.")
|
||||||
// Do Nothing...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch pathKey {
|
switch pathKey {
|
||||||
|
|||||||
Reference in New Issue
Block a user