Commit Graph

115 Commits

Author SHA1 Message Date
ionutboangiu
0dfe689d8e Add postgres stor_db SSL opts 2024-11-03 13:19:45 +01:00
ionutboangiu
e0c05ecfa7 Add redis pipeline window and limit cfg opts
Set redisPoolPipelineWindow to control duration before pipeline
flush (0 disables implicit pipelining) and redisPoolPipelineLimit
for max commands per pipeline (0 means no limit, only time window
applies).
2024-10-29 18:54:51 +01:00
ionutboangiu
0063ef3822 Add support for mongodb+srv conn format
Option can be found in db opts under the name 'mongoConnScheme'.
2024-09-05 20:46:40 +02:00
ionutboangiu
d29f84169c Move cdrs to its own package
Moved engine/cdr.go to utils/cdr.go.
Moved engine/cdrs.go and engine/cdrs_test.go to cdrs package.
Moved api functions from cdrs/cdrs.go to cdrs/apis.go. Same for the
tests.
Deleted CDRsV1 type and its methods.
2023-12-12 10:09:18 +01:00
ionutboangiu
f0852b645b Rename composeURI func to composeMongoURI
To reflect that it's used exclusively for MongoDB (for now at least).

Also added a descriptive comment to the function.
2023-12-07 16:56:08 +01:00
ionutboangiu
8909786a4b Revise buildURL function
Renamed to composeURI.

Use simple string concatenation to build URI because there is
no need to keep the Parse call as a validation step. Any issue
would be caught when establishing a connection.
2023-12-07 16:56:08 +01:00
ionutboangiu
26cdb571b8 Upgrade MongoDB driver to 1.13
- Set (but comment) serverAPI options (currently distinct api and
create.size BSON field are deprecated + possible others that are untested)
- Remove the custom time decoder used for mongo BSON
datetime values. The custom decoder was only converting these values
into UTC and was not any different from the default time.Time
decoder in the MongoDB driver, which also handles BSON string, int64,
and document values.
- Implement 'buildURL' function to connect to mongo (can also be
used for mysql and postgres)
- Update function names, variable names, and comments for clarity
- Replace 'bsonx.Regex' with the Regex primitive (deprecated since 1.12).
- Use simple concatenation instead of Sprintf
- Declare 'decimalType' locally, replace global 'decimalType'
- Simplify several functions without altering functionality
- Converting directly from a D to an M is deprecated. We are now decoding
  directly in a M.
- Used errors.As and errors.Is for proper error comparison and assertion
- Revised sloppy reassignments and added missing error checks
2023-11-14 18:24:21 +01:00
ionutboangiu
df1dc5e838 Add StorDB service
Add StorDB to config and services.

Put back the store_cdrs option under cdrs and update the CDRs
service to depend on StorDB.

Define the StorDB interface and add a constructor for it.

Add a constructor for postgres storage.

Add a config sanity check to validate SSL modes for postgres.

Update cgr-engine to consider StorDB on startup.
2023-05-03 10:05:28 +02:00
gezimbll
04d05c3a4f replacing non-meta constants for storage types 2023-03-08 19:13:48 +01:00
ionutboangiu
d9f567b0a3 Rename RedisMaxAttempts to RedisConnectionAttempts 2022-07-14 14:59:28 +02:00
ionutboangiu
81793af5de Make hardcoded options configurable for redis and solve compilation errors 2022-07-07 18:05:14 +02:00
ionutboangiu
523045cc12 Add timeout options for redis and solve compilation errors 2022-07-03 13:08:52 +02:00
andronache98
ecdf5e54ea Changed headers 2022-03-09 14:14:30 +01:00
andronache98
9ec56f5155 Changed headers 2022-03-09 14:14:30 +01:00
andronache98
03793c0082 Removed storDB from config 2022-03-09 14:14:30 +01:00
ionutboangiu
a927220fdb Rename ItemOpt structs to ItemOpts and repair its diff function 2022-01-14 18:15:59 +01:00
porosnicuadrian
5912e6aacf Added DSNopts for stor_db 2022-01-12 12:37:57 +01:00
Trial97
cb809f976e Updated internal datadb 2021-10-28 18:03:43 +03:00
ionutboangiu
e340c43ccd Fix compilation errors (incomplete) 2021-10-08 18:24:16 +03:00
ionutboangiu
c48aa5d4ad Change datadb cfg opts constant names 2021-10-08 18:24:16 +03:00
Trial97
6bff7dfb9b Updated Redis storage 2021-10-08 11:12:50 +03:00
andronache
e40ee259c0 Renamed opts for DataDB and StorDB 2021-05-07 10:51:16 +02:00
Trial97
c04c0a5adb Added ConfigDB and option to read config from DB 2021-04-16 17:53:36 +02:00
ionutboangiu
a19093e95b Remove unused variables and functions in engine 2021-04-02 14:57:32 +02:00
nickolasdaniel
62f435bdae Removing unused variables in utils/consts.go 2021-04-02 13:42:52 +02:00
Trial97
48205d689d Removed until build 2021-03-30 20:49:53 +02:00
Trial97
c13a5cf790 Finished implementing the DataNode as a replacement 2021-03-26 13:46:25 +01:00
andronache
0d36b0cecf Changed Opts in structs in apier to APIOpts 2021-03-23 14:35:11 +01:00
andronache
806c8295be Finished changing Opts to APIOpts for structs used in api_interfaces 2021-03-23 14:35:11 +01:00
Trial97
f2c9ca3530 Fixed typo in license header 2021-03-10 16:22:37 +01:00
Trial97
6aa28fc9f5 Added MySQL Location as an option for storDB 2021-02-26 17:23:53 +01:00
andronache
4ff3b9242d Consts in utils 2021-01-07 18:15:35 +01:00
andronache
dbb9216b6e Modified consts in utils 2021-01-07 18:15:35 +01:00
andronache
570356b459 Changed consts in utils and repaired account profiles it testin apier/v1 2021-01-07 18:15:35 +01:00
TeoV
f1c823761b [DataDB] Add support for redis with TLS connection ( + integration test ) fixes #2435 2020-10-15 18:34:21 +02:00
TeoV
21120eb9b6 Add "redis_" prefix to "dataDB" option for redis 2020-10-15 12:42:28 +02:00
Trial97
6eb4be05c2 Updated mongoDB driver constructor 2020-09-04 12:32:09 +02:00
Trial97
4fe3b8e257 Removed TenantArg 2020-09-04 12:32:09 +02:00
Trial97
841264a97a Moved all specific DB options in opts 2020-08-28 14:35:42 +02:00
Trial97
c1a96d21a4 Added support for Redis cluster 2020-08-07 09:27:02 +02:00
Trial97
cfebb0d616 Finished upgrading the Redis driver 2020-08-07 09:27:02 +02:00
Trial97
11dac21b88 Starting replacing ArgDispatcher with Opts 2020-07-30 11:17:57 +02:00
TeoV
c7b7740c27 Add support for Mongo for different Marshaler 2020-03-02 10:10:57 +01:00
TeoV
35d19ab4b2 Add TTL option for DataDB/StorDB for type *internal 2020-01-14 08:42:10 -05:00
Trial97
28cc543389 Updated NewInternalDB 2019-12-02 11:07:48 +02:00
DanB
33483edc93 Modified NewInternalDB signature to include encoding, renamed MetaJSONRpc -> MetaJSON 2019-11-29 20:54:32 +01:00
Trial97
f6bbccb213 Remove redundant functions 2019-11-09 15:55:49 +01:00
TeoV
722f74f652 Update integration tests 2019-10-30 14:43:10 +01:00
Trial97
8d655d8b57 Added sslmode for storDB config. Fixes#1715 2019-10-28 18:00:32 +01:00
Trial97
61fc8c98a3 Added DataManager as Service 2019-10-28 12:17:15 +01:00