From 10b40e2652a9065a699381c2883f676dd4af58e4 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 23 Jul 2013 16:28:26 +0200 Subject: [PATCH] StorDb defaults to MYSQL --- cmd/cgr-loader/cgr-loader.go | 12 ++++++------ config/config.go | 10 +++++----- config/config_test.go | 10 +++++----- data/conf/cgrates.cfg | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmd/cgr-loader/cgr-loader.go b/cmd/cgr-loader/cgr-loader.go index 622b03fb0..77989b201 100644 --- a/cmd/cgr-loader/cgr-loader.go +++ b/cmd/cgr-loader/cgr-loader.go @@ -39,12 +39,12 @@ var ( data_db_user = flag.String("datadb_user", cgrConfig.DataDBUser, "The dataDb user to sign in as.") data_db_pass = flag.String("datadb_passwd", cgrConfig.DataDBPass, "The dataDb user's password.") - stor_db_type = flag.String("logdb_type", cgrConfig.StorDBType, "The type of the storDb database (redis|mongo|postgres|mysql)") - stor_db_host = flag.String("logdb_host", cgrConfig.StorDBHost, "The storDb host to connect to.") - stor_db_port = flag.String("logdb_port", cgrConfig.StorDBPort, "The storDb port to bind to.") - stor_db_name = flag.String("logdb_name", cgrConfig.StorDBName, "The name/number of the storDb to connect to.") - stor_db_user = flag.String("logdb_user", cgrConfig.StorDBUser, "The storDb user to sign in as.") - stor_db_pass = flag.String("logdb_passwd", cgrConfig.StorDBPass, "The storDb user's password.") + stor_db_type = flag.String("stordb_type", cgrConfig.StorDBType, "The type of the storDb database (redis|mongo|postgres|mysql)") + stor_db_host = flag.String("stordb_host", cgrConfig.StorDBHost, "The storDb host to connect to.") + stor_db_port = flag.String("stordb_port", cgrConfig.StorDBPort, "The storDb port to bind to.") + stor_db_name = flag.String("stordb_name", cgrConfig.StorDBName, "The name/number of the storDb to connect to.") + stor_db_user = flag.String("stordb_user", cgrConfig.StorDBUser, "The storDb user to sign in as.") + stor_db_pass = flag.String("stordb_passwd", cgrConfig.StorDBPass, "The storDb user's password.") flush = flag.Bool("flush", false, "Flush the database before importing") tpid = flag.String("tpid", "", "The tariff plan id from the database") diff --git a/config/config.go b/config/config.go index 2c2ffab13..6368b7b85 100644 --- a/config/config.go +++ b/config/config.go @@ -106,13 +106,13 @@ func ( self *CGRConfig ) setDefaults() error { self.DataDBName = "10" self.DataDBUser = "" self.DataDBPass = "" - self.StorDBType = MONGO + self.StorDBType = utils.MYSQL self.StorDBHost = "localhost" - self.StorDBPort = "27017" + self.StorDBPort = "3306" self.StorDBName = "cgrates" - self.StorDBUser = "" - self.StorDBPass = "" - self.RPCEncoding = GOB + self.StorDBUser = "cgrates" + self.StorDBPass = "CGRateS.org" + self.RPCEncoding = JSON self.DefaultReqType = "rated" self.DefaultTOR = "0" self.DefaultTenant = "0" diff --git a/config/config_test.go b/config/config_test.go index fc11402d7..00a6d37ce 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -40,13 +40,13 @@ func TestDefaults(t *testing.T) { eCfg.DataDBName = "10" eCfg.DataDBUser = "" eCfg.DataDBPass = "" - eCfg.StorDBType = MONGO + eCfg.StorDBType = utils.MYSQL eCfg.StorDBHost = "localhost" - eCfg.StorDBPort = "27017" + eCfg.StorDBPort = "3306" eCfg.StorDBName = "cgrates" - eCfg.StorDBUser = "" - eCfg.StorDBPass = "" - eCfg.RPCEncoding = GOB + eCfg.StorDBUser = "cgrates" + eCfg.StorDBPass = "CGRateS.org" + eCfg.RPCEncoding = JSON eCfg.DefaultReqType = RATED eCfg.DefaultTOR = "0" eCfg.DefaultTenant = "0" diff --git a/data/conf/cgrates.cfg b/data/conf/cgrates.cfg index 5147df14d..ace34ff03 100644 --- a/data/conf/cgrates.cfg +++ b/data/conf/cgrates.cfg @@ -11,13 +11,13 @@ # datadb_name = 10 # The name of the database to connect to. # datadb_user = # Username to use when connecting to database. # datadb_passwd = # Password to use when connecting to database. -# stordb_type = mongo # Log/stored database type to use: +# stordb_type = mysql # Log/stored database type to use: # stordb_host = 127.0.0.1 # The host to connect to. Values that start with / are for UNIX domain sockets. -# stordb_port = 27017 # The port to reach the logdb. +# stordb_port = 3306 # The port to reach the logdb. # stordb_name = cgrates # The name of the log database to connect to. -# stordb_user = # Username to use when connecting to logdb. -# stordb_passwd = # Password to use when connecting to logdb. -# rpc_encoding = gob # RPC encoding used on APIs: . +# stordb_user = cgrates # Username to use when connecting to stordb. +# stordb_passwd = CGRateS.org # Password to use when connecting to stordb. +# rpc_encoding = json # RPC encoding used on APIs: . # default_reqtype = rated # Default request type to consider when missing from requests: <""|prepaid|postpaid|pseudoprepaid|rated>. # default_tor = 0 # Default Type of Record to consider when missing from requests. # default_tenant = 0 # Default Tenant to consider when missing from requests.