From 05143d62d1d667eaa31e5147be233710f16fd9d6 Mon Sep 17 00:00:00 2001 From: TeoV Date: Fri, 11 Dec 2020 12:17:20 +0200 Subject: [PATCH] Rename in ERs from *json to *file_json to be consistent --- config/config.go | 2 +- config/configsanity.go | 2 +- data/conf/samples/ers_internal/cgrates.json | 2 +- data/conf/samples/ers_mongo/cgrates.json | 2 +- data/conf/samples/ers_mysql/cgrates.json | 2 +- data/conf/samples/ers_postgres/cgrates.json | 2 +- ers/reader.go | 2 +- utils/consts.go | 1 + 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index 784490a0d..8b382e909 100644 --- a/config/config.go +++ b/config/config.go @@ -341,7 +341,7 @@ var posibleLoaderTypes = utils.NewStringSet([]string{utils.MetaAttributes, var possibleReaderTypes = utils.NewStringSet([]string{utils.MetaFileCSV, utils.MetaKafkajsonMap, utils.MetaFileXML, utils.MetaSQL, utils.MetaFileFWV, - utils.MetaPartialCSV, utils.MetaFlatstore, utils.MetaJSON, utils.META_NONE}) + utils.MetaPartialCSV, utils.MetaFlatstore, utils.MetaFileJSON, utils.META_NONE}) var possibleExporterTypes = utils.NewStringSet([]string{utils.MetaFileCSV, utils.META_NONE, utils.MetaFileFWV, utils.MetaHTTPPost, utils.MetaHTTPjsonMap, utils.MetaAMQPjsonMap, utils.MetaAMQPV1jsonMap, utils.MetaSQSjsonMap, diff --git a/config/configsanity.go b/config/configsanity.go index fd234d7b3..bb00dac87 100644 --- a/config/configsanity.go +++ b/config/configsanity.go @@ -552,7 +552,7 @@ func (cfg *CGRConfig) checkConfigSanity() error { if rdr.RunDelay > 0 { return fmt.Errorf("<%s> the RunDelay field can not be bigger than zero for reader with ID: %s", utils.ERs, rdr.ID) } - case utils.MetaFileXML, utils.MetaFileFWV, utils.MetaJSON: + case utils.MetaFileXML, utils.MetaFileFWV, utils.MetaFileJSON: for _, dir := range []string{rdr.ProcessedPath, rdr.SourcePath} { if _, err := os.Stat(dir); err != nil && os.IsNotExist(err) { return fmt.Errorf("<%s> nonexistent folder: %s for reader with ID: %s", utils.ERs, dir, rdr.ID) diff --git a/data/conf/samples/ers_internal/cgrates.json b/data/conf/samples/ers_internal/cgrates.json index 518b846b7..b3b6c5ee9 100644 --- a/data/conf/samples/ers_internal/cgrates.json +++ b/data/conf/samples/ers_internal/cgrates.json @@ -354,7 +354,7 @@ { "id": "JSONReader", "run_delay": "-1", - "type": "*json", + "type": "*file_json", "source_path": "/tmp/ErsJSON/in", "flags": ["*cdrs"], "processed_path": "/tmp/ErsJSON/out", diff --git a/data/conf/samples/ers_mongo/cgrates.json b/data/conf/samples/ers_mongo/cgrates.json index 94561712b..be17b9612 100644 --- a/data/conf/samples/ers_mongo/cgrates.json +++ b/data/conf/samples/ers_mongo/cgrates.json @@ -355,7 +355,7 @@ { "id": "JSONReader", "run_delay": "-1", - "type": "*json", + "type": "*file_json", "source_path": "/tmp/ErsJSON/in", "flags": ["*cdrs"], "processed_path": "/tmp/ErsJSON/out", diff --git a/data/conf/samples/ers_mysql/cgrates.json b/data/conf/samples/ers_mysql/cgrates.json index c2bb6ecc3..6436b14cf 100644 --- a/data/conf/samples/ers_mysql/cgrates.json +++ b/data/conf/samples/ers_mysql/cgrates.json @@ -352,7 +352,7 @@ { "id": "JSONReader", "run_delay": "-1", - "type": "*json", + "type": "*file_json", "source_path": "/tmp/ErsJSON/in", "flags": ["*cdrs"], "processed_path": "/tmp/ErsJSON/out", diff --git a/data/conf/samples/ers_postgres/cgrates.json b/data/conf/samples/ers_postgres/cgrates.json index 9fc6c6a5f..a6cf46267 100644 --- a/data/conf/samples/ers_postgres/cgrates.json +++ b/data/conf/samples/ers_postgres/cgrates.json @@ -349,7 +349,7 @@ { "id": "JSONReader", "run_delay": "-1", - "type": "*json", + "type": "*file_json", "source_path": "/tmp/ErsJSON/in", "flags": ["*cdrs"], "processed_path": "/tmp/ErsJSON/out", diff --git a/ers/reader.go b/ers/reader.go index 3332a1be3..cdcf028cf 100644 --- a/ers/reader.go +++ b/ers/reader.go @@ -53,7 +53,7 @@ func NewEventReader(cfg *config.CGRConfig, cfgIdx int, return NewSQLEventReader(cfg, cfgIdx, rdrEvents, rdrErr, fltrS, rdrExit) case utils.MetaFlatstore: return NewFlatstoreER(cfg, cfgIdx, rdrEvents, rdrErr, fltrS, rdrExit) - case utils.MetaJSON: + case utils.MetaFileJSON: return NewJSONFileER(cfg, cfgIdx, rdrEvents, rdrErr, fltrS, rdrExit) case utils.MetaAMQPjsonMap: return NewAMQPER(cfg, cfgIdx, rdrEvents, rdrErr, fltrS, rdrExit) diff --git a/utils/consts.go b/utils/consts.go index 986bbae0b..5c8edf561 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -346,6 +346,7 @@ const ( ZERO_RATING_SUBJECT_PREFIX = "*zero" OK = "OK" MetaFileXML = "*file_xml" + MetaFileJSON = "*file_json" MASK_CHAR = "*" CONCATENATED_KEY_SEP = ":" UNIT_TEST = "UNIT_TEST"