Skip to content
Snippets Groups Projects

WS-702 Added yaml and sh scripts to build go modules via CI

Merged Nathan Bockisch requested to merge WS-702 into main
1 unresolved thread
Files
8
/*
* Copyright (C) 2022 Associated Universities, Inc. Washington DC, USA.
*
* This file is part of NRAO Workspaces.
*
* Workspaces is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Workspaces is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
*/
package db
import (
"github.com/magiconair/properties"
)
type DbInfo struct {
Host string
Port int
User string
Password string
Dbname string
Property_path string
Is_ssl bool
}
/**
* Pull the login information for the database from a properties file
*
* @param db_info a DbInfo type with information to connect to the database
* @return a DbInfo type holding db_info's data with the User and Password
* fields populated
**/
func getDbLoginFromProperties(db_info DbInfo) DbInfo {
prop := properties.MustLoadFile(db_info.Property_path, properties.UTF8)
db_info.User = prop.GetString("metadataDatabase.jdbcUsername", "archive")
db_info.Password = prop.GetString("metadataDatabase.jdbcPassword", "docker")
return db_info
}
Loading