Skip to content

Commit

Permalink
Rename mongoScheme opt to mongoConnScheme
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutboangiu authored and danbogos committed Dec 12, 2023
1 parent 24cbe49 commit 17fbc2d
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 58 deletions.
6 changes: 3 additions & 3 deletions cmd/cgr-loader/cgr-loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var (
"The amount of wait time until timeout for writing operations")
dbQueryTimeout = cgrLoaderFlags.Duration(utils.MongoQueryTimeoutCfg, dfltCfg.DataDbCfg().Opts.MongoQueryTimeout,
"The timeout for queries")
dbMongoScheme = cgrLoaderFlags.String(utils.MongoSchemeCfg, dfltCfg.DataDbCfg().Opts.MongoScheme,
dbMongoConnScheme = cgrLoaderFlags.String(utils.MongoConnSchemeCfg, dfltCfg.DataDbCfg().Opts.MongoConnScheme,
"Scheme for MongoDB connection <mongodb|mongodb+srv>")
dbRedisTls = cgrLoaderFlags.Bool(utils.RedisTLS, false, "Enable TLS when connecting to Redis")
dbRedisClientCertificate = cgrLoaderFlags.String(utils.RedisClientCertificate, utils.EmptyString, "Path to the client certificate")
Expand Down Expand Up @@ -189,8 +189,8 @@ func loadConfig() (ldrCfg *config.CGRConfig) {
if *dbQueryTimeout != dfltCfg.DataDbCfg().Opts.MongoQueryTimeout {
ldrCfg.DataDbCfg().Opts.MongoQueryTimeout = *dbQueryTimeout
}
if *dbMongoScheme != dfltCfg.DataDbCfg().Opts.MongoScheme {
ldrCfg.DataDbCfg().Opts.MongoScheme = *dbMongoScheme
if *dbMongoConnScheme != dfltCfg.DataDbCfg().Opts.MongoConnScheme {
ldrCfg.DataDbCfg().Opts.MongoConnScheme = *dbMongoConnScheme
}
if *dbRedisTls != dfltCfg.DataDbCfg().Opts.RedisTLS {
ldrCfg.DataDbCfg().Opts.RedisTLS = *dbRedisTls
Expand Down
2 changes: 1 addition & 1 deletion cmd/cgr-loader/cgr-loader_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestLoadConfig(t *testing.T) {
RedisClusterOndownDelay: 0,
RedisConnectTimeout: 5 * time.Second,
MongoQueryTimeout: 10 * time.Second,
MongoScheme: "mongodb",
MongoConnScheme: "mongodb",
RedisTLS: false,
},
RmtConns: []string{},
Expand Down
6 changes: 3 additions & 3 deletions cmd/cgr-migrator/cgr-migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var (
"The amount of wait time until timeout for writing operations")
dbQueryTimeout = cgrMigratorFlags.Duration(utils.MongoQueryTimeoutCfg, dfltCfg.DataDbCfg().Opts.MongoQueryTimeout,
"The timeout for queries")
dbMongoScheme = cgrMigratorFlags.String(utils.MongoSchemeCfg, dfltCfg.DataDbCfg().Opts.MongoScheme,
dbMongoConnScheme = cgrMigratorFlags.String(utils.MongoConnSchemeCfg, dfltCfg.DataDbCfg().Opts.MongoConnScheme,
"Scheme for MongoDB connection <mongodb|mongodb+srv>")
dbRedisTls = cgrMigratorFlags.Bool(utils.RedisTLS, false, "Enable TLS when connecting to Redis")
dbRedisClientCertificate = cgrMigratorFlags.String(utils.RedisClientCertificate, utils.EmptyString, "Path to the client certificate")
Expand Down Expand Up @@ -211,8 +211,8 @@ func main() {
if *dbQueryTimeout != dfltCfg.DataDbCfg().Opts.MongoQueryTimeout {
mgrCfg.DataDbCfg().Opts.MongoQueryTimeout = *dbQueryTimeout
}
if *dbMongoScheme != dfltCfg.DataDbCfg().Opts.MongoScheme {
mgrCfg.DataDbCfg().Opts.MongoScheme = *dbMongoScheme
if *dbMongoConnScheme != dfltCfg.DataDbCfg().Opts.MongoConnScheme {
mgrCfg.DataDbCfg().Opts.MongoConnScheme = *dbMongoConnScheme
}
if *dbRedisTls != dfltCfg.DataDbCfg().Opts.RedisTLS {
mgrCfg.DataDbCfg().Opts.RedisTLS = *dbRedisTls
Expand Down
6 changes: 3 additions & 3 deletions cmd/cgr-tester/cgr-tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var (
"The amount of wait time until timeout for reading operations")
dbRedisWriteTimeout = cgrTesterFlags.Duration(utils.RedisWriteTimeoutCfg, cgrConfig.DataDbCfg().Opts.RedisWriteTimeout,
"The amount of wait time until timeout for writing operations")
dbMongoScheme = cgrTesterFlags.String(utils.MongoSchemeCfg, cgrConfig.DataDbCfg().Opts.MongoScheme,
dbMongoConnScheme = cgrTesterFlags.String(utils.MongoConnSchemeCfg, cgrConfig.DataDbCfg().Opts.MongoConnScheme,
"Scheme for MongoDB connection <mongodb|mongodb+srv>")
raterAddress = cgrTesterFlags.String("rater_address", "", "Rater address for remote tests. Empty for internal rater.")
minUsage = cgrTesterFlags.Duration("min_usage", 1*time.Second, "Minimum usage a session can have")
Expand Down Expand Up @@ -301,8 +301,8 @@ func main() {
if *dbQueryTimeout != cgrConfig.DataDbCfg().Opts.MongoQueryTimeout {
tstCfg.DataDbCfg().Opts.MongoQueryTimeout = *dbQueryTimeout
}
if *dbMongoScheme != cgrConfig.DataDbCfg().Opts.MongoScheme {
tstCfg.DataDbCfg().Opts.MongoScheme = *dbMongoScheme
if *dbMongoConnScheme != cgrConfig.DataDbCfg().Opts.MongoConnScheme {
tstCfg.DataDbCfg().Opts.MongoConnScheme = *dbMongoConnScheme
}

if *cpuprofile != "" {
Expand Down
10 changes: 5 additions & 5 deletions config/config_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const CGRATES_CFG_JSON = `
"redisReadTimeout": "0", // the amount of wait time until timeout for reading operations
"redisWriteTimeout": "0", // the amount of wait time until timeout for writing operations
"mongoQueryTimeout":"10s", // timeout for query when mongo is used
"mongoScheme": "mongodb", // scheme for MongoDB connection <mongodb|mongodb+srv>
"mongoConnScheme": "mongodb", // scheme for MongoDB connection <mongodb|mongodb+srv>
"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
Expand All @@ -159,7 +159,7 @@ const CGRATES_CFG_JSON = `
"db_port": 3306, // the port to reach the stor_db
"db_name": "cgrates", // stor database name
"db_user": "cgrates", // username to use when connecting to stor_db
"db_password": "CGRateS.org", // password to use when connecting to stor_db
"db_password": "CGRateS.org", // password to use when connecting to stor_db
"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": {
Expand All @@ -168,7 +168,7 @@ const CGRATES_CFG_JSON = `
"sqlConnMaxLifetime": "0", // maximum amount of time a connection may be reused (0 for unlimited), not applying for mongo
"mysqlDSNParams": {}, // DSN extra paramss
"mongoQueryTimeout": "10s", // timeout for query when mongo is used
"mongoScheme": "mongodb", // scheme for MongoDB connection <mongodb|mongodb+srv>
"mongoConnScheme": "mongodb", // scheme for MongoDB connection <mongodb|mongodb+srv>
"pgSSLMode": "disable", // pgSSLMode in case of *postgres
"mysqlLocation": "Local", // the location the time from mysql is retrieved
},
Expand Down Expand Up @@ -1084,10 +1084,10 @@ const CGRATES_CFG_JSON = `
"redisClientCertificate":"", // path to client certificate
"redisClientKey":"", // path to client key
"redisCACertificate":"", // path to CA certificate (populate for self-signed certificate otherwise let it empty)
"mongoScheme": "mongodb", // scheme for MongoDB connection <mongodb|mongodb+srv>
"mongoConnScheme": "mongodb", // scheme for MongoDB connection <mongodb|mongodb+srv>
},
"out_stordb_opts":{
"mongoScheme": "mongodb" // scheme for MongoDB connection <mongodb|mongodb+srv>
"mongoConnScheme": "mongodb" // scheme for MongoDB connection <mongodb|mongodb+srv>
},
},
Expand Down
8 changes: 4 additions & 4 deletions config/config_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func TestDfDataDbJsonCfg(t *testing.T) {
RedisReadTimeout: utils.StringPointer("0"),
RedisWriteTimeout: utils.StringPointer("0"),
MongoQueryTimeout: utils.StringPointer("10s"),
MongoScheme: utils.StringPointer("mongodb"),
MongoConnScheme: utils.StringPointer("mongodb"),
RedisTLS: utils.BoolPointer(false),
RedisClientCertificate: utils.StringPointer(utils.EmptyString),
RedisClientKey: utils.StringPointer(utils.EmptyString),
Expand Down Expand Up @@ -555,7 +555,7 @@ func TestDfStorDBJsonCfg(t *testing.T) {
SQLMaxOpenConns: utils.IntPointer(100),
SQLMaxIdleConns: utils.IntPointer(10),
MongoQueryTimeout: utils.StringPointer("10s"),
MongoScheme: utils.StringPointer("mongodb"),
MongoConnScheme: utils.StringPointer("mongodb"),
SQLConnMaxLifetime: utils.StringPointer("0"),
MySQLDSNParams: make(map[string]string),
PgSSLMode: utils.StringPointer(utils.PostgresSSLModeDisable),
Expand Down Expand Up @@ -1894,7 +1894,7 @@ func TestDfMigratorCfg(t *testing.T) {
Out_storDB_password: utils.StringPointer(""),
Users_filters: &[]string{},
Out_storDB_opts: &DBOptsJson{
MongoScheme: utils.StringPointer("mongodb"),
MongoConnScheme: utils.StringPointer("mongodb"),
},
Out_dataDB_opts: &DBOptsJson{
RedisMaxConns: utils.IntPointer(10),
Expand All @@ -1910,7 +1910,7 @@ func TestDfMigratorCfg(t *testing.T) {
RedisClientCertificate: utils.StringPointer(utils.EmptyString),
RedisClientKey: utils.StringPointer(utils.EmptyString),
RedisCACertificate: utils.StringPointer(utils.EmptyString),
MongoScheme: utils.StringPointer("mongodb"),
MongoConnScheme: utils.StringPointer("mongodb"),
},
}
dfCgrJSONCfg, err := NewCgrJsonCfgFromBytes([]byte(CGRATES_CFG_JSON))
Expand Down

0 comments on commit 17fbc2d

Please sign in to comment.