Files
cgrates/config/migratorcfg.go

81 lines
2.3 KiB
Go

/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>
*/
package config
type MigratorCgrCfg struct {
OutDataDBType string
OutDataDBHost string
OutDataDBPort string
OutDataDBName string
OutDataDBUser string
OutDataDBPassword string
OutDataDBEncoding string
OutStorDBType string
OutStorDBHost string
OutStorDBPort string
OutStorDBName string
OutStorDBUser string
OutStorDBPassword string
}
func (mg *MigratorCgrCfg) loadFromJsonCfg(jsnCfg *MigratorCfgJson) (err error) {
if jsnCfg.Out_dataDB_type != nil {
mg.OutDataDBType = *jsnCfg.Out_dataDB_type
}
if jsnCfg.Out_dataDB_host != nil {
mg.OutDataDBHost = *jsnCfg.Out_dataDB_host
}
if jsnCfg.Out_dataDB_port != nil {
mg.OutDataDBPort = *jsnCfg.Out_dataDB_port
}
if jsnCfg.Out_dataDB_name != nil {
mg.OutDataDBName = *jsnCfg.Out_dataDB_name
}
if jsnCfg.Out_dataDB_user != nil {
mg.OutDataDBUser = *jsnCfg.Out_dataDB_user
}
if jsnCfg.Out_dataDB_password != nil {
mg.OutDataDBPassword = *jsnCfg.Out_dataDB_password
}
if jsnCfg.Out_dataDB_encoding != nil {
mg.OutDataDBEncoding = *jsnCfg.Out_dataDB_encoding
}
if jsnCfg.Out_storDB_type != nil {
mg.OutStorDBType = *jsnCfg.Out_storDB_type
}
if jsnCfg.Out_storDB_host != nil {
mg.OutStorDBHost = *jsnCfg.Out_storDB_host
}
if jsnCfg.Out_storDB_port != nil {
mg.OutStorDBPort = *jsnCfg.Out_storDB_port
}
if jsnCfg.Out_storDB_name != nil {
mg.OutStorDBName = *jsnCfg.Out_storDB_name
}
if jsnCfg.Out_storDB_user != nil {
mg.OutStorDBUser = *jsnCfg.Out_storDB_user
}
if jsnCfg.Out_storDB_password != nil {
mg.OutStorDBPassword = *jsnCfg.Out_storDB_password
}
return nil
}