Renamed opts for DataDB and StorDB

This commit is contained in:
andronache
2021-05-05 17:41:11 +03:00
committed by Dan Christian Bogos
parent 0089659476
commit bc4979b74a
27 changed files with 150 additions and 149 deletions

View File

@@ -114,12 +114,12 @@ const CGRATES_CFG_JSON = `
"redisSentinel": "", // the name of sentinel when used
"redisCluster": false, // if enabled the datadb will try to connect to the redis cluster
"redisClusterSync": "5s", // the sync interval for the redis cluster
"redisClusterOndownDelay": "0", // the delay before executing the commands if the redis cluster is in the CLUSTERDOWN state
"query_timeout":"10s",
"redis_tls": false, // if true it will use a tls connection and use the redis_client_certificate certificate, redis_client_key and redis_ca_certificate for tls connection
"redis_client_certificate":"", // path to client certificate
"redis_client_key":"", // path to client key
"redis_ca_certificate":"", // path to CA certificate (populate for self-signed certificate otherwise let it empty)
"redisClusterOndownDelay": "0", // the delay before executing the commands if the redis cluster is in the CLUSTERDOWN state
"mongoQueryTimeout":"10s",
"redisTLS": false, // if true it will use a tls connection and use the redisClientCertificate, redisClientKey and redisCACertificate for tls connection
"redisClientCertificate":"", // path to client certificate
"redisClientKey":"", // path to client key
"redisCACertificate":"", // path to CA certificate (populate for self-signed certificate otherwise let it empty)
}
},
@@ -134,12 +134,12 @@ const CGRATES_CFG_JSON = `
"string_indexed_fields": [], // indexes on cdrs table to speed up queries, used in case of *mongo and *internal
"prefix_indexed_fields":[], // prefix indexes on cdrs table to speed up queries, used in case of *internal
"opts": {
"max_open_conns": 100, // maximum database connections opened, not applying for mongo
"max_idle_conns": 10, // maximum database connections idle, not applying for mongo
"conn_max_lifetime": 0, // maximum amount of time in seconds a connection may be reused (0 for unlimited), not applying for mongo
"query_timeout":"10s",
"sqlMaxOpenConns": 100, // maximum database connections opened, not applying for mongo
"sqlMaxIdleConns": 10, // maximum database connections idle, not applying for mongo
"sqlConnMaxLifetime": 0, // maximum amount of time in seconds a connection may be reused (0 for unlimited), not applying for mongo
"mongoQueryTimeout":"10s",
"sslmode":"disable", // sslmode in case of *postgres
"mysql_location": "Local", // the location the time from mysql is retrived
"mysqlLocation": "Local", // the location the time from mysql is retrived
},
"items":{
"*session_costs": {"remote":false, "replicate":false},
@@ -396,7 +396,7 @@ const CGRATES_CFG_JSON = `
// SQL
// "dbName": "cgrates", // the name of the database from were the events are read
// "tableName": "cdrs", // the name of the table from were the events are read
// "sslmode": "disable", // the ssl mode for postgres db
// "sslmode": "disable", // the ssl mode for postgres db
// "dbNameProcessed": "", // the name of the database were the events are sent after they are processed
// "tableNameProcessed": "", // the name of the table were the events are sent after they are processed
@@ -909,10 +909,10 @@ const CGRATES_CFG_JSON = `
"redisCluster": false,
"redisClusterSync": "5s",
"redisClusterOndownDelay": "0",
"redis_tls": false, // enable TLS when connecting to Redis and use the redis_client_certificate, redis_client_key and redis_ca_certificate for TLS connection
"redis_client_certificate":"", // path to client certificate
"redis_client_key":"", // path to client key
"redis_ca_certificate":"", // path to CA certificate (populate for self-signed certificate otherwise let it empty)
"redisTLS": false, // enable TLS when connecting to Redis and use the redisClientCertificate, redisClientKey and redisCACertificate for TLS connection
"redisClientCertificate":"", // path to client certificate
"redisClientKey":"", // path to client key
"redisCACertificate":"", // path to CA certificate (populate for self-signed certificate otherwise let it empty)
},
"out_stordb_opts":{},
},

View File

@@ -348,7 +348,7 @@ func TestDfDataDbJsonCfg(t *testing.T) {
Replication_cache: utils.StringPointer(""),
Opts: map[string]interface{}{
utils.RedisSentinelNameCfg: "",
utils.QueryTimeoutCfg: "10s",
utils.MongoQueryTimeoutCfg: "10s",
utils.RedisClusterCfg: false,
utils.RedisClusterOnDownDelayCfg: "0",
utils.RedisClusterSyncCfg: "5s",
@@ -482,12 +482,12 @@ func TestDfStorDBJsonCfg(t *testing.T) {
String_indexed_fields: &[]string{},
Prefix_indexed_fields: &[]string{},
Opts: map[string]interface{}{
utils.QueryTimeoutCfg: "10s",
utils.MaxOpenConnsCfg: 100.,
utils.MaxIdleConnsCfg: 10.,
utils.ConnMaxLifetimeCfg: 0.,
utils.SSLModeCfg: utils.PostgressSSLModeDisable,
utils.MysqlLocation: "Local",
utils.MongoQueryTimeoutCfg: "10s",
utils.SQLMaxOpenConnsCfg: 100.,
utils.SQLMaxIdleConnsCfg: 10.,
utils.SQLConnMaxLifetimeCfg: 0.,
utils.SSLModeCfg: utils.PostgressSSLModeDisable,
utils.MysqlLocation: "Local",
},
Items: &map[string]*ItemOptJson{
utils.CacheTBLTPTimings: {

File diff suppressed because one or more lines are too long

View File

@@ -477,7 +477,7 @@ func TestDataDbCfgAsMapInterface(t *testing.T) {
"db_password": "",
"opts": {
"redisSentinel":"",
"query_timeout":"10s",
"mongoQueryTimeout":"10s",
},
"remote_conns":[],
"replication_conns":[],
@@ -496,7 +496,7 @@ func TestDataDbCfgAsMapInterface(t *testing.T) {
utils.DataDbPassCfg: "",
utils.OptsCfg: map[string]interface{}{
utils.RedisSentinelNameCfg: "",
utils.QueryTimeoutCfg: "10s",
utils.MongoQueryTimeoutCfg: "10s",
},
utils.RemoteConnsCfg: []string{},
utils.ReplicationConnsCfg: []string{},

View File

@@ -47,10 +47,10 @@ func TestStoreDbCfgloadFromJsonCfgCase1(t *testing.T) {
},
},
Opts: map[string]interface{}{
utils.MaxOpenConnsCfg: 100.,
utils.MaxIdleConnsCfg: 10.,
utils.ConnMaxLifetimeCfg: 0.,
utils.MysqlLocation: "UTC",
utils.SQLMaxOpenConnsCfg: 100.,
utils.SQLMaxIdleConnsCfg: 10.,
utils.SQLConnMaxLifetimeCfg: 0.,
utils.MysqlLocation: "UTC",
},
}
expected := &StorDbCfg{
@@ -75,12 +75,12 @@ func TestStoreDbCfgloadFromJsonCfgCase1(t *testing.T) {
},
},
Opts: map[string]interface{}{
utils.MaxOpenConnsCfg: 100.,
utils.MaxIdleConnsCfg: 10.,
utils.ConnMaxLifetimeCfg: 0.,
utils.QueryTimeoutCfg: "10s",
utils.SSLModeCfg: "disable",
utils.MysqlLocation: "UTC",
utils.SQLMaxOpenConnsCfg: 100.,
utils.SQLMaxIdleConnsCfg: 10.,
utils.SQLConnMaxLifetimeCfg: 0.,
utils.MongoQueryTimeoutCfg: "10s",
utils.SSLModeCfg: "disable",
utils.MysqlLocation: "UTC",
},
}
jsonCfg := NewDefaultCGRConfig()
@@ -205,12 +205,12 @@ func TestStorDbCfgAsMapInterface(t *testing.T) {
"remote_conns": ["*conn1"],
"replication_conns": ["*conn1"],
"opts": {
"max_open_conns": 100,
"max_idle_conns": 10,
"conn_max_lifetime": 0,
"query_timeout":"10s",
"sqlMaxOpenConns": 100,
"sqlMaxIdleConns": 10,
"sqlConnMaxLifetime": 0,
"mongoQueryTimeout":"10s",
"sslmode":"disable",
"mysql_location": "UTC",
"mysqlLocation": "UTC",
},
"items":{
"session_costs": {},
@@ -231,12 +231,12 @@ func TestStorDbCfgAsMapInterface(t *testing.T) {
utils.RemoteConnsCfg: []string{"*conn1"},
utils.ReplicationConnsCfg: []string{"*conn1"},
utils.OptsCfg: map[string]interface{}{
utils.MaxOpenConnsCfg: 100.,
utils.MaxIdleConnsCfg: 10.,
utils.ConnMaxLifetimeCfg: 0.,
utils.QueryTimeoutCfg: "10s",
utils.SSLModeCfg: "disable",
utils.MysqlLocation: "UTC",
utils.SQLMaxOpenConnsCfg: 100.,
utils.SQLMaxIdleConnsCfg: 10.,
utils.SQLConnMaxLifetimeCfg: 0.,
utils.MongoQueryTimeoutCfg: "10s",
utils.SSLModeCfg: "disable",
utils.MysqlLocation: "UTC",
},
utils.ItemsCfg: map[string]interface{}{
utils.SessionCostsTBL: map[string]interface{}{utils.RemoteCfg: false, utils.ReplicateCfg: false},
@@ -286,11 +286,11 @@ func TestStorDbCfgClone(t *testing.T) {
},
},
Opts: map[string]interface{}{
utils.MaxOpenConnsCfg: 100.,
utils.MaxIdleConnsCfg: 10.,
utils.ConnMaxLifetimeCfg: 0.,
utils.QueryTimeoutCfg: "10s",
utils.SSLModeCfg: "disable",
utils.SQLMaxOpenConnsCfg: 100.,
utils.SQLMaxIdleConnsCfg: 10.,
utils.SQLConnMaxLifetimeCfg: 0.,
utils.MongoQueryTimeoutCfg: "10s",
utils.SSLModeCfg: "disable",
},
}
rcv := ban.Clone()