From 7771de5e07de54e6278e4bd725b4734425bc195b Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Thu, 10 Nov 2022 16:11:10 +0200 Subject: [PATCH] Apply go fmt project wide --- agents/agentreq.go | 2 +- agents/kamevent.go | 4 +- agents/libdiam.go | 3 +- agents/librad.go | 2 +- analyzers/analyzers_it_test.go | 2 +- apier/v1/apier2_it_test.go | 2 +- apier/v1/attributes_it_test.go | 4 +- apier/v1/caps_it_test.go | 2 +- apier/v1/costs_it_test.go | 2 +- apier/v1/ees_it_test.go | 2 +- apier/v1/filter_indexes_it_test.go | 10 +- apier/v1/filterindexecache_it_test.go | 6 +- apier/v1/filters.go | 6 +- apier/v1/filters_it_test.go | 2 +- apier/v1/guardian_it_test.go | 2 +- apier/v1/rating_profile_late_it_test.go | 2 +- apier/v1/resourcesv1_it_test.go | 2 +- apier/v1/schedulers_it_test.go | 6 +- apier/v1/smgbirpc.go | 2 +- apier/v1/stats_it_test.go | 2 +- apier/v1/thresholds.go | 2 +- apier/v1/timing_it_test.go | 2 +- apier/v1/tp_it_test.go | 2 +- apier/v1/tpaccountactions_it_test.go | 2 +- apier/v1/tpactionplans_it_test.go | 2 +- apier/v1/tpactions_it_test.go | 2 +- apier/v1/tpactiontriggers_it_test.go | 2 +- apier/v1/tpattributes_it_test.go | 2 +- apier/v1/tpchargers_it_test.go | 2 +- apier/v1/tpdestinationrates_it_test.go | 2 +- apier/v1/tpdestinations_it_test.go | 2 +- apier/v1/tpdispatchers_it_test.go | 2 +- apier/v1/tpfilters_it_test.go | 2 +- apier/v1/tprates_it_test.go | 2 +- apier/v1/tpratingplans_it_test.go | 2 +- apier/v1/tpratingprofiles_it_test.go | 2 +- apier/v1/tpresources_it_test.go | 2 +- apier/v1/tproutes_it_test.go | 2 +- apier/v1/tpsharedgroups_it_test.go | 2 +- apier/v1/tpstats_it_test.go | 2 +- apier/v1/tpthresholds_it_test.go | 2 +- apier/v1/tptimings_it_test.go | 2 +- apier/v1/versions_it_test.go | 2 +- apier/v2/accounts_it_test.go | 2 +- apier/v2/attributes_it_test.go | 2 +- cmd/cgr-loader/cgr-loader_remove_it_test.go | 2 +- config/config.go | 2 +- config/rjreader.go | 10 +- cores/basic_auth.go | 6 +- cores/gob_codec_test.go | 2 +- dispatchers/attributes_it_test.go | 2 +- dispatchers/caches_it_test.go | 2 +- dispatchers/cdrs_it_test.go | 2 +- dispatchers/chargers_it_test.go | 2 +- dispatchers/config_it_test.go | 2 +- dispatchers/guardian_it_test.go | 2 +- dispatchers/rals_it_test.go | 2 +- dispatchers/replicator_it_test.go | 4 +- dispatchers/resources_it_test.go | 2 +- dispatchers/responder_it_test.go | 2 +- dispatchers/routes_it_test.go | 2 +- dispatchers/stats_it_test.go | 2 +- dispatchers/thresholds_it_test.go | 2 +- ees/ee_test.go | 6 +- engine/action_trigger.go | 2 +- engine/exportrequest.go | 2 +- engine/model_helpers.go | 2 +- engine/model_helpers_test.go | 12 +- engine/rateinterval.go | 2 +- engine/sharedgroup.go | 2 +- engine/storage_internal_stordb.go | 4 +- engine/storage_mongo_datadb.go | 2 +- engine/storage_mongo_stordb.go | 2 +- engine/timespans.go | 2 +- engine/z_resources_test.go | 8 +- engine/z_versions_it_test.go | 6 +- ers/sql_it_test.go | 20 +-- general_tests/accounts_it_test.go | 2 +- .../cacherpl_filter_update_it_test.go | 2 +- general_tests/cdrs_it_test.go | 4 +- general_tests/cgrloader_it_test.go | 2 +- general_tests/doubleremove_it_test.go | 2 +- general_tests/filtered_replication_it_test.go | 2 +- general_tests/gocs_it_test.go | 2 +- general_tests/libengine_it_test.go | 1 - general_tests/resourcesv1_it_test.go | 2 +- general_tests/rpcclient_it_test.go | 2 +- .../session_graceful_shutdown_it_test.go | 2 +- ...ion_replications_automaticdebit_it_test.go | 4 +- general_tests/tutorial2_it_test.go | 2 +- general_tests/tutorial_calls_test.go | 2 +- general_tests/tutorial_it_test.go | 2 +- loaders/loader.go | 8 +- migrator/load_ids.go | 1 - migrator/storage_map_datadb.go | 132 +++++++++--------- migrator/storage_map_stordb.go | 18 +-- migrator/storage_mongo_datadb.go | 130 ++++++++--------- migrator/storage_mongo_stordb.go | 18 +-- migrator/storage_redis.go | 132 +++++++++--------- migrator/storage_sql.go | 2 +- services/analyzers_test.go | 2 +- services/apiers_test.go | 2 +- services/asteriskagent_test.go | 2 +- services/attributes_test.go | 2 +- services/cdrs_test.go | 2 +- services/chargers_test.go | 2 +- services/cores_test.go | 2 +- services/datadb_test.go | 2 +- services/dispatchers_test.go | 2 +- services/dnsagent_test.go | 2 +- services/ees_test.go | 2 +- services/ers_test.go | 2 +- services/freeswitchagent_test.go | 2 +- services/httpagent_test.go | 2 +- services/loaders_test.go | 2 +- services/radiusagent_test.go | 2 +- services/rals_test.go | 2 +- services/registrarc_test.go | 2 +- services/resources_test.go | 2 +- services/responders_test.go | 2 +- services/routes_test.go | 2 +- services/schedulers_test.go | 2 +- services/sessions_test.go | 2 +- services/sipagent_test.go | 2 +- services/stats_test.go | 2 +- services/stordb_test.go | 2 +- services/thresholds_test.go | 2 +- sessions/session_test.go | 12 +- sessions/sessionscover_test.go | 2 +- utils/logger.go | 2 +- utils/pathitemlist_test.go | 9 +- 131 files changed, 395 insertions(+), 395 deletions(-) diff --git a/agents/agentreq.go b/agents/agentreq.go index e8f5d1678..7eb3ec521 100644 --- a/agents/agentreq.go +++ b/agents/agentreq.go @@ -188,7 +188,7 @@ func (ar *AgentRequest) FieldAsString(fldPath []string) (val string, err error) return utils.IfaceAsString(iface), nil } -//SetFields will populate fields of AgentRequest out of templates +// SetFields will populate fields of AgentRequest out of templates func (ar *AgentRequest) SetFields(tplFlds []*config.FCTemplate) (err error) { ar.tmp = &utils.DataNode{Type: utils.NMMapType, Map: make(map[string]*utils.DataNode)} for _, tplFld := range tplFlds { diff --git a/agents/kamevent.go b/agents/kamevent.go index 4d1542c15..41537ea5f 100644 --- a/agents/kamevent.go +++ b/agents/kamevent.go @@ -403,8 +403,8 @@ func (kev KamEvent) V1TerminateSessionArgs() (args *sessions.V1TerminateSessionA return } -//KamReply will be used to send back to kamailio from -//Authrization,ProcessEvent and ProcessEvent empty (pingPong) +// KamReply will be used to send back to kamailio from +// Authrization,ProcessEvent and ProcessEvent empty (pingPong) type KamReply struct { Event string // Kamailio will use this to differentiate between requests and replies TransactionIndex string // Original transaction index diff --git a/agents/libdiam.go b/agents/libdiam.go index 66cee7f80..17974cde4 100644 --- a/agents/libdiam.go +++ b/agents/libdiam.go @@ -210,7 +210,8 @@ func updateAVPLength(avps []*diam.AVP) (l int) { } // messageAddAVPsWithPath will dynamically add AVPs into the message -// append: append to the message, on false overwrite if AVP is single or add to group if AVP is Grouped +// +// append: append to the message, on false overwrite if AVP is single or add to group if AVP is Grouped func messageSetAVPsWithPath(m *diam.Message, pathStr []string, avpValStr string, newBranch bool, tmz string) (err error) { if len(pathStr) == 0 { diff --git a/agents/librad.go b/agents/librad.go index 1ba66d5bb..e05aacc0f 100644 --- a/agents/librad.go +++ b/agents/librad.go @@ -100,7 +100,7 @@ func (pk *radiusDP) FieldAsString(fldPath []string) (data string, err error) { return utils.IfaceAsString(valIface), nil } -//radauthReq is used to authorize a request based on flags +// radauthReq is used to authorize a request based on flags func radauthReq(flags utils.FlagsWithParams, req *radigo.Packet, aReq *AgentRequest, rpl *radigo.Packet) (bool, error) { // try to get UserPassword from Vars as slice of NMItems nmItems, has := aReq.Vars.Map[utils.UserPassword] diff --git a/analyzers/analyzers_it_test.go b/analyzers/analyzers_it_test.go index fd3ee4b10..a2920e8ec 100644 --- a/analyzers/analyzers_it_test.go +++ b/analyzers/analyzers_it_test.go @@ -81,7 +81,7 @@ func newRPCClient(cfg *config.ListenCfg) (c *rpc.Client, err error) { } } -//Test start here +// Test start here func TestAnalyzerSIT(t *testing.T) { for _, stest := range sTestsAlsPrf { t.Run("TestAnalyzerSIT", stest) diff --git a/apier/v1/apier2_it_test.go b/apier/v1/apier2_it_test.go index fbee90abd..ffd2f4171 100644 --- a/apier/v1/apier2_it_test.go +++ b/apier/v1/apier2_it_test.go @@ -77,7 +77,7 @@ var ( } ) -//Test start here +// Test start here func TestApierIT2(t *testing.T) { // no need for a new config with *gob transport in this case switch *dbType { diff --git a/apier/v1/attributes_it_test.go b/apier/v1/attributes_it_test.go index 4b7de0beb..c04af4648 100644 --- a/apier/v1/attributes_it_test.go +++ b/apier/v1/attributes_it_test.go @@ -104,7 +104,7 @@ var ( } ) -//Test start here +// Test start here func TestAttributeSIT(t *testing.T) { attrsTests := sTestsAlsPrf switch *dbType { @@ -1449,7 +1449,7 @@ func testAttributeSKillEngine(t *testing.T) { } } -//Start tests for caching +// Start tests for caching func testAttributeSCachingMetaNone(t *testing.T) { //*none option should not add attribute in cache only in Datamanager attrPrf1 := &engine.AttributeProfileWithAPIOpts{ diff --git a/apier/v1/caps_it_test.go b/apier/v1/caps_it_test.go index 9482979c4..70589173c 100644 --- a/apier/v1/caps_it_test.go +++ b/apier/v1/caps_it_test.go @@ -65,7 +65,7 @@ var ( capsLastCfgDir string ) -//Test start here +// Test start here func TestCapsBusyJSON(t *testing.T) { capsConfigDIR = "caps_busy" for _, stest := range sTestsCaps { diff --git a/apier/v1/costs_it_test.go b/apier/v1/costs_it_test.go index 10927196b..5f0158897 100644 --- a/apier/v1/costs_it_test.go +++ b/apier/v1/costs_it_test.go @@ -50,7 +50,7 @@ var ( } ) -//Test start here +// Test start here func TestCostIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/ees_it_test.go b/apier/v1/ees_it_test.go index 4be297cf6..6104f269c 100644 --- a/apier/v1/ees_it_test.go +++ b/apier/v1/ees_it_test.go @@ -58,7 +58,7 @@ var ( } ) -//Test start here +// Test start here func TestExportCDRs(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/filter_indexes_it_test.go b/apier/v1/filter_indexes_it_test.go index a747131e1..66e9d4190 100644 --- a/apier/v1/filter_indexes_it_test.go +++ b/apier/v1/filter_indexes_it_test.go @@ -180,7 +180,7 @@ func testV1FIdxRpcConn(t *testing.T) { } } -//ThresholdProfile +// ThresholdProfile func testV1FIdxSetThresholdProfile(t *testing.T) { var reply *engine.ThresholdProfile filter = &engine.FilterWithAPIOpts{ @@ -492,7 +492,7 @@ func testV1FIdxRemoveThresholdProfile(t *testing.T) { } } -//StatQueueProfile +// StatQueueProfile func testV1FIdxSetStatQueueProfileIndexes(t *testing.T) { var reply *engine.StatQueueProfile filter = &engine.FilterWithAPIOpts{ @@ -783,7 +783,7 @@ func testV1FIdxRemoveStatQueueProfile(t *testing.T) { } } -//ResourceProfile +// ResourceProfile func testV1FIdxSetResourceProfileIndexes(t *testing.T) { var reply *engine.ResourceProfile filter = &engine.FilterWithAPIOpts{ @@ -1035,7 +1035,7 @@ func testV1FIdxRemoveResourceProfile(t *testing.T) { } } -//RouteProfile +// RouteProfile func testV1FIdxSetRouteProfileIndexes(t *testing.T) { var reply *engine.RouteProfile filter = &engine.FilterWithAPIOpts{ @@ -1325,7 +1325,7 @@ func testV1FIdxRemoveRouteProfile(t *testing.T) { } } -//AttributeProfile Indexes +// AttributeProfile Indexes func testV1FIdxSetAttributeProfileIndexes(t *testing.T) { var reply *engine.AttributeProfile filter = &engine.FilterWithAPIOpts{ diff --git a/apier/v1/filterindexecache_it_test.go b/apier/v1/filterindexecache_it_test.go index ce4515d2a..cf850f912 100644 --- a/apier/v1/filterindexecache_it_test.go +++ b/apier/v1/filterindexecache_it_test.go @@ -142,7 +142,7 @@ func testV1FIdxCaFromFolder(t *testing.T) { time.Sleep(100 * time.Millisecond) } -//ThresholdProfile +// ThresholdProfile func testV1FIdxCaProcessEventWithNotFound(t *testing.T) { tEv := &utils.CGREvent{ Tenant: "cgrates.org", @@ -510,7 +510,7 @@ func testV1FIdxCaRemoveThresholdProfile(t *testing.T) { } } -//StatQueue +// StatQueue func testV1FIdxCaGetStatQueuesWithNotFound(t *testing.T) { var reply *[]string tEv := &utils.CGREvent{ @@ -910,7 +910,7 @@ func testV1FIdxCaRemoveStatQueueProfile(t *testing.T) { } } -//AttributeProfile +// AttributeProfile func testV1FIdxCaProcessAttributeProfileEventWithNotFound(t *testing.T) { ev := &utils.CGREvent{ Tenant: "cgrates.org", diff --git a/apier/v1/filters.go b/apier/v1/filters.go index 456ae2e64..15a7a98c6 100644 --- a/apier/v1/filters.go +++ b/apier/v1/filters.go @@ -25,7 +25,7 @@ import ( "github.com/cgrates/cgrates/utils" ) -//SetFilter add a new Filter +// SetFilter add a new Filter func (apierSv1 *APIerSv1) SetFilter(arg *engine.FilterWithAPIOpts, reply *string) (err error) { if missing := utils.MissingStructFields(arg.Filter, []string{utils.ID}); len(missing) != 0 { return utils.NewErrMandatoryIeMissing(missing...) @@ -64,7 +64,7 @@ func (apierSv1 *APIerSv1) SetFilter(arg *engine.FilterWithAPIOpts, reply *string return nil } -//GetFilter returns a Filter +// GetFilter returns a Filter func (apierSv1 *APIerSv1) GetFilter(arg *utils.TenantID, reply *engine.Filter) error { if missing := utils.MissingStructFields(arg, []string{utils.ID}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) @@ -103,7 +103,7 @@ func (apierSv1 *APIerSv1) GetFilterIDs(args *utils.PaginatorWithTenant, fltrIDs return nil } -//RemoveFilter remove a specific filter +// RemoveFilter remove a specific filter func (apierSv1 *APIerSv1) RemoveFilter(arg *utils.TenantIDWithAPIOpts, reply *string) error { if missing := utils.MissingStructFields(arg, []string{utils.ID}); len(missing) != 0 { //Params missing return utils.NewErrMandatoryIeMissing(missing...) diff --git a/apier/v1/filters_it_test.go b/apier/v1/filters_it_test.go index f645b50df..bd332b983 100644 --- a/apier/v1/filters_it_test.go +++ b/apier/v1/filters_it_test.go @@ -62,7 +62,7 @@ var ( } ) -//Test start here +// Test start here func TestFilterIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/guardian_it_test.go b/apier/v1/guardian_it_test.go index 033ce05b3..ed431d7a5 100644 --- a/apier/v1/guardian_it_test.go +++ b/apier/v1/guardian_it_test.go @@ -32,7 +32,7 @@ import ( "github.com/cgrates/cgrates/utils" ) -//Test start here +// Test start here func TestGuardianSIT(t *testing.T) { var err error var guardianConfigDIR string diff --git a/apier/v1/rating_profile_late_it_test.go b/apier/v1/rating_profile_late_it_test.go index 8f5fc2273..70257c737 100644 --- a/apier/v1/rating_profile_late_it_test.go +++ b/apier/v1/rating_profile_late_it_test.go @@ -49,7 +49,7 @@ var ( } ) -//Test start here +// Test start here func TestRPLateIT2(t *testing.T) { // no need for a new config with *gob transport in this case switch *dbType { diff --git a/apier/v1/resourcesv1_it_test.go b/apier/v1/resourcesv1_it_test.go index 478d704f7..14eba046b 100644 --- a/apier/v1/resourcesv1_it_test.go +++ b/apier/v1/resourcesv1_it_test.go @@ -104,7 +104,7 @@ var ( } ) -//Test start here +// Test start here func TestRsV1IT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/schedulers_it_test.go b/apier/v1/schedulers_it_test.go index 62c4afe2d..dce1086b3 100644 --- a/apier/v1/schedulers_it_test.go +++ b/apier/v1/schedulers_it_test.go @@ -54,7 +54,7 @@ var sTestsSchedFiltered = []func(t *testing.T){ testSchedStopEngine, } -//TestSchedWithoutFilters will execute action for all accounts +// TestSchedWithoutFilters will execute action for all accounts func TestSchedWithoutFilters(t *testing.T) { switch *dbType { case utils.MetaInternal: @@ -74,7 +74,7 @@ func TestSchedWithoutFilters(t *testing.T) { } } -//TestSchedWithFiltersSingleAccount will execute actions only for account 1001 +// TestSchedWithFiltersSingleAccount will execute actions only for account 1001 func TestSchedWithFiltersSingleAccount(t *testing.T) { switch *dbType { case utils.MetaInternal: @@ -93,7 +93,7 @@ func TestSchedWithFiltersSingleAccount(t *testing.T) { } } -//TestSchedWithFilters2 will execute actions for accounts 1002 and 1003 ( 1001 will be skiped ) +// TestSchedWithFilters2 will execute actions for accounts 1002 and 1003 ( 1001 will be skiped ) func TestSchedWithFilters2(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/smgbirpc.go b/apier/v1/smgbirpc.go index c28835aaa..9cb4e1417 100644 --- a/apier/v1/smgbirpc.go +++ b/apier/v1/smgbirpc.go @@ -33,7 +33,7 @@ func (smgv1 *SMGenericV1) Handlers() map[string]interface{} { } } -/// Returns MaxUsage (for calls in seconds), -1 for no limit +// / Returns MaxUsage (for calls in seconds), -1 for no limit func (smgv1 *SMGenericV1) BiRPCV1GetMaxUsage(clnt *rpc2.Client, ev map[string]interface{}, maxUsage *float64) (err error) { return smgv1.Ss.BiRPCV1GetMaxUsage(clnt, ev, maxUsage) diff --git a/apier/v1/stats_it_test.go b/apier/v1/stats_it_test.go index 7a36cf89b..19ef0b075 100644 --- a/apier/v1/stats_it_test.go +++ b/apier/v1/stats_it_test.go @@ -120,7 +120,7 @@ func init() { rand.Seed(time.Now().UnixNano()) // used in benchmarks } -//Test start here +// Test start here func TestSTSV1IT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/thresholds.go b/apier/v1/thresholds.go index ce09a9790..b1ff4aaeb 100644 --- a/apier/v1/thresholds.go +++ b/apier/v1/thresholds.go @@ -163,7 +163,7 @@ func (apierSv1 *APIerSv1) RemoveThresholdProfile(args *utils.TenantIDWithAPIOpts } //handle caching for ThresholdProfile if err := apierSv1.CallCache(utils.IfaceAsString(args.APIOpts[utils.CacheOpt]), tnt, utils.CacheThresholdProfiles, - utils.ConcatenatedKey(tnt, args.ID), utils.EmptyString,nil, nil, args.APIOpts); err != nil { + utils.ConcatenatedKey(tnt, args.ID), utils.EmptyString, nil, nil, args.APIOpts); err != nil { return utils.APIErrorHandler(err) } //generate a loadID for CacheThresholdProfiles and CacheThresholds and store it in database diff --git a/apier/v1/timing_it_test.go b/apier/v1/timing_it_test.go index b39263512..1e05b7ad9 100644 --- a/apier/v1/timing_it_test.go +++ b/apier/v1/timing_it_test.go @@ -53,7 +53,7 @@ var ( } ) -//Tests start here +// Tests start here func TestTimingIT(t *testing.T) { timingTests := sTestsTiming switch *dbType { diff --git a/apier/v1/tp_it_test.go b/apier/v1/tp_it_test.go index 3e836121a..b954a8c13 100644 --- a/apier/v1/tp_it_test.go +++ b/apier/v1/tp_it_test.go @@ -52,7 +52,7 @@ var ( } ) -//Test start here +// Test start here func TestTPIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpaccountactions_it_test.go b/apier/v1/tpaccountactions_it_test.go index f38584f00..687eb0811 100644 --- a/apier/v1/tpaccountactions_it_test.go +++ b/apier/v1/tpaccountactions_it_test.go @@ -61,7 +61,7 @@ var sTestsTPAccActions = []func(t *testing.T){ testTPAccActionsKillEngine, } -//Test start here +// Test start here func TestTPAccActionsIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpactionplans_it_test.go b/apier/v1/tpactionplans_it_test.go index af3cb3f81..6e64870f2 100644 --- a/apier/v1/tpactionplans_it_test.go +++ b/apier/v1/tpactionplans_it_test.go @@ -59,7 +59,7 @@ var sTestsTPAccPlans = []func(t *testing.T){ testTPAccPlansKillEngine, } -//Test start here +// Test start here func TestTPAccPlansIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpactions_it_test.go b/apier/v1/tpactions_it_test.go index 7606a2c68..2122059a5 100644 --- a/apier/v1/tpactions_it_test.go +++ b/apier/v1/tpactions_it_test.go @@ -59,7 +59,7 @@ var sTestsTPActions = []func(t *testing.T){ testTPActionsKillEngine, } -//Test start here +// Test start here func TestTPActionsIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpactiontriggers_it_test.go b/apier/v1/tpactiontriggers_it_test.go index 5a45402ad..7c2957246 100644 --- a/apier/v1/tpactiontriggers_it_test.go +++ b/apier/v1/tpactiontriggers_it_test.go @@ -59,7 +59,7 @@ var sTestsTPActionTriggers = []func(t *testing.T){ testTPActionTriggersKillEngine, } -//Test start here +// Test start here func TestTPActionTriggersIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpattributes_it_test.go b/apier/v1/tpattributes_it_test.go index ecce5c9f0..71b0731d5 100644 --- a/apier/v1/tpattributes_it_test.go +++ b/apier/v1/tpattributes_it_test.go @@ -60,7 +60,7 @@ var sTestsTPAlsPrf = []func(t *testing.T){ testTPAlsPrfKillEngine, } -//Test start here +// Test start here func TestTPAlsPrfIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpchargers_it_test.go b/apier/v1/tpchargers_it_test.go index 4e7e01246..d43c2dd93 100644 --- a/apier/v1/tpchargers_it_test.go +++ b/apier/v1/tpchargers_it_test.go @@ -59,7 +59,7 @@ var sTestsTPChrgs = []func(t *testing.T){ testTPChrgsKillEngine, } -//Test start here +// Test start here func TestTPChrgsIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpdestinationrates_it_test.go b/apier/v1/tpdestinationrates_it_test.go index f0478c71f..150b345db 100644 --- a/apier/v1/tpdestinationrates_it_test.go +++ b/apier/v1/tpdestinationrates_it_test.go @@ -58,7 +58,7 @@ var sTestsTPDstRates = []func(t *testing.T){ testTPDstRateKillEngine, } -//Test start here +// Test start here func TestTPDstRateIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpdestinations_it_test.go b/apier/v1/tpdestinations_it_test.go index 9e8abb8c7..4744a46d6 100644 --- a/apier/v1/tpdestinations_it_test.go +++ b/apier/v1/tpdestinations_it_test.go @@ -58,7 +58,7 @@ var sTestsTPDestinations = []func(t *testing.T){ testTPDestinationsKillEngine, } -//Test start here +// Test start here func TestTPDestinationsIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpdispatchers_it_test.go b/apier/v1/tpdispatchers_it_test.go index ef3011a63..b3ea5ff82 100644 --- a/apier/v1/tpdispatchers_it_test.go +++ b/apier/v1/tpdispatchers_it_test.go @@ -58,7 +58,7 @@ var sTestsTPDispatchers = []func(t *testing.T){ testTPDispatcherKillEngine, } -//Test start here +// Test start here func TestTPDispatcherIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpfilters_it_test.go b/apier/v1/tpfilters_it_test.go index 584358da0..86dd46dad 100644 --- a/apier/v1/tpfilters_it_test.go +++ b/apier/v1/tpfilters_it_test.go @@ -60,7 +60,7 @@ var sTestsTPFilters = []func(t *testing.T){ testTPFilterKillEngine, } -//Test start here +// Test start here func TestTPFilterITMySql(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tprates_it_test.go b/apier/v1/tprates_it_test.go index 5b23c0bb8..e29408a1f 100644 --- a/apier/v1/tprates_it_test.go +++ b/apier/v1/tprates_it_test.go @@ -58,7 +58,7 @@ var sTestsTPRates = []func(t *testing.T){ testTPRatesKillEngine, } -//Test start here +// Test start here func TestTPRatesIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpratingplans_it_test.go b/apier/v1/tpratingplans_it_test.go index 23ccec425..4e4962f0c 100644 --- a/apier/v1/tpratingplans_it_test.go +++ b/apier/v1/tpratingplans_it_test.go @@ -58,7 +58,7 @@ var sTestsTPRatingPlans = []func(t *testing.T){ testTPRatingPlansKillEngine, } -//Test start here +// Test start here func TestTPRatingPlansIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpratingprofiles_it_test.go b/apier/v1/tpratingprofiles_it_test.go index 08b783e88..35ae7984f 100644 --- a/apier/v1/tpratingprofiles_it_test.go +++ b/apier/v1/tpratingprofiles_it_test.go @@ -61,7 +61,7 @@ var sTestsTPRatingProfiles = []func(t *testing.T){ testTPRatingProfilesKillEngine, } -//Test start here +// Test start here func TestTPRatingProfilesIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpresources_it_test.go b/apier/v1/tpresources_it_test.go index 09b06b6f5..df97db955 100644 --- a/apier/v1/tpresources_it_test.go +++ b/apier/v1/tpresources_it_test.go @@ -58,7 +58,7 @@ var sTestsTPResources = []func(t *testing.T){ testTPResKillEngine, } -//Test start here +// Test start here func TestTPResIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tproutes_it_test.go b/apier/v1/tproutes_it_test.go index e871a0368..0f11047ab 100644 --- a/apier/v1/tproutes_it_test.go +++ b/apier/v1/tproutes_it_test.go @@ -60,7 +60,7 @@ var sTestsTPRoute = []func(t *testing.T){ testTPRouteKillEngine, } -//Test start here +// Test start here func TestTPRouteIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpsharedgroups_it_test.go b/apier/v1/tpsharedgroups_it_test.go index bfedf9ff6..086ac62f5 100644 --- a/apier/v1/tpsharedgroups_it_test.go +++ b/apier/v1/tpsharedgroups_it_test.go @@ -58,7 +58,7 @@ var sTestsTPSharedGroups = []func(t *testing.T){ testTPSharedGroupsKillEngine, } -//Test start here +// Test start here func TestTPSharedGroupsIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpstats_it_test.go b/apier/v1/tpstats_it_test.go index f919e9cc2..008c74faf 100644 --- a/apier/v1/tpstats_it_test.go +++ b/apier/v1/tpstats_it_test.go @@ -59,7 +59,7 @@ var sTestsTPStats = []func(t *testing.T){ testTPStatsKillEngine, } -//Test start here +// Test start here func TestTPStatIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tpthresholds_it_test.go b/apier/v1/tpthresholds_it_test.go index 1b268b572..64dc61303 100644 --- a/apier/v1/tpthresholds_it_test.go +++ b/apier/v1/tpthresholds_it_test.go @@ -59,7 +59,7 @@ var sTestsTPThreshold = []func(t *testing.T){ testTPThreholdKillEngine, } -//Test start here +// Test start here func TestTPThresholdIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/tptimings_it_test.go b/apier/v1/tptimings_it_test.go index 1f54db336..84dab39f3 100644 --- a/apier/v1/tptimings_it_test.go +++ b/apier/v1/tptimings_it_test.go @@ -58,7 +58,7 @@ var sTestsTPTiming = []func(t *testing.T){ testTPTimingsKillEngine, } -//Test start here +// Test start here func TestTPTimingIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v1/versions_it_test.go b/apier/v1/versions_it_test.go index da047287a..aed13d27b 100644 --- a/apier/v1/versions_it_test.go +++ b/apier/v1/versions_it_test.go @@ -52,7 +52,7 @@ var ( } ) -//Test start here +// Test start here func TestVrsIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v2/accounts_it_test.go b/apier/v2/accounts_it_test.go index c93450f00..a5a91cb82 100644 --- a/apier/v2/accounts_it_test.go +++ b/apier/v2/accounts_it_test.go @@ -58,7 +58,7 @@ var ( } ) -//Test start here +// Test start here func TestAccountsIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/apier/v2/attributes_it_test.go b/apier/v2/attributes_it_test.go index baf0aecde..6592422f4 100644 --- a/apier/v2/attributes_it_test.go +++ b/apier/v2/attributes_it_test.go @@ -53,7 +53,7 @@ var ( } ) -//Test start here +// Test start here func TestAttributeSIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/cmd/cgr-loader/cgr-loader_remove_it_test.go b/cmd/cgr-loader/cgr-loader_remove_it_test.go index 289a33843..5507aed85 100644 --- a/cmd/cgr-loader/cgr-loader_remove_it_test.go +++ b/cmd/cgr-loader/cgr-loader_remove_it_test.go @@ -494,7 +494,7 @@ func testCgrLdrRemoveData(t *testing.T) { } } -//Kill the engine when it is about to be finished +// Kill the engine when it is about to be finished func testCgrLdrKillEngine(t *testing.T) { if err := engine.KillEngine(100); err != nil { t.Error(err) diff --git a/config/config.go b/config/config.go index ac8596d03..7faa65521 100644 --- a/config/config.go +++ b/config/config.go @@ -1756,7 +1756,7 @@ func (cfg *CGRConfig) V1SetConfig(args *SetConfigArgs, reply *string) (err error return } -//V1GetConfigAsJSON will retrieve from CGRConfig a section as a string +// V1GetConfigAsJSON will retrieve from CGRConfig a section as a string func (cfg *CGRConfig) V1GetConfigAsJSON(args *SectionWithAPIOpts, reply *string) (err error) { args.Section = utils.FirstNonEmpty(args.Section, utils.MetaAll) cfg.cacheDPMux.RLock() diff --git a/config/rjreader.go b/config/rjreader.go index ad3dcba01..34752a1d9 100644 --- a/config/rjreader.go +++ b/config/rjreader.go @@ -54,7 +54,7 @@ func isWhiteSpace(c byte) bool { return c == ' ' || c == '\t' || isNewLine(c) || c == 0 } -//ReadEnv reads the enviorment variable +// ReadEnv reads the enviorment variable func ReadEnv(key string) (string, error) { //it shod print a warning not a error if env := os.Getenv(key); env != "" { return env, nil @@ -166,7 +166,7 @@ func (rjr *RjReader) consumeComent(pkbit byte) (bool, error) { return false, nil } -//readFirstNonWhiteSpace reads first non white space byte +// readFirstNonWhiteSpace reads first non white space byte func (rjr *RjReader) readFirstNonWhiteSpace() (bit byte, err error) { for !rjr.isEndOfFile() { bit = rjr.buf[rjr.indx] @@ -233,13 +233,13 @@ func (rjr *RjReader) PeekByteWC() (bit byte, err error) { return 0, io.EOF } -//checkMeta check if char mach with next char from MetaEnv if not reset the counting +// checkMeta check if char mach with next char from MetaEnv if not reset the counting func (rjr *RjReader) checkMeta() bool { return rjr.indx-1+len(utils.MetaEnv) < len(rjr.buf) && utils.MetaEnv == string(rjr.buf[rjr.indx-1:rjr.indx-1+len(utils.MetaEnv)]) } -//readEnvName reads the enviorment key +// readEnvName reads the enviorment key func (rjr *RjReader) readEnvName(indx int) (name []byte, endindx int) { //0 if not set for indx < len(rjr.buf) { //read byte by byte bit := rjr.buf[indx] @@ -252,7 +252,7 @@ func (rjr *RjReader) readEnvName(indx int) (name []byte, endindx int) { //0 if n return name, indx } -//replaceEnv replaces the EnvMeta and enviorment key with enviorment variable value in specific buffer +// replaceEnv replaces the EnvMeta and enviorment key with enviorment variable value in specific buffer func (rjr *RjReader) replaceEnv(startEnv int) error { midEnv := len(utils.MetaEnv) key, endEnv := rjr.readEnvName(startEnv + midEnv) diff --git a/cores/basic_auth.go b/cores/basic_auth.go index 6b47f02af..21ba89c1e 100644 --- a/cores/basic_auth.go +++ b/cores/basic_auth.go @@ -30,9 +30,9 @@ import ( // use provides a cleaner interface for chaining middleware for single routes. // Middleware functions are simple HTTP handlers (w http.ResponseWriter, r *http.Request) // -// r.HandleFunc("/login", use(loginHandler, rateLimit, csrf)) -// r.HandleFunc("/form", use(formHandler, csrf)) -// r.HandleFunc("/about", aboutHandler) +// r.HandleFunc("/login", use(loginHandler, rateLimit, csrf)) +// r.HandleFunc("/form", use(formHandler, csrf)) +// r.HandleFunc("/about", aboutHandler) // // From https://gist.github.com/elithrar/9146306 // See https://gist.github.com/elithrar/7600878#comment-955958 for how to extend it to suit simple http.Handler's diff --git a/cores/gob_codec_test.go b/cores/gob_codec_test.go index 66defc4e5..7c2458344 100644 --- a/cores/gob_codec_test.go +++ b/cores/gob_codec_test.go @@ -43,7 +43,7 @@ func (mk *mockRWC) Close() error { return nil } -//Mocking For getting a nil error when the interface argument is nil in encoding +// Mocking For getting a nil error when the interface argument is nil in encoding type mockReadWriteCloserErrorNilInterface struct { mockRWC } diff --git a/dispatchers/attributes_it_test.go b/dispatchers/attributes_it_test.go index f285b05b4..0929b6c90 100644 --- a/dispatchers/attributes_it_test.go +++ b/dispatchers/attributes_it_test.go @@ -48,7 +48,7 @@ var sTestsDspAttr = []func(t *testing.T){ testDspAttrGetAttrInternal, } -//Test start here +// Test start here func TestDspAttributeS(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/caches_it_test.go b/dispatchers/caches_it_test.go index c4ad65f90..e80dea0f4 100644 --- a/dispatchers/caches_it_test.go +++ b/dispatchers/caches_it_test.go @@ -44,7 +44,7 @@ var sTestsDspChc = []func(t *testing.T){ testDspChcClear, } -//Test start here +// Test start here func TestDspCacheSv1(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/cdrs_it_test.go b/dispatchers/cdrs_it_test.go index 899d8824c..4d6c8007a 100644 --- a/dispatchers/cdrs_it_test.go +++ b/dispatchers/cdrs_it_test.go @@ -59,7 +59,7 @@ var ( } ) -//Test start here +// Test start here func TestDspCDRsIT(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/chargers_it_test.go b/dispatchers/chargers_it_test.go index 513538322..9bfa45072 100644 --- a/dispatchers/chargers_it_test.go +++ b/dispatchers/chargers_it_test.go @@ -41,7 +41,7 @@ var sTestsDspCpp = []func(t *testing.T){ testDspCppTestAuthKey2, } -//Test start here +// Test start here func TestDspChargerST(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/config_it_test.go b/dispatchers/config_it_test.go index fee6cee74..382f93b51 100644 --- a/dispatchers/config_it_test.go +++ b/dispatchers/config_it_test.go @@ -33,7 +33,7 @@ var sTestsDspConfig = []func(t *testing.T){ testDspConfigSv1GetJSONSection, } -//Test start here +// Test start here func TestDspConfigIT(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/guardian_it_test.go b/dispatchers/guardian_it_test.go index 0fe6706dd..4c89d2702 100644 --- a/dispatchers/guardian_it_test.go +++ b/dispatchers/guardian_it_test.go @@ -34,7 +34,7 @@ var sTestsDspGrd = []func(t *testing.T){ testDspGrdLock, } -//Test start here +// Test start here func TestDspGuardianST(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/rals_it_test.go b/dispatchers/rals_it_test.go index f9cc1e6ed..4d983c6d9 100644 --- a/dispatchers/rals_it_test.go +++ b/dispatchers/rals_it_test.go @@ -33,7 +33,7 @@ var sTestsDspRALs = []func(t *testing.T){ testDspRALsGetRatingPlanCost, } -//Test start here +// Test start here func TestDspRALsIT(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/replicator_it_test.go b/dispatchers/replicator_it_test.go index 1ecae2ce7..7ce1e2ba5 100644 --- a/dispatchers/replicator_it_test.go +++ b/dispatchers/replicator_it_test.go @@ -56,7 +56,7 @@ var sTestsDspRpl = []func(t *testing.T){ testDspRplDestination, } -//Test start here +// Test start here func TestDspReplicator(t *testing.T) { var config1, config2, config3 string switch *dbType { @@ -1365,7 +1365,7 @@ func testDspRplRatingProfile(t *testing.T) { } } -//Destination +// Destination func testDspRplDestination(t *testing.T) { // Set Destination var replyStr string diff --git a/dispatchers/resources_it_test.go b/dispatchers/resources_it_test.go index 0deecb69d..bb974aebc 100644 --- a/dispatchers/resources_it_test.go +++ b/dispatchers/resources_it_test.go @@ -38,7 +38,7 @@ var sTestsDspRes = []func(t *testing.T){ testDspResTestAuthKey3, } -//Test start here +// Test start here func TestDspResourceSIT(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/responder_it_test.go b/dispatchers/responder_it_test.go index 6498bb73c..5b58d8699 100644 --- a/dispatchers/responder_it_test.go +++ b/dispatchers/responder_it_test.go @@ -39,7 +39,7 @@ var sTestsDspRsp = []func(t *testing.T){ testDspResponderInternal, } -//Test start here +// Test start here func TestDspResponder(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/routes_it_test.go b/dispatchers/routes_it_test.go index f73ea70cb..3c1d3e984 100644 --- a/dispatchers/routes_it_test.go +++ b/dispatchers/routes_it_test.go @@ -45,7 +45,7 @@ var ( nowTime = time.Now() ) -//Test start here +// Test start here func TestDspSupplierS(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/stats_it_test.go b/dispatchers/stats_it_test.go index 65398ba1a..293fa977a 100644 --- a/dispatchers/stats_it_test.go +++ b/dispatchers/stats_it_test.go @@ -40,7 +40,7 @@ var sTestsDspSts = []func(t *testing.T){ testDspStsTestAuthKey3, } -//Test start here +// Test start here func TestDspStatS(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/dispatchers/thresholds_it_test.go b/dispatchers/thresholds_it_test.go index b9ff5e562..ec9ddae4f 100644 --- a/dispatchers/thresholds_it_test.go +++ b/dispatchers/thresholds_it_test.go @@ -41,7 +41,7 @@ var sTestsDspTh = []func(t *testing.T){ testDspThTestAuthKey3, } -//Test start here +// Test start here func TestDspThresholdS(t *testing.T) { var config1, config2, config3 string switch *dbType { diff --git a/ees/ee_test.go b/ees/ee_test.go index b651e3aec..6cd6959c2 100644 --- a/ees/ee_test.go +++ b/ees/ee_test.go @@ -179,7 +179,7 @@ func TestNewEventExporterDefaultCase(t *testing.T) { } } -//Test for Case 7 +// Test for Case 7 func TestNewEventExporterCase7(t *testing.T) { cgrCfg := config.NewDefaultCGRConfig() cgrCfg.EEsCfg().Exporters[0].Type = utils.MetaElastic @@ -210,7 +210,7 @@ func TestNewEventExporterCase7(t *testing.T) { } } -//Test for Case 8 +// Test for Case 8 func TestNewEventExporterCase8(t *testing.T) { cgrCfg := config.NewDefaultCGRConfig() cgrCfg.EEsCfg().Exporters[0].Type = utils.MetaSQL @@ -223,7 +223,7 @@ func TestNewEventExporterCase8(t *testing.T) { } } -//Test for invalid "dc" +// Test for invalid "dc" func TestNewEventExporterDcCase(t *testing.T) { cgrCfg := config.NewDefaultCGRConfig() cgrCfg.GeneralCfg().DefaultTimezone = "invalid_timezone" diff --git a/engine/action_trigger.go b/engine/action_trigger.go index b4526071d..85689bcdf 100644 --- a/engine/action_trigger.go +++ b/engine/action_trigger.go @@ -194,7 +194,7 @@ func (atpl ActionTriggers) Swap(i, j int) { atpl[i], atpl[j] = atpl[j], atpl[i] } -//we need higher weights earlyer in the list +// we need higher weights earlyer in the list func (atpl ActionTriggers) Less(j, i int) bool { return atpl[i].Weight < atpl[j].Weight } diff --git a/engine/exportrequest.go b/engine/exportrequest.go index 55ee4e869..062915782 100644 --- a/engine/exportrequest.go +++ b/engine/exportrequest.go @@ -98,7 +98,7 @@ func (eeR *ExportRequest) FieldAsString(fldPath []string) (val string, err error return utils.IfaceAsString(iface), nil } -//SetFields will populate fields of AgentRequest out of templates +// SetFields will populate fields of AgentRequest out of templates func (eeR *ExportRequest) SetFields(tplFlds []*config.FCTemplate) (err error) { for _, tplFld := range tplFlds { if pass, err := eeR.filterS.Pass(eeR.tnt, diff --git a/engine/model_helpers.go b/engine/model_helpers.go index a6b1f158e..71b3ba1ec 100644 --- a/engine/model_helpers.go +++ b/engine/model_helpers.go @@ -92,7 +92,7 @@ func csvLoad(s interface{}, values []string) (interface{}, error) { return elem.Interface(), nil } -//CsvDump receive and interface and convert it to a slice of string +// CsvDump receive and interface and convert it to a slice of string func CsvDump(s interface{}) ([]string, error) { fieldIndexMap := make(map[string]int) st := reflect.ValueOf(s) diff --git a/engine/model_helpers_test.go b/engine/model_helpers_test.go index efeb4368f..3ca4ce730 100644 --- a/engine/model_helpers_test.go +++ b/engine/model_helpers_test.go @@ -3312,7 +3312,7 @@ func TestChargerProfileToAPI(t *testing.T) { } } -//Number of FilterIDs and AttributeIDs are equal +// Number of FilterIDs and AttributeIDs are equal func TestAPItoModelTPCharger(t *testing.T) { tpCharger := &utils.TPChargerProfile{ TPid: "TP1", @@ -3353,7 +3353,7 @@ func TestAPItoModelTPCharger(t *testing.T) { } } -//Number of FilterIDs is smaller than AttributeIDs +// Number of FilterIDs is smaller than AttributeIDs func TestAPItoModelTPCharger2(t *testing.T) { tpCharger := &utils.TPChargerProfile{ TPid: "TP1", @@ -3393,7 +3393,7 @@ func TestAPItoModelTPCharger2(t *testing.T) { } } -//Number of FilterIDs is greater than AttributeIDs +// Number of FilterIDs is greater than AttributeIDs func TestAPItoModelTPCharger3(t *testing.T) { tpCharger := &utils.TPChargerProfile{ TPid: "TP1", @@ -3432,7 +3432,7 @@ func TestAPItoModelTPCharger3(t *testing.T) { } } -//len(AttributeIDs) is 0 +// len(AttributeIDs) is 0 func TestAPItoModelTPCharger4(t *testing.T) { tpCharger := &utils.TPChargerProfile{ TPid: "TP1", @@ -3463,7 +3463,7 @@ func TestAPItoModelTPCharger4(t *testing.T) { } } -//len(FilterIDs) is 0 +// len(FilterIDs) is 0 func TestAPItoModelTPCharger5(t *testing.T) { tpCharger := &utils.TPChargerProfile{ TPid: "TP1", @@ -3494,7 +3494,7 @@ func TestAPItoModelTPCharger5(t *testing.T) { } } -//both len(AttributeIDs) and len(FilterIDs) are 0 +// both len(AttributeIDs) and len(FilterIDs) are 0 func TestAPItoModelTPCharger6(t *testing.T) { tpCharger := &utils.TPChargerProfile{ TPid: "TP1", diff --git a/engine/rateinterval.go b/engine/rateinterval.go index 2c429c254..716294b64 100644 --- a/engine/rateinterval.go +++ b/engine/rateinterval.go @@ -140,7 +140,7 @@ func (rit *RITiming) getRightMargin(t time.Time) (rigthtTime time.Time) { return time.Date(year, month, day, hour, min, sec, nsec, loc).Add(time.Second) } -//Returns a time object that represents the start of the interval realtive to the received time +// Returns a time object that represents the start of the interval realtive to the received time func (rit *RITiming) getLeftMargin(t time.Time) (rigthtTime time.Time) { year, month, day := t.Year(), t.Month(), t.Day() hour, min, sec, nsec := 0, 0, 0, 0 diff --git a/engine/sharedgroup.go b/engine/sharedgroup.go index ae4f565d5..4ee319e0b 100644 --- a/engine/sharedgroup.go +++ b/engine/sharedgroup.go @@ -76,7 +76,7 @@ func (sg *SharedGroup) Clone() (sharedGroup *SharedGroup) { return } -//Clone clones *SharingParameters +// Clone clones *SharingParameters func (sp *SharingParameters) Clone() *SharingParameters { if sp == nil { return nil diff --git a/engine/storage_internal_stordb.go b/engine/storage_internal_stordb.go index 67238f4ce..b2aac89e0 100644 --- a/engine/storage_internal_stordb.go +++ b/engine/storage_internal_stordb.go @@ -563,7 +563,7 @@ func (iDB *InternalDB) GetTPDispatcherHosts(tpid, tenant, id string) (dpps []*ut return } -//implement LoadWriter interface +// implement LoadWriter interface func (iDB *InternalDB) RemTpData(table, tpid string, args map[string]string) (err error) { if table == utils.EmptyString { return iDB.Flush(utils.EmptyString) @@ -814,7 +814,7 @@ func (iDB *InternalDB) SetTPDispatcherHosts(dpps []*utils.TPDispatcherHost) (err return } -//implement CdrStorage interface +// implement CdrStorage interface func (iDB *InternalDB) SetCDR(cdr *CDR, allowUpdate bool) (err error) { if cdr.OrderID == 0 { cdr.OrderID = iDB.cnter.Next() diff --git a/engine/storage_mongo_datadb.go b/engine/storage_mongo_datadb.go index fb4de5102..14cad0dc0 100644 --- a/engine/storage_mongo_datadb.go +++ b/engine/storage_mongo_datadb.go @@ -1810,7 +1810,7 @@ func (ms *MongoStorage) GetDispatcherHostDrv(tenant, id string) (r *DispatcherHo if err := cur.Decode(r); err != nil { r = nil if err == mongo.ErrNoDocuments { - return utils.ErrDSPHostNotFound + return utils.ErrDSPHostNotFound } return err } diff --git a/engine/storage_mongo_stordb.go b/engine/storage_mongo_stordb.go index 7853ddd45..7d0e484c2 100644 --- a/engine/storage_mongo_stordb.go +++ b/engine/storage_mongo_stordb.go @@ -983,7 +983,7 @@ func (ms *MongoStorage) cleanEmptyFilters(filters bson.M) { } } -// _, err := col(ColCDRs).UpdateAll(bson.M{CGRIDLow: bson.M{"$in": cgrIds}}, bson.M{"$set": bson.M{"deleted_at": time.Now()}}) +// _, err := col(ColCDRs).UpdateAll(bson.M{CGRIDLow: bson.M{"$in": cgrIds}}, bson.M{"$set": bson.M{"deleted_at": time.Now()}}) func (ms *MongoStorage) GetCDRs(qryFltr *utils.CDRsFilter, remove bool) ([]*CDR, int64, error) { var minUsage, maxUsage *time.Duration if len(qryFltr.MinUsage) != 0 { diff --git a/engine/timespans.go b/engine/timespans.go index 838577da3..5e7e9b50a 100644 --- a/engine/timespans.go +++ b/engine/timespans.go @@ -417,7 +417,7 @@ func (ts *TimeSpan) GetDuration() time.Duration { return ts.TimeEnd.Sub(ts.TimeStart) } -//Returns the duration of a unitary timespan in a compressed set +// Returns the duration of a unitary timespan in a compressed set func (ts *TimeSpan) GetUnitDuration() time.Duration { return time.Duration(int(ts.TimeEnd.Sub(ts.TimeStart)) / ts.GetCompressFactor()) } diff --git a/engine/z_resources_test.go b/engine/z_resources_test.go index f3f82fa00..7d22064ee 100644 --- a/engine/z_resources_test.go +++ b/engine/z_resources_test.go @@ -1335,7 +1335,7 @@ func TestResourceMatchingResourcesForEvent(t *testing.T) { } } -//UsageTTL 0 in ResourceProfile and give 10s duration +// UsageTTL 0 in ResourceProfile and give 10s duration func TestResourceUsageTTLCase1(t *testing.T) { resprf := &ResourceProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, @@ -1435,7 +1435,7 @@ func TestResourceUsageTTLCase1(t *testing.T) { } } -//UsageTTL 5s in ResourceProfile and give nil duration +// UsageTTL 5s in ResourceProfile and give nil duration func TestResourceUsageTTLCase2(t *testing.T) { resprf := []*ResourceProfile{ { @@ -1641,7 +1641,7 @@ func TestResourceUsageTTLCase2(t *testing.T) { } } -//UsageTTL 5s in ResourceProfile and give 0 duration +// UsageTTL 5s in ResourceProfile and give 0 duration func TestResourceUsageTTLCase3(t *testing.T) { resprf := &ResourceProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, @@ -1734,7 +1734,7 @@ func TestResourceUsageTTLCase3(t *testing.T) { } } -//UsageTTL 5s in ResourceProfile and give 10s duration +// UsageTTL 5s in ResourceProfile and give 10s duration func TestResourceUsageTTLCase4(t *testing.T) { resprf := &ResourceProfile{ Tenant: config.CgrConfig().GeneralCfg().DefaultTenant, diff --git a/engine/z_versions_it_test.go b/engine/z_versions_it_test.go index 8c27b4bd8..9f2b00e05 100644 --- a/engine/z_versions_it_test.go +++ b/engine/z_versions_it_test.go @@ -257,8 +257,8 @@ func testVersionsWithEngine(t *testing.T) { } } -//Tests for DataDB -//We do a test for each version field in order to test them as a unit and not at as a whole. +// Tests for DataDB +// We do a test for each version field in order to test them as a unit and not at as a whole. func testUpdateVersionsAccounts(t *testing.T) { newVersions := CurrentDataDBVersions() newVersions[utils.Accounts] = 2 @@ -658,7 +658,7 @@ func testUpdateVersionsTiming(t *testing.T) { } } -//Tests for StorDB +// Tests for StorDB func testUpdateVersionsCostDetails(t *testing.T) { newVersions := CurrentStorDBVersions() newVersions[utils.CostDetails] = 1 diff --git a/ers/sql_it_test.go b/ers/sql_it_test.go index e34e0f94c..853853c41 100644 --- a/ers/sql_it_test.go +++ b/ers/sql_it_test.go @@ -698,16 +698,16 @@ func TestErsSqlPostCDRS(t *testing.T) { logger.Default = tmp } -// type mockDialector interface { -// Name() string -// Initialize(*gorm.DB) error -// Migrator(db *gorm.DB) gorm.Migrator -// DataTypeOf(*schema.Field) string -// DefaultValueOf(*schema.Field) clause.Expression -// BindVarTo(writer clause.Writer, stmt *Statement, v interface{}) -// QuoteTo(clause.Writer, string) -// Explain(sql string, vars ...interface{}) string -// } +// type mockDialector interface { +// Name() string +// Initialize(*gorm.DB) error +// Migrator(db *gorm.DB) gorm.Migrator +// DataTypeOf(*schema.Field) string +// DefaultValueOf(*schema.Field) clause.Expression +// BindVarTo(writer clause.Writer, stmt *Statement, v interface{}) +// QuoteTo(clause.Writer, string) +// Explain(sql string, vars ...interface{}) string +// } type mockDialect struct{} func (mockDialect) Name() string { return "" } diff --git a/general_tests/accounts_it_test.go b/general_tests/accounts_it_test.go index a6b05c06f..9e85e7bd5 100644 --- a/general_tests/accounts_it_test.go +++ b/general_tests/accounts_it_test.go @@ -235,7 +235,7 @@ func testV1AccMonthly(t *testing.T) { } -//Add test to check if AccountS send event to ThresholdS +// Add test to check if AccountS send event to ThresholdS func testV1AccSendToThreshold(t *testing.T) { var reply string diff --git a/general_tests/cacherpl_filter_update_it_test.go b/general_tests/cacherpl_filter_update_it_test.go index 986568b0e..3bcfaa102 100644 --- a/general_tests/cacherpl_filter_update_it_test.go +++ b/general_tests/cacherpl_filter_update_it_test.go @@ -100,7 +100,7 @@ func TestFilterUpdateIT(t *testing.T) { } } -//Init Config +// Init Config func testFilterUpdateInitCfg(t *testing.T) { fltrUpdateCfgPath1 = path.Join(*dataDir, "conf", "samples", "cache_replicate", fltrUpdateCfgDIR1) if fltrUpdateCfg1, err = config.NewCGRConfigFromPath(fltrUpdateCfgPath1); err != nil { diff --git a/general_tests/cdrs_it_test.go b/general_tests/cdrs_it_test.go index a4ae20960..1b7c31a80 100644 --- a/general_tests/cdrs_it_test.go +++ b/general_tests/cdrs_it_test.go @@ -228,7 +228,7 @@ func testV2CDRsGetCdrs(t *testing.T) { } } -//Disable Attributes process +// Disable Attributes process func testV2CDRsProcessCDR2(t *testing.T) { args := &engine.ArgV1ProcessEvent{ Flags: []string{"*attributes:false", utils.MetaRALs}, @@ -301,7 +301,7 @@ func testV2CDRsGetCdrs2(t *testing.T) { } } -//Disable Attributes and Charger process +// Disable Attributes and Charger process func testV2CDRsProcessCDR3(t *testing.T) { args := &engine.ArgV1ProcessEvent{ Flags: []string{"*attributes:false", "*chargers:false"}, diff --git a/general_tests/cgrloader_it_test.go b/general_tests/cgrloader_it_test.go index d40a9e600..7095eac03 100644 --- a/general_tests/cgrloader_it_test.go +++ b/general_tests/cgrloader_it_test.go @@ -52,7 +52,7 @@ var ( } ) -//Test start here +// Test start here func TestCGRLoader(t *testing.T) { if !*loaderGoogleSheet { t.SkipNow() diff --git a/general_tests/doubleremove_it_test.go b/general_tests/doubleremove_it_test.go index ec94d2b76..927d8931f 100644 --- a/general_tests/doubleremove_it_test.go +++ b/general_tests/doubleremove_it_test.go @@ -54,7 +54,7 @@ var ( } ) -//Test start here +// Test start here func TestDoubleRemoveIT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/general_tests/filtered_replication_it_test.go b/general_tests/filtered_replication_it_test.go index 4a97ef74c..638353fed 100644 --- a/general_tests/filtered_replication_it_test.go +++ b/general_tests/filtered_replication_it_test.go @@ -72,7 +72,7 @@ var ( } ) -//Test start here +// Test start here func TestFilteredReplication(t *testing.T) { switch *dbType { case utils.MetaMySQL: diff --git a/general_tests/gocs_it_test.go b/general_tests/gocs_it_test.go index 369eec042..eb8fe3856 100644 --- a/general_tests/gocs_it_test.go +++ b/general_tests/gocs_it_test.go @@ -68,7 +68,7 @@ func TestGOCSIT(t *testing.T) { } } -//Init Config +// Init Config func testGOCSInitCfg(t *testing.T) { auCfgPath = path.Join(*dataDir, "conf", "samples", "gocs", "au_site") if auCfg, err = config.NewCGRConfigFromPath(auCfgPath); err != nil { diff --git a/general_tests/libengine_it_test.go b/general_tests/libengine_it_test.go index c5e708b7f..1ac0563cf 100644 --- a/general_tests/libengine_it_test.go +++ b/general_tests/libengine_it_test.go @@ -92,7 +92,6 @@ func testLibengITStartEngine(t *testing.T) { } } -// func testLibengITRPCConnection(t *testing.T) { cgrCfg := &config.RemoteHost{ ID: "a4f3f", diff --git a/general_tests/resourcesv1_it_test.go b/general_tests/resourcesv1_it_test.go index 77acd49bd..5697e36b8 100644 --- a/general_tests/resourcesv1_it_test.go +++ b/general_tests/resourcesv1_it_test.go @@ -50,7 +50,7 @@ var ( } ) -//Test start here +// Test start here func TestRsV1IT(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/general_tests/rpcclient_it_test.go b/general_tests/rpcclient_it_test.go index badb8c0c9..f117061a3 100644 --- a/general_tests/rpcclient_it_test.go +++ b/general_tests/rpcclient_it_test.go @@ -54,7 +54,7 @@ var ( // configuration opts RemoteRALsAddr2 = "192.168.244.138:2012" ) -//subtests to be executed +// subtests to be executed var sTestRPCITLcl = []func(t *testing.T){ testRPCITLclInitCfg, testRPCITLclStartSecondEngine, diff --git a/general_tests/session_graceful_shutdown_it_test.go b/general_tests/session_graceful_shutdown_it_test.go index 02fba2aaa..e4d9d4d05 100644 --- a/general_tests/session_graceful_shutdown_it_test.go +++ b/general_tests/session_graceful_shutdown_it_test.go @@ -83,7 +83,7 @@ func TestSessionSRplcGracefulShutdown(t *testing.T) { } } -//Init Config +// Init Config func testSessionSRplcInitCfg(t *testing.T) { smgRplcCfgPath1 = path.Join(*dataDir, "conf", "samples", "sessions_replication", smgRplcCfgDIR1) if smgRplCfg1, err = config.NewCGRConfigFromPath(smgRplcCfgPath1); err != nil { diff --git a/general_tests/session_replications_automaticdebit_it_test.go b/general_tests/session_replications_automaticdebit_it_test.go index d2045f663..6cb51cf37 100644 --- a/general_tests/session_replications_automaticdebit_it_test.go +++ b/general_tests/session_replications_automaticdebit_it_test.go @@ -76,7 +76,7 @@ func TestSessionSRpl(t *testing.T) { } } -//topup +// topup func testSessionSRplAddVoiceBalance(t *testing.T) { attrSetBalance := utils.AttrSetBalance{ Tenant: "cgrates.org", @@ -108,7 +108,7 @@ func testSessionSRplAddVoiceBalance(t *testing.T) { } } -//Init Config +// Init Config func testSessionSRplInitCfg(t *testing.T) { smgRplcMasterCfgPath = path.Join(*dataDir, "conf", "samples", "sessions_replication", smgRplcMasterCfgDIR) if smgRplcMasterCfg, err = config.NewCGRConfigFromPath(smgRplcMasterCfgPath); err != nil { diff --git a/general_tests/tutorial2_it_test.go b/general_tests/tutorial2_it_test.go index 82c126bfe..68e7066c4 100644 --- a/general_tests/tutorial2_it_test.go +++ b/general_tests/tutorial2_it_test.go @@ -53,7 +53,7 @@ var sTutTests = []func(t *testing.T){ testTutStopEngine, } -//Test start here +// Test start here func TestTutorial2(t *testing.T) { switch *dbType { case utils.MetaInternal: diff --git a/general_tests/tutorial_calls_test.go b/general_tests/tutorial_calls_test.go index 61d96ae34..c4f381599 100644 --- a/general_tests/tutorial_calls_test.go +++ b/general_tests/tutorial_calls_test.go @@ -84,7 +84,7 @@ var sTestsCalls = []func(t *testing.T){ testCallStopFS, } -//Test start here +// Test start here func TestFreeswitchCalls(t *testing.T) { optConf = utils.Freeswitch for _, stest := range sTestsCalls { diff --git a/general_tests/tutorial_it_test.go b/general_tests/tutorial_it_test.go index ef8648a5a..12376570d 100644 --- a/general_tests/tutorial_it_test.go +++ b/general_tests/tutorial_it_test.go @@ -53,7 +53,7 @@ var ( } ) -//Test start here +// Test start here func TestTutorialMongoAtlas(t *testing.T) { if !*itTestMongoAtalas { return diff --git a/loaders/loader.go b/loaders/loader.go index 50b737f66..dda6c1b17 100644 --- a/loaders/loader.go +++ b/loaders/loader.go @@ -214,7 +214,7 @@ func (ldr *Loader) processFiles(loaderType, caching, loadOption string) (err err return } -//processContent will process the contect and will store it into database +// processContent will process the contect and will store it into database func (ldr *Loader) processContent(loaderType, caching string) (err error) { // start processing lines keepLooping := true // controls looping @@ -562,7 +562,7 @@ func (ldr *Loader) storeLoadedData(loaderType string, return } -//removeContent will process the content and will remove it from database +// removeContent will process the content and will remove it from database func (ldr *Loader) removeContent(loaderType, caching string) (err error) { // start processing lines keepLooping := true // controls looping @@ -629,8 +629,8 @@ func (ldr *Loader) removeContent(loaderType, caching string) (err error) { return } -//removeLoadedData will remove the data from database -//since we remove we don't need to compose the struct we only need the Tenant and the ID of the profile +// removeLoadedData will remove the data from database +// since we remove we don't need to compose the struct we only need the Tenant and the ID of the profile func (ldr *Loader) removeLoadedData(loaderType string, lds map[string][]LoaderData, caching string) (err error) { var ids []string cacheArgs := make(map[string][]string) diff --git a/migrator/load_ids.go b/migrator/load_ids.go index 28c29656b..830565d18 100644 --- a/migrator/load_ids.go +++ b/migrator/load_ids.go @@ -23,7 +23,6 @@ import ( "github.com/cgrates/cgrates/utils" ) -// func (m *Migrator) migrateLoadIDs() (err error) { var vrs engine.Versions if vrs, err = m.getVersions(utils.LoadIDsVrs); err != nil { diff --git a/migrator/storage_map_datadb.go b/migrator/storage_map_datadb.go index 6ca4489e9..582fe2664 100644 --- a/migrator/storage_map_datadb.go +++ b/migrator/storage_map_datadb.go @@ -39,100 +39,100 @@ func (iDBMig *internalMigrator) DataManager() *engine.DataManager { return iDBMig.dm } -//Account methods -//V1 -//get +// Account methods +// V1 +// get func (iDBMig *internalMigrator) getv1Account() (v1Acnt *v1Account, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1Account(x *v1Account) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1Account(id string) (err error) { return utils.ErrNotImplemented } -//V2 -//get +// V2 +// get func (iDBMig *internalMigrator) getv2Account() (v2Acnt *v2Account, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV2Account(x *v2Account) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV2Account(id string) (err error) { return utils.ErrNotImplemented } -//ActionPlans methods -//get +// ActionPlans methods +// get func (iDBMig *internalMigrator) getV1ActionPlans() (v1aps *v1ActionPlans, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1ActionPlans(x *v1ActionPlans) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1ActionPlans(x *v1ActionPlans) (err error) { return utils.ErrNotImplemented } -//Actions methods -//get +// Actions methods +// get func (iDBMig *internalMigrator) getV1Actions() (v1acs *v1Actions, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1Actions(x *v1Actions) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1Actions(x v1Actions) (err error) { return utils.ErrNotImplemented } -//ActionTriggers methods -//get +// ActionTriggers methods +// get func (iDBMig *internalMigrator) getV1ActionTriggers() (v1acts *v1ActionTriggers, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1ActionTriggers(x *v1ActionTriggers) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1ActionTriggers(x *v1ActionTriggers) (err error) { return utils.ErrNotImplemented } -//SharedGroup methods -//get +// SharedGroup methods +// get func (iDBMig *internalMigrator) getV1SharedGroup() (v1sg *v1SharedGroup, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1SharedGroup(x *v1SharedGroup) (err error) { return utils.ErrNotImplemented } -//Stats methods -//get +// Stats methods +// get func (iDBMig *internalMigrator) getV1Stats() (v1st *v1Stat, err error) { return nil, utils.ErrNotImplemented } @@ -141,7 +141,7 @@ func (iDBMig *internalMigrator) getV3Stats() (v1st *engine.StatQueueProfile, err return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1Stats(x *v1Stat) (err error) { return utils.ErrNotImplemented } @@ -150,35 +150,35 @@ func (iDBMig *internalMigrator) getV2Stats() (v2 *engine.StatQueue, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV2Stats(v2 *engine.StatQueue) (err error) { return utils.ErrNotImplemented } -//Action methods -//get +// Action methods +// get func (iDBMig *internalMigrator) getV2ActionTrigger() (v2at *v2ActionTrigger, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV2ActionTrigger(x *v2ActionTrigger) (err error) { return utils.ErrNotImplemented } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (iDBMig *internalMigrator) getV1AttributeProfile() (v1attrPrf *v1AttributeProfile, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1AttributeProfile(x *v1AttributeProfile) (err error) { return utils.ErrNotImplemented } -//ThresholdProfile methods -//get +// ThresholdProfile methods +// get func (iDBMig *internalMigrator) getV2ThresholdProfile() (v2T *v2Threshold, err error) { return nil, utils.ErrNotImplemented } @@ -187,98 +187,98 @@ func (iDBMig *internalMigrator) getV3ThresholdProfile() (v2T *engine.ThresholdPr return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV2ThresholdProfile(x *v2Threshold) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV2ThresholdProfile(tenant, id string) (err error) { return utils.ErrNotImplemented } -//Alias methods -//get +// Alias methods +// get func (iDBMig *internalMigrator) getV1Alias() (v1a *v1Alias, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1Alias(al *v1Alias) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1Alias(key string) (err error) { return utils.ErrNotImplemented } // User methods -//get +// get func (iDBMig *internalMigrator) getV1User() (v1u *v1UserProfile, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1User(us *v1UserProfile) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1User(key string) (err error) { return utils.ErrNotImplemented } // DerivedChargers methods -//get +// get func (iDBMig *internalMigrator) getV1DerivedChargers() (v1d *v1DerivedChargersWithKey, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1DerivedChargers(dc *v1DerivedChargersWithKey) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1DerivedChargers(key string) (err error) { return utils.ErrNotImplemented } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (iDBMig *internalMigrator) getV2AttributeProfile() (v2attrPrf *v2AttributeProfile, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV2AttributeProfile(x *v2AttributeProfile) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV2AttributeProfile(tenant, id string) (err error) { return utils.ErrNotImplemented } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (iDBMig *internalMigrator) getV3AttributeProfile() (v3attrPrf *v3AttributeProfile, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV3AttributeProfile(x *v3AttributeProfile) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV3AttributeProfile(tenant, id string) (err error) { return utils.ErrNotImplemented } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (iDBMig *internalMigrator) getV4AttributeProfile() (v4attrPrf *v4AttributeProfile, err error) { return nil, utils.ErrNotImplemented } @@ -286,18 +286,18 @@ func (iDBMig *internalMigrator) getV5AttributeProfile() (v4attrPrf *engine.Attri return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV4AttributeProfile(x *v4AttributeProfile) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV4AttributeProfile(tenant, id string) (err error) { return utils.ErrNotImplemented } // Filter Methods -//get +// get func (iDBMig *internalMigrator) getV1Filter() (v1Fltr *v1Filter, err error) { return nil, utils.ErrNotImplemented } @@ -306,28 +306,28 @@ func (iDBMig *internalMigrator) getV4Filter() (v1Fltr *engine.Filter, err error) return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setV1Filter(x *v1Filter) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remV1Filter(tenant, id string) (err error) { return utils.ErrNotImplemented } // Supplier Methods -//get +// get func (iDBMig *internalMigrator) getSupplier() (spl *SupplierProfile, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalMigrator) setSupplier(spl *SupplierProfile) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalMigrator) remSupplier(tenant, id string) (err error) { return utils.ErrNotImplemented } diff --git a/migrator/storage_map_stordb.go b/migrator/storage_map_stordb.go index 772fac967..907f8b5f0 100644 --- a/migrator/storage_map_stordb.go +++ b/migrator/storage_map_stordb.go @@ -41,24 +41,24 @@ func (iDBMig *internalStorDBMigrator) StorDB() engine.StorDB { return *iDBMig.storDB } -//CDR methods -//get +// CDR methods +// get func (iDBMig *internalStorDBMigrator) getV1CDR() (v1Cdr *v1Cdrs, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalStorDBMigrator) setV1CDR(v1Cdr *v1Cdrs) (err error) { return utils.ErrNotImplemented } -//rem +// rem func (iDBMig *internalStorDBMigrator) remV1CDRs(v1Cdr *v1Cdrs) (err error) { return utils.ErrNotImplemented } -//SMCost methods -//rename +// SMCost methods +// rename func (iDBMig *internalStorDBMigrator) renameV1SMCosts() (err error) { return utils.ErrNotImplemented } @@ -67,17 +67,17 @@ func (iDBMig *internalStorDBMigrator) createV1SMCosts() (err error) { return utils.ErrNotImplemented } -//get +// get func (iDBMig *internalStorDBMigrator) getV2SMCost() (v2Cost *v2SessionsCost, err error) { return nil, utils.ErrNotImplemented } -//set +// set func (iDBMig *internalStorDBMigrator) setV2SMCost(v2Cost *v2SessionsCost) (err error) { return utils.ErrNotImplemented } -//remove +// remove func (iDBMig *internalStorDBMigrator) remV2SMCost(v2Cost *v2SessionsCost) (err error) { return utils.ErrNotImplemented } diff --git a/migrator/storage_mongo_datadb.go b/migrator/storage_mongo_datadb.go index 24054c9ec..55b255d13 100644 --- a/migrator/storage_mongo_datadb.go +++ b/migrator/storage_mongo_datadb.go @@ -68,9 +68,9 @@ func (v1ms *mongoMigrator) DataManager() *engine.DataManager { return v1ms.dm } -//Account methods -//V1 -//get +// Account methods +// V1 +// get func (v1ms *mongoMigrator) getv1Account() (v1Acnt *v1Account, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1AccountDBPrefix).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -90,7 +90,7 @@ func (v1ms *mongoMigrator) getv1Account() (v1Acnt *v1Account, err error) { return v1Acnt, nil } -//set +// set func (v1ms *mongoMigrator) setV1Account(x *v1Account) (err error) { if x != nil { _, err = v1ms.mgoDB.DB().Collection(v1AccountDBPrefix).InsertOne(v1ms.mgoDB.GetContext(), x) @@ -98,14 +98,14 @@ func (v1ms *mongoMigrator) setV1Account(x *v1Account) (err error) { return } -//rem +// rem func (v1ms *mongoMigrator) remV1Account(id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AccountDBPrefix).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"id": id}) return } -//V2 -//get +// V2 +// get func (v1ms *mongoMigrator) getv2Account() (v2Acnt *v2Account, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v2AccountsCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -125,7 +125,7 @@ func (v1ms *mongoMigrator) getv2Account() (v2Acnt *v2Account, err error) { return v2Acnt, nil } -//set +// set func (v1ms *mongoMigrator) setV2Account(x *v2Account) (err error) { if x != nil { _, err = v1ms.mgoDB.DB().Collection(v2AccountsCol).InsertOne(v1ms.mgoDB.GetContext(), x) @@ -133,14 +133,14 @@ func (v1ms *mongoMigrator) setV2Account(x *v2Account) (err error) { return } -//rem +// rem func (v1ms *mongoMigrator) remV2Account(id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v2AccountsCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"id": id}) return } -//Action methods -//get +// Action methods +// get func (v1ms *mongoMigrator) getV1ActionPlans() (v1aps *v1ActionPlans, err error) { strct := new(AtKeyValue) if v1ms.cursor == nil { @@ -160,14 +160,14 @@ func (v1ms *mongoMigrator) getV1ActionPlans() (v1aps *v1ActionPlans, err error) return &strct.Value, nil } -//set +// set func (v1ms *mongoMigrator) setV1ActionPlans(x *v1ActionPlans) (err error) { key := utils.ActionPlanPrefix + (*x)[0].Id _, err = v1ms.mgoDB.DB().Collection("actiontimings").InsertOne(v1ms.mgoDB.GetContext(), &AtKeyValue{key, *x}) return } -//rem +// rem func (v1ms *mongoMigrator) remV1ActionPlans(x *v1ActionPlans) (err error) { for _, item := range *x { _, err = v1ms.mgoDB.DB().Collection("actiontimings").DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"id": item.Id}) @@ -176,8 +176,8 @@ func (v1ms *mongoMigrator) remV1ActionPlans(x *v1ActionPlans) (err error) { return } -//Actions methods -//get +// Actions methods +// get func (v1ms *mongoMigrator) getV1Actions() (v1acs *v1Actions, err error) { strct := new(AcKeyValue) if v1ms.cursor == nil { @@ -197,21 +197,21 @@ func (v1ms *mongoMigrator) getV1Actions() (v1acs *v1Actions, err error) { return &strct.Value, nil } -//set +// set func (v1ms *mongoMigrator) setV1Actions(x *v1Actions) (err error) { key := utils.ActionPrefix + (*x)[0].Id _, err = v1ms.mgoDB.DB().Collection("actions").InsertOne(v1ms.mgoDB.GetContext(), &AcKeyValue{key, *x}) return } -//rem +// rem func (v1ms *mongoMigrator) remV1Actions(x v1Actions) (err error) { _, err = v1ms.mgoDB.DB().Collection("actions").DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"id": x[0].Id}) return } -//ActionTriggers methods -//get +// ActionTriggers methods +// get func (v1ms *mongoMigrator) getV1ActionTriggers() (v1acts *v1ActionTriggers, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1ActionTriggersCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -231,7 +231,7 @@ func (v1ms *mongoMigrator) getV1ActionTriggers() (v1acts *v1ActionTriggers, err return &v1ActionTriggers{v1act}, nil } -//set +// set func (v1ms *mongoMigrator) setV1ActionTriggers(act *v1ActionTriggers) (err error) { for _, x := range *act { _, err = v1ms.mgoDB.DB().Collection(v1ActionTriggersCol).InsertOne(v1ms.mgoDB.GetContext(), *x) @@ -242,7 +242,7 @@ func (v1ms *mongoMigrator) setV1ActionTriggers(act *v1ActionTriggers) (err error return } -//rem +// rem func (v1ms *mongoMigrator) remV1ActionTriggers(x *v1ActionTriggers) (err error) { for _, item := range *x { _, err = v1ms.mgoDB.DB().Collection(v1ActionTriggersCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"id": item.Id}) @@ -251,8 +251,8 @@ func (v1ms *mongoMigrator) remV1ActionTriggers(x *v1ActionTriggers) (err error) return } -//Actions methods -//get +// Actions methods +// get func (v1ms *mongoMigrator) getV1SharedGroup() (v1sg *v1SharedGroup, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(utils.SharedGroupPrefix).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -272,14 +272,14 @@ func (v1ms *mongoMigrator) getV1SharedGroup() (v1sg *v1SharedGroup, err error) { return v1sg, nil } -//set +// set func (v1ms *mongoMigrator) setV1SharedGroup(x *v1SharedGroup) (err error) { _, err = v1ms.mgoDB.DB().Collection(utils.SharedGroupPrefix).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//Stats methods -//get +// Stats methods +// get func (v1ms *mongoMigrator) getV1Stats() (v1st *v1Stat, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(utils.CDRsStatsPrefix).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -318,7 +318,7 @@ func (v1ms *mongoMigrator) getV3Stats() (v1st *engine.StatQueueProfile, err erro return v1st, nil } -//set +// set func (v1ms *mongoMigrator) setV1Stats(x *v1Stat) (err error) { _, err = v1ms.mgoDB.DB().Collection(utils.CDRsStatsPrefix).InsertOne(v1ms.mgoDB.GetContext(), x) return @@ -350,8 +350,8 @@ func (v1ms *mongoMigrator) setV2Stats(v2 *engine.StatQueue) (err error) { return } -//Stats methods -//get +// Stats methods +// get func (v1ms *mongoMigrator) getV2ActionTrigger() (v2at *v2ActionTrigger, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1ActionTriggersCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -371,14 +371,14 @@ func (v1ms *mongoMigrator) getV2ActionTrigger() (v2at *v2ActionTrigger, err erro return v2at, nil } -//set +// set func (v1ms *mongoMigrator) setV2ActionTrigger(x *v2ActionTrigger) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1ActionTriggersCol).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1ms *mongoMigrator) getV1AttributeProfile() (v1attrPrf *v1AttributeProfile, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -398,14 +398,14 @@ func (v1ms *mongoMigrator) getV1AttributeProfile() (v1attrPrf *v1AttributeProfil return v1attrPrf, nil } -//set +// set func (v1ms *mongoMigrator) setV1AttributeProfile(x *v1AttributeProfile) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//ThresholdProfile methods -//get +// ThresholdProfile methods +// get func (v1ms *mongoMigrator) getV2ThresholdProfile() (v2T *v2Threshold, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v2ThresholdProfileCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -444,20 +444,20 @@ func (v1ms *mongoMigrator) getV3ThresholdProfile() (v2T *engine.ThresholdProfile return v2T, nil } -//set +// set func (v1ms *mongoMigrator) setV2ThresholdProfile(x *v2Threshold) (err error) { _, err = v1ms.mgoDB.DB().Collection(v2ThresholdProfileCol).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//rem +// rem func (v1ms *mongoMigrator) remV2ThresholdProfile(tenant, id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v2ThresholdProfileCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"tenant": tenant, "id": id}) return } -//Alias methods -//get +// Alias methods +// get func (v1ms *mongoMigrator) getV1Alias() (v1a *v1Alias, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1AliasCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -483,7 +483,7 @@ func (v1ms *mongoMigrator) getV1Alias() (v1a *v1Alias, err error) { return v1a, nil } -//set +// set func (v1ms *mongoMigrator) setV1Alias(al *v1Alias) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AliasCol).UpdateOne(v1ms.mgoDB.GetContext(), bson.M{"key": al.GetId()}, bson.M{"$set": struct { @@ -495,7 +495,7 @@ func (v1ms *mongoMigrator) setV1Alias(al *v1Alias) (err error) { return err } -//rem +// rem func (v1ms *mongoMigrator) remV1Alias(key string) (err error) { al := new(v1Alias) al.SetId(key) @@ -535,7 +535,7 @@ func (v1ms *mongoMigrator) remV1Alias(key string) (err error) { } // User methods -//get +// get func (v1ms *mongoMigrator) getV1User() (v1u *v1UserProfile, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1UserCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -558,7 +558,7 @@ func (v1ms *mongoMigrator) getV1User() (v1u *v1UserProfile, err error) { return kv.Value, nil } -//set +// set func (v1ms *mongoMigrator) setV1User(us *v1UserProfile) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1UserCol).UpdateOne(v1ms.mgoDB.GetContext(), bson.M{"key": us.GetId()}, bson.M{"$set": struct { @@ -570,14 +570,14 @@ func (v1ms *mongoMigrator) setV1User(us *v1UserProfile) (err error) { return err } -//rem +// rem func (v1ms *mongoMigrator) remV1User(key string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1UserCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"key": key}) return } // DerivedChargers methods -//get +// get func (v1ms *mongoMigrator) getV1DerivedChargers() (v1d *v1DerivedChargersWithKey, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1DerivedChargersCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -597,7 +597,7 @@ func (v1ms *mongoMigrator) getV1DerivedChargers() (v1d *v1DerivedChargersWithKey return v1d, nil } -//set +// set func (v1ms *mongoMigrator) setV1DerivedChargers(dc *v1DerivedChargersWithKey) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1DerivedChargersCol).UpdateOne(v1ms.mgoDB.GetContext(), bson.M{"key": dc.Key}, bson.M{"$set": dc}, @@ -606,14 +606,14 @@ func (v1ms *mongoMigrator) setV1DerivedChargers(dc *v1DerivedChargersWithKey) (e return } -//rem +// rem func (v1ms *mongoMigrator) remV1DerivedChargers(key string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1DerivedChargersCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"key": key}) return } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1ms *mongoMigrator) getV2AttributeProfile() (v2attrPrf *v2AttributeProfile, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -633,20 +633,20 @@ func (v1ms *mongoMigrator) getV2AttributeProfile() (v2attrPrf *v2AttributeProfil return v2attrPrf, nil } -//set +// set func (v1ms *mongoMigrator) setV2AttributeProfile(x *v2AttributeProfile) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//rem +// rem func (v1ms *mongoMigrator) remV2AttributeProfile(tenant, id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"tenant": tenant, "id": id}) return } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1ms *mongoMigrator) getV3AttributeProfile() (v3attrPrf *v3AttributeProfile, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -666,20 +666,20 @@ func (v1ms *mongoMigrator) getV3AttributeProfile() (v3attrPrf *v3AttributeProfil return v3attrPrf, nil } -//set +// set func (v1ms *mongoMigrator) setV3AttributeProfile(x *v3AttributeProfile) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//rem +// rem func (v1ms *mongoMigrator) remV3AttributeProfile(tenant, id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"tenant": tenant, "id": id}) return } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1ms *mongoMigrator) getV4AttributeProfile() (v4attrPrf *v4AttributeProfile, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -718,20 +718,20 @@ func (v1ms *mongoMigrator) getV5AttributeProfile() (v5attrPrf *engine.AttributeP return v5attrPrf, nil } -//set +// set func (v1ms *mongoMigrator) setV4AttributeProfile(x *v4AttributeProfile) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//rem +// rem func (v1ms *mongoMigrator) remV4AttributeProfile(tenant, id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(v1AttributeProfilesCol).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"tenant": tenant, "id": id}) return } // Filter Methods -//get +// get func (v1ms *mongoMigrator) getV1Filter() (v1Fltr *v1Filter, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(engine.ColFlt).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -770,20 +770,20 @@ func (v1ms *mongoMigrator) getV4Filter() (v4Fltr *engine.Filter, err error) { return } -//set +// set func (v1ms *mongoMigrator) setV1Filter(x *v1Filter) (err error) { _, err = v1ms.mgoDB.DB().Collection(engine.ColFlt).InsertOne(v1ms.mgoDB.GetContext(), x) return } -//rem +// rem func (v1ms *mongoMigrator) remV1Filter(tenant, id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(engine.ColFlt).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"tenant": tenant, "id": id}) return } // Supplier Methods -//get +// get func (v1ms *mongoMigrator) getSupplier() (spl *SupplierProfile, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(ColSpp).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -803,13 +803,13 @@ func (v1ms *mongoMigrator) getSupplier() (spl *SupplierProfile, err error) { return } -//set +// set func (v1ms *mongoMigrator) setSupplier(spl *SupplierProfile) (err error) { _, err = v1ms.mgoDB.DB().Collection(ColSpp).InsertOne(v1ms.mgoDB.GetContext(), spl) return } -//rem +// rem func (v1ms *mongoMigrator) remSupplier(tenant, id string) (err error) { _, err = v1ms.mgoDB.DB().Collection(ColSpp).DeleteOne(v1ms.mgoDB.GetContext(), bson.M{"tenant": tenant, "id": id}) return diff --git a/migrator/storage_mongo_stordb.go b/migrator/storage_mongo_stordb.go index 655358c67..a419ba6db 100644 --- a/migrator/storage_mongo_stordb.go +++ b/migrator/storage_mongo_stordb.go @@ -47,8 +47,8 @@ func (mgoMig *mongoStorDBMigrator) StorDB() engine.StorDB { return *mgoMig.storDB } -//CDR methods -//get +// CDR methods +// get func (v1ms *mongoStorDBMigrator) getV1CDR() (v1Cdr *v1Cdrs, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(engine.ColCDRs).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -68,20 +68,20 @@ func (v1ms *mongoStorDBMigrator) getV1CDR() (v1Cdr *v1Cdrs, err error) { return v1Cdr, nil } -//set +// set func (v1ms *mongoStorDBMigrator) setV1CDR(v1Cdr *v1Cdrs) (err error) { _, err = v1ms.mgoDB.DB().Collection(engine.ColCDRs).InsertOne(v1ms.mgoDB.GetContext(), v1Cdr) return } -//rem +// rem func (v1ms *mongoStorDBMigrator) remV1CDRs(v1Cdr *v1Cdrs) (err error) { _, err = v1ms.mgoDB.DB().Collection(engine.ColCDRs).DeleteOne(v1ms.mgoDB.GetContext(), v1Cdr) return } -//SMCost methods -//rename +// SMCost methods +// rename func (v1ms *mongoStorDBMigrator) renameV1SMCosts() (err error) { if err = v1ms.mgoDB.DB().Collection(utils.OldSMCosts).Drop(v1ms.mgoDB.GetContext()); err != nil { return err @@ -97,7 +97,7 @@ func (v1ms *mongoStorDBMigrator) createV1SMCosts() (err error) { bson.D{{Key: "create", Value: utils.OldSMCosts}, {Key: "size", Value: 1024}, {Key: "capped", Value: true}}).Err() } -//get +// get func (v1ms *mongoStorDBMigrator) getV2SMCost() (v2Cost *v2SessionsCost, err error) { if v1ms.cursor == nil { v1ms.cursor, err = v1ms.mgoDB.DB().Collection(utils.SessionCostsTBL).Find(v1ms.mgoDB.GetContext(), bson.D{}) @@ -117,13 +117,13 @@ func (v1ms *mongoStorDBMigrator) getV2SMCost() (v2Cost *v2SessionsCost, err erro return v2Cost, nil } -//set +// set func (v1ms *mongoStorDBMigrator) setV2SMCost(v2Cost *v2SessionsCost) (err error) { _, err = v1ms.mgoDB.DB().Collection(utils.SessionCostsTBL).InsertOne(v1ms.mgoDB.GetContext(), v2Cost) return } -//remove +// remove func (v1ms *mongoStorDBMigrator) remV2SMCost(v2Cost *v2SessionsCost) (err error) { _, err = v1ms.mgoDB.DB().Collection(utils.SessionCostsTBL).DeleteMany(v1ms.mgoDB.GetContext(), bson.D{}) return diff --git a/migrator/storage_redis.go b/migrator/storage_redis.go index 0ee3eb0d7..d01a2303c 100644 --- a/migrator/storage_redis.go +++ b/migrator/storage_redis.go @@ -51,9 +51,9 @@ func (v1rs *redisMigrator) DataManager() *engine.DataManager { return v1rs.dm } -//Account methods -//V1 -//get +// Account methods +// V1 +// get func (v1rs *redisMigrator) getv1Account() (v1Acnt *v1Account, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(v1AccountDBPrefix) @@ -81,7 +81,7 @@ func (v1rs *redisMigrator) getv1Account() (v1Acnt *v1Account, err error) { return v1Acnt, nil } -//set +// set func (v1rs *redisMigrator) setV1Account(x *v1Account) (err error) { key := v1AccountDBPrefix + x.Id bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -94,14 +94,14 @@ func (v1rs *redisMigrator) setV1Account(x *v1Account) (err error) { return } -//rem +// rem func (v1rs *redisMigrator) remV1Account(id string) (err error) { key := v1AccountDBPrefix + id return v1rs.rds.Cmd(nil, "DEL", key) } -//V2 -//get +// V2 +// get func (v1rs *redisMigrator) getv2Account() (v2Acnt *v2Account, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.AccountPrefix) @@ -129,7 +129,7 @@ func (v1rs *redisMigrator) getv2Account() (v2Acnt *v2Account, err error) { return v2Acnt, nil } -//set +// set func (v1rs *redisMigrator) setV2Account(x *v2Account) (err error) { key := utils.AccountPrefix + x.ID bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -142,14 +142,14 @@ func (v1rs *redisMigrator) setV2Account(x *v2Account) (err error) { return } -//rem +// rem func (v1rs *redisMigrator) remV2Account(id string) (err error) { key := utils.AccountPrefix + id return v1rs.rds.Cmd(nil, "DEL", key) } -//ActionPlans methods -//get +// ActionPlans methods +// get func (v1rs *redisMigrator) getV1ActionPlans() (v1aps *v1ActionPlans, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.ActionPlanPrefix) @@ -176,7 +176,7 @@ func (v1rs *redisMigrator) getV1ActionPlans() (v1aps *v1ActionPlans, err error) return v1aps, nil } -//set +// set func (v1rs *redisMigrator) setV1ActionPlans(x *v1ActionPlans) (err error) { key := utils.ActionPlanPrefix + (*x)[0].Id bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -189,14 +189,14 @@ func (v1rs *redisMigrator) setV1ActionPlans(x *v1ActionPlans) (err error) { return } -//rem +// rem func (v1rs *redisMigrator) remV1ActionPlans(x *v1ActionPlans) (err error) { key := utils.ActionPlanPrefix + (*x)[0].Id return v1rs.rds.Cmd(nil, "DEL", key) } -//Actions methods -//get +// Actions methods +// get func (v1rs *redisMigrator) getV1Actions() (v1acs *v1Actions, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.ActionPrefix) @@ -223,7 +223,7 @@ func (v1rs *redisMigrator) getV1Actions() (v1acs *v1Actions, err error) { return v1acs, nil } -//set +// set func (v1rs *redisMigrator) setV1Actions(x *v1Actions) (err error) { key := utils.ActionPrefix + (*x)[0].Id bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -236,15 +236,15 @@ func (v1rs *redisMigrator) setV1Actions(x *v1Actions) (err error) { return } -//rem +// rem func (v1rs *redisMigrator) remV1Actions(x v1Actions) (err error) { key := utils.ActionPrefix + x[0].Id return v1rs.rds.Cmd(nil, "DEL", key) } -//ActionTriggers methods -//get +// ActionTriggers methods +// get func (v1rs *redisMigrator) getV1ActionTriggers() (v1acts *v1ActionTriggers, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.ActionTriggerPrefix) @@ -271,7 +271,7 @@ func (v1rs *redisMigrator) getV1ActionTriggers() (v1acts *v1ActionTriggers, err return v1acts, nil } -//set +// set func (v1rs *redisMigrator) setV1ActionTriggers(x *v1ActionTriggers) (err error) { key := utils.ActionTriggerPrefix + (*x)[0].Id bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -284,14 +284,14 @@ func (v1rs *redisMigrator) setV1ActionTriggers(x *v1ActionTriggers) (err error) return } -//rem +// rem func (v1rs *redisMigrator) remV1ActionTriggers(x *v1ActionTriggers) (err error) { key := utils.ActionTriggerPrefix + (*x)[0].Id return v1rs.rds.Cmd(nil, "DEL", key) } -//SharedGroup methods -//get +// SharedGroup methods +// get func (v1rs *redisMigrator) getV1SharedGroup() (v1sg *v1SharedGroup, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.SharedGroupPrefix) @@ -318,7 +318,7 @@ func (v1rs *redisMigrator) getV1SharedGroup() (v1sg *v1SharedGroup, err error) { return v1sg, nil } -//set +// set func (v1rs *redisMigrator) setV1SharedGroup(x *v1SharedGroup) (err error) { key := utils.SharedGroupPrefix + x.Id bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -331,8 +331,8 @@ func (v1rs *redisMigrator) setV1SharedGroup(x *v1SharedGroup) (err error) { return } -//Stats methods -//get +// Stats methods +// get func (v1rs *redisMigrator) getV1Stats() (v1st *v1Stat, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.CDRsStatsPrefix) @@ -385,7 +385,7 @@ func (v1rs *redisMigrator) getV3Stats() (v1st *engine.StatQueueProfile, err erro return v1st, nil } -//set +// set func (v1rs *redisMigrator) setV1Stats(x *v1Stat) (err error) { key := utils.CDRsStatsPrefix + x.Id bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -398,7 +398,7 @@ func (v1rs *redisMigrator) setV1Stats(x *v1Stat) (err error) { return } -//get +// get func (v1rs *redisMigrator) getV2Stats() (v2 *engine.StatQueue, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.StatQueuePrefix) @@ -425,7 +425,7 @@ func (v1rs *redisMigrator) getV2Stats() (v2 *engine.StatQueue, err error) { return v2, nil } -//set +// set func (v1rs *redisMigrator) setV2Stats(v2 *engine.StatQueue) (err error) { key := utils.StatQueuePrefix + v2.ID bit, err := v1rs.rds.Marshaler().Marshal(v2) @@ -438,8 +438,8 @@ func (v1rs *redisMigrator) setV2Stats(v2 *engine.StatQueue) (err error) { return } -//Action methods -//get +// Action methods +// get func (v1rs *redisMigrator) getV2ActionTrigger() (v2at *v2ActionTrigger, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.ActionTriggerPrefix) @@ -466,7 +466,7 @@ func (v1rs *redisMigrator) getV2ActionTrigger() (v2at *v2ActionTrigger, err erro return v2at, nil } -//set +// set func (v1rs *redisMigrator) setV2ActionTrigger(x *v2ActionTrigger) (err error) { key := utils.ActionTriggerPrefix + x.ID bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -479,8 +479,8 @@ func (v1rs *redisMigrator) setV2ActionTrigger(x *v2ActionTrigger) (err error) { return } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1rs *redisMigrator) getV1AttributeProfile() (v1attrPrf *v1AttributeProfile, err error) { var v1attr *v1AttributeProfile if v1rs.qryIdx == nil { @@ -508,7 +508,7 @@ func (v1rs *redisMigrator) getV1AttributeProfile() (v1attrPrf *v1AttributeProfil return v1attr, nil } -//set +// set func (v1rs *redisMigrator) setV1AttributeProfile(x *v1AttributeProfile) (err error) { key := utils.AttributeProfilePrefix + utils.ConcatenatedKey(x.Tenant, x.ID) bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -521,8 +521,8 @@ func (v1rs *redisMigrator) setV1AttributeProfile(x *v1AttributeProfile) (err err return } -//ThresholdProfile methods -//get +// ThresholdProfile methods +// get func (v1rs *redisMigrator) getV2ThresholdProfile() (v2T *v2Threshold, err error) { var v2Th *v2Threshold if v1rs.qryIdx == nil { @@ -576,7 +576,7 @@ func (v1rs *redisMigrator) getV3ThresholdProfile() (v2T *engine.ThresholdProfile return v2T, nil } -//set +// set func (v1rs *redisMigrator) setV2ThresholdProfile(x *v2Threshold) (err error) { key := utils.ThresholdProfilePrefix + utils.ConcatenatedKey(x.Tenant, x.ID) bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -589,14 +589,14 @@ func (v1rs *redisMigrator) setV2ThresholdProfile(x *v2Threshold) (err error) { return } -//rem +// rem func (v1rs *redisMigrator) remV2ThresholdProfile(tenant, id string) (err error) { key := utils.ThresholdProfilePrefix + utils.ConcatenatedKey(tenant, id) return v1rs.rds.Cmd(nil, "DEL", key) } -//ThresholdProfile methods -//get +// ThresholdProfile methods +// get func (v1rs *redisMigrator) getV1Alias() (v1a *v1Alias, err error) { v1a = &v1Alias{Values: make(v1AliasValues, 0)} if v1rs.qryIdx == nil { @@ -626,7 +626,7 @@ func (v1rs *redisMigrator) getV1Alias() (v1a *v1Alias, err error) { return v1a, nil } -//set +// set func (v1rs *redisMigrator) setV1Alias(al *v1Alias) (err error) { var result []byte result, err = v1rs.rds.Marshaler().Marshal(al.Values) @@ -640,7 +640,7 @@ func (v1rs *redisMigrator) setV1Alias(al *v1Alias) (err error) { return } -//rem +// rem func (v1rs *redisMigrator) remV1Alias(key string) (err error) { // get alias for values list @@ -681,7 +681,7 @@ func (v1rs *redisMigrator) remV1Alias(key string) (err error) { } // User methods -//get +// get func (v1rs *redisMigrator) getV1User() (v1u *v1UserProfile, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.UsersPrefix) @@ -708,7 +708,7 @@ func (v1rs *redisMigrator) getV1User() (v1u *v1UserProfile, err error) { return nil, utils.ErrNoMoreData } -//set +// set func (v1rs *redisMigrator) setV1User(us *v1UserProfile) (err error) { bit, err := v1rs.rds.Marshaler().Marshal(us) if err != nil { @@ -717,13 +717,13 @@ func (v1rs *redisMigrator) setV1User(us *v1UserProfile) (err error) { return v1rs.rds.Cmd(nil, "SET", utils.UsersPrefix+us.GetId(), string(bit)) } -//rem +// rem func (v1rs *redisMigrator) remV1User(key string) (err error) { return v1rs.rds.Cmd(nil, "DEL", utils.UsersPrefix+key) } // DerivedChargers methods -//get +// get func (v1rs *redisMigrator) getV1DerivedChargers() (v1d *v1DerivedChargersWithKey, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.DerivedChargersPrefix) @@ -752,7 +752,7 @@ func (v1rs *redisMigrator) getV1DerivedChargers() (v1d *v1DerivedChargersWithKey return nil, utils.ErrNoMoreData } -//set +// set func (v1rs *redisMigrator) setV1DerivedChargers(dc *v1DerivedChargersWithKey) (err error) { if dc == nil || len(dc.Value.Chargers) == 0 { return v1rs.remV1DerivedChargers(dc.Key) @@ -764,13 +764,13 @@ func (v1rs *redisMigrator) setV1DerivedChargers(dc *v1DerivedChargersWithKey) (e return v1rs.rds.Cmd(nil, "SET", utils.DerivedChargersPrefix+dc.Key, string(bit)) } -//rem +// rem func (v1rs *redisMigrator) remV1DerivedChargers(key string) (err error) { return v1rs.rds.Cmd(nil, "DEL", utils.DerivedChargersPrefix+key) } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1rs *redisMigrator) getV2AttributeProfile() (v2attrPrf *v2AttributeProfile, err error) { var v2attr *v2AttributeProfile if v1rs.qryIdx == nil { @@ -798,7 +798,7 @@ func (v1rs *redisMigrator) getV2AttributeProfile() (v2attrPrf *v2AttributeProfil return v2attr, nil } -//set +// set func (v1rs *redisMigrator) setV2AttributeProfile(x *v2AttributeProfile) (err error) { key := utils.AttributeProfilePrefix + utils.ConcatenatedKey(x.Tenant, x.ID) bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -811,14 +811,14 @@ func (v1rs *redisMigrator) setV2AttributeProfile(x *v2AttributeProfile) (err err return } -//rem +// rem func (v1rs *redisMigrator) remV2AttributeProfile(tenant, id string) (err error) { key := utils.AttributeProfilePrefix + utils.ConcatenatedKey(tenant, id) return v1rs.rds.Cmd(nil, "DEL", key) } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1rs *redisMigrator) getV3AttributeProfile() (v3attrPrf *v3AttributeProfile, err error) { var v3attr *v3AttributeProfile if v1rs.qryIdx == nil { @@ -846,7 +846,7 @@ func (v1rs *redisMigrator) getV3AttributeProfile() (v3attrPrf *v3AttributeProfil return v3attr, nil } -//set +// set func (v1rs *redisMigrator) setV3AttributeProfile(x *v3AttributeProfile) (err error) { key := utils.AttributeProfilePrefix + utils.ConcatenatedKey(x.Tenant, x.ID) bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -859,14 +859,14 @@ func (v1rs *redisMigrator) setV3AttributeProfile(x *v3AttributeProfile) (err err return } -//rem +// rem func (v1rs *redisMigrator) remV3AttributeProfile(tenant, id string) (err error) { key := utils.AttributeProfilePrefix + utils.ConcatenatedKey(tenant, id) return v1rs.rds.Cmd(nil, "DEL", key) } -//AttributeProfile methods -//get +// AttributeProfile methods +// get func (v1rs *redisMigrator) getV4AttributeProfile() (v3attrPrf *v4AttributeProfile, err error) { var v4attr *v4AttributeProfile if v1rs.qryIdx == nil { @@ -920,7 +920,7 @@ func (v1rs *redisMigrator) getV5AttributeProfile() (v5attr *engine.AttributeProf return } -//set +// set func (v1rs *redisMigrator) setV4AttributeProfile(x *v4AttributeProfile) (err error) { key := utils.AttributeProfilePrefix + utils.ConcatenatedKey(x.Tenant, x.ID) bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -933,14 +933,14 @@ func (v1rs *redisMigrator) setV4AttributeProfile(x *v4AttributeProfile) (err err return } -//rem +// rem func (v1rs *redisMigrator) remV4AttributeProfile(tenant, id string) (err error) { key := utils.AttributeProfilePrefix + utils.ConcatenatedKey(tenant, id) return v1rs.rds.Cmd(nil, "DEL", key) } // Filter Methods -//get +// get func (v1rs *redisMigrator) getV1Filter() (v1Fltr *v1Filter, err error) { if v1rs.qryIdx == nil { v1rs.dataKeys, err = v1rs.rds.GetKeysForPrefix(utils.FilterPrefix) @@ -993,7 +993,7 @@ func (v1rs *redisMigrator) getV4Filter() (v4Fltr *engine.Filter, err error) { return } -//set +// set func (v1rs *redisMigrator) setV1Filter(x *v1Filter) (err error) { key := utils.FilterPrefix + utils.ConcatenatedKey(x.Tenant, x.ID) bit, err := v1rs.rds.Marshaler().Marshal(x) @@ -1003,7 +1003,7 @@ func (v1rs *redisMigrator) setV1Filter(x *v1Filter) (err error) { return v1rs.rds.Cmd(nil, "SET", key, string(bit)) } -//rem +// rem func (v1rs *redisMigrator) remV1Filter(tenant, id string) (err error) { key := utils.FilterPrefix + utils.ConcatenatedKey(tenant, id) return v1rs.rds.Cmd(nil, "DEL", key) @@ -1036,7 +1036,7 @@ func (v1rs *redisMigrator) getSupplier() (spl *SupplierProfile, err error) { return } -//set +// set func (v1rs *redisMigrator) setSupplier(spl *SupplierProfile) (err error) { key := SupplierProfilePrefix + utils.ConcatenatedKey(spl.Tenant, spl.ID) bit, err := v1rs.rds.Marshaler().Marshal(spl) @@ -1049,7 +1049,7 @@ func (v1rs *redisMigrator) setSupplier(spl *SupplierProfile) (err error) { return } -//rem +// rem func (v1rs *redisMigrator) remSupplier(tenant, id string) (err error) { key := SupplierProfilePrefix + utils.ConcatenatedKey(tenant, id) return v1rs.rds.Cmd(nil, "DEL", key) diff --git a/migrator/storage_sql.go b/migrator/storage_sql.go index 8de827346..3b42dd3ed 100644 --- a/migrator/storage_sql.go +++ b/migrator/storage_sql.go @@ -79,7 +79,7 @@ func (mgSQL *migratorSQL) setV1CDR(v1Cdr *v1Cdrs) (err error) { return nil } -//rem +// rem func (mgSQL *migratorSQL) remV1CDRs(v1Cdr *v1Cdrs) (err error) { tx := mgSQL.sqlStorage.ExportGormDB().Begin() var rmParam *v1Cdrs diff --git a/services/analyzers_test.go b/services/analyzers_test.go index 17a22cb0f..16c79800c 100644 --- a/services/analyzers_test.go +++ b/services/analyzers_test.go @@ -31,7 +31,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestAnalyzerCoverage for cover testing +// TestAnalyzerCoverage for cover testing func TestAnalyzerCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() shdChan := utils.NewSyncedChan() diff --git a/services/apiers_test.go b/services/apiers_test.go index 626946cc3..63a9e8d75 100644 --- a/services/apiers_test.go +++ b/services/apiers_test.go @@ -33,7 +33,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestApiersCoverage for cover testing +// TestApiersCoverage for cover testing func TestApiersCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() filterSChan := make(chan *engine.FilterS, 1) diff --git a/services/asteriskagent_test.go b/services/asteriskagent_test.go index 1ec88904e..5c47bce80 100644 --- a/services/asteriskagent_test.go +++ b/services/asteriskagent_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestAsteriskAgentCoverage for cover testing +// TestAsteriskAgentCoverage for cover testing func TestAsteriskAgentCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.SessionSCfg().Enabled = true diff --git a/services/attributes_test.go b/services/attributes_test.go index 5afc5b396..1b8536341 100644 --- a/services/attributes_test.go +++ b/services/attributes_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestAttributeSCoverage for cover testing +// TestAttributeSCoverage for cover testing func TestAttributeSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() shdChan := utils.NewSyncedChan() diff --git a/services/cdrs_test.go b/services/cdrs_test.go index 5fbbfdf9b..6a196d1be 100644 --- a/services/cdrs_test.go +++ b/services/cdrs_test.go @@ -28,7 +28,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestCdrsCoverage for cover testing +// TestCdrsCoverage for cover testing func TestCdrsCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() chS := engine.NewCacheS(cfg, nil, nil) diff --git a/services/chargers_test.go b/services/chargers_test.go index aea510ff4..547fd2647 100644 --- a/services/chargers_test.go +++ b/services/chargers_test.go @@ -30,7 +30,7 @@ import ( "github.com/cgrates/cgrates/utils" ) -//TestChargerSCoverage for cover testing +// TestChargerSCoverage for cover testing func TestChargerSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.AttributeSCfg().Enabled = true diff --git a/services/cores_test.go b/services/cores_test.go index 90ea7ef54..f64ab207b 100644 --- a/services/cores_test.go +++ b/services/cores_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestCoreSCoverage for cover testing +// TestCoreSCoverage for cover testing func TestCoreSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() caps := engine.NewCaps(1, "test_caps") diff --git a/services/datadb_test.go b/services/datadb_test.go index 752a19d7e..d1f157ad9 100644 --- a/services/datadb_test.go +++ b/services/datadb_test.go @@ -28,7 +28,7 @@ import ( "github.com/cgrates/cgrates/utils" ) -//TestDataDBCoverage for cover testing +// TestDataDBCoverage for cover testing func TestDataDBCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() //chS := engine.NewCacheS(cfg, nil, nil) diff --git a/services/dispatchers_test.go b/services/dispatchers_test.go index 84849ffe5..53f0a557b 100644 --- a/services/dispatchers_test.go +++ b/services/dispatchers_test.go @@ -30,7 +30,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestDispatcherSCoverage for cover testing +// TestDispatcherSCoverage for cover testing func TestDispatcherSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.AttributeSCfg().Enabled = true diff --git a/services/dnsagent_test.go b/services/dnsagent_test.go index 0c292c412..3432d6385 100644 --- a/services/dnsagent_test.go +++ b/services/dnsagent_test.go @@ -28,7 +28,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestDNSAgentCoverage for cover testing +// TestDNSAgentCoverage for cover testing func TestDNSAgentCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.SessionSCfg().Enabled = true diff --git a/services/ees_test.go b/services/ees_test.go index 57c7bbd5b..326de0ba8 100644 --- a/services/ees_test.go +++ b/services/ees_test.go @@ -30,7 +30,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestEventExporterSCoverage for cover testing +// TestEventExporterSCoverage for cover testing func TestEventExporterSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() diff --git a/services/ers_test.go b/services/ers_test.go index 11052d6cf..41cc385b9 100644 --- a/services/ers_test.go +++ b/services/ers_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/cgrates/utils" ) -//TestEventReaderSCoverage for cover testing +// TestEventReaderSCoverage for cover testing func TestEventReaderSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.SessionSCfg().Enabled = true diff --git a/services/freeswitchagent_test.go b/services/freeswitchagent_test.go index bcdfab489..587ecdccf 100644 --- a/services/freeswitchagent_test.go +++ b/services/freeswitchagent_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestFreeSwitchAgentCoverage for cover testing +// TestFreeSwitchAgentCoverage for cover testing func TestFreeSwitchAgentCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.SessionSCfg().Enabled = true diff --git a/services/httpagent_test.go b/services/httpagent_test.go index ae3b2ee64..846a1183e 100644 --- a/services/httpagent_test.go +++ b/services/httpagent_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestHTTPAgent for cover testing +// TestHTTPAgent for cover testing func TestHTTPAgentCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() server := cores.NewServer(nil) diff --git a/services/loaders_test.go b/services/loaders_test.go index 0499bc9d3..9797fcf15 100644 --- a/services/loaders_test.go +++ b/services/loaders_test.go @@ -31,7 +31,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestLoaderSCoverage for cover testing +// TestLoaderSCoverage for cover testing func TestLoaderSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() shdChan := utils.NewSyncedChan() diff --git a/services/radiusagent_test.go b/services/radiusagent_test.go index 3f6253aaa..7bdf091b3 100644 --- a/services/radiusagent_test.go +++ b/services/radiusagent_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestLoaderSCoverage for cover testing +// TestLoaderSCoverage for cover testing func TestRadiusAgentCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.SessionSCfg().Enabled = true diff --git a/services/rals_test.go b/services/rals_test.go index a17a16d10..22191b967 100644 --- a/services/rals_test.go +++ b/services/rals_test.go @@ -30,7 +30,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestRalsCoverage for cover testing +// TestRalsCoverage for cover testing func TestRalsCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() filterSChan := make(chan *engine.FilterS, 1) diff --git a/services/registrarc_test.go b/services/registrarc_test.go index d57dd04ff..7d4609baa 100644 --- a/services/registrarc_test.go +++ b/services/registrarc_test.go @@ -31,7 +31,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestDispatcherCoverage for cover testing +// TestDispatcherCoverage for cover testing func TestDispatcherHCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() shdChan := utils.NewSyncedChan() diff --git a/services/resources_test.go b/services/resources_test.go index 78e0a5add..23f614aca 100644 --- a/services/resources_test.go +++ b/services/resources_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestResourceSCoverage for cover testing +// TestResourceSCoverage for cover testing func TestResourceSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.ThresholdSCfg().Enabled = true diff --git a/services/responders_test.go b/services/responders_test.go index 577cb59a1..5ffd1a302 100644 --- a/services/responders_test.go +++ b/services/responders_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestResponderCoverage for cover testing +// TestResponderCoverage for cover testing func TestResponderCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() server := cores.NewServer(nil) diff --git a/services/routes_test.go b/services/routes_test.go index 95c701f2b..af882c2c9 100644 --- a/services/routes_test.go +++ b/services/routes_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestSupplierSCoverage for cover testing +// TestSupplierSCoverage for cover testing func TestSupplierSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.StatSCfg().Enabled = true diff --git a/services/schedulers_test.go b/services/schedulers_test.go index 85f3b9c7e..0e7021182 100644 --- a/services/schedulers_test.go +++ b/services/schedulers_test.go @@ -31,7 +31,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestSchedulerSCoverage for cover testing +// TestSchedulerSCoverage for cover testing func TestSchedulerSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() shdChan := utils.NewSyncedChan() diff --git a/services/sessions_test.go b/services/sessions_test.go index 9fb7e8850..8a6438829 100644 --- a/services/sessions_test.go +++ b/services/sessions_test.go @@ -31,7 +31,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestSessionSCoverage for cover testing +// TestSessionSCoverage for cover testing func TestSessionSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.ChargerSCfg().Enabled = true diff --git a/services/sipagent_test.go b/services/sipagent_test.go index c55d175ad..664c14946 100644 --- a/services/sipagent_test.go +++ b/services/sipagent_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestSIPAgentCoverage for cover testing +// TestSIPAgentCoverage for cover testing func TestSIPAgentCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() cfg.SessionSCfg().Enabled = true diff --git a/services/stats_test.go b/services/stats_test.go index 21ee1d67d..c4426805e 100644 --- a/services/stats_test.go +++ b/services/stats_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestStatSCoverage for cover testing +// TestStatSCoverage for cover testing func TestStatSCoverage(t *testing.T) { // utils.Logger.SetLogLevel(7) cfg := config.NewDefaultCGRConfig() diff --git a/services/stordb_test.go b/services/stordb_test.go index 2aee00509..4af4a0d95 100644 --- a/services/stordb_test.go +++ b/services/stordb_test.go @@ -27,7 +27,7 @@ import ( "github.com/cgrates/cgrates/utils" ) -//TestStorDBServiceCoverage for cover testing +// TestStorDBServiceCoverage for cover testing func TestStorDBServiceCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)} diff --git a/services/thresholds_test.go b/services/thresholds_test.go index f270919dc..7d9ea942a 100644 --- a/services/thresholds_test.go +++ b/services/thresholds_test.go @@ -29,7 +29,7 @@ import ( "github.com/cgrates/rpcclient" ) -//TestThresholdSCoverage for cover testing +// TestThresholdSCoverage for cover testing func TestThresholdSCoverage(t *testing.T) { cfg := config.NewDefaultCGRConfig() filterSChan := make(chan *engine.FilterS, 1) diff --git a/sessions/session_test.go b/sessions/session_test.go index 128ad08b8..640d68239 100644 --- a/sessions/session_test.go +++ b/sessions/session_test.go @@ -151,7 +151,7 @@ func TestSessionClone(t *testing.T) { //Test1 ExtraDuration 0 and LastUsage < initial -//Test1 ExtraDuration 0 and LastUsage < initial +// Test1 ExtraDuration 0 and LastUsage < initial func TestSRunDebitReserve(t *testing.T) { lastUsage := time.Minute + 30*time.Second duration := 2 * time.Minute @@ -175,7 +175,7 @@ func TestSRunDebitReserve(t *testing.T) { } } -//Test2 ExtraDuration 0 and LastUsage > initial +// Test2 ExtraDuration 0 and LastUsage > initial func TestSRunDebitReserve2(t *testing.T) { lastUsage := 2*time.Minute + 30*time.Second duration := 2 * time.Minute @@ -198,7 +198,7 @@ func TestSRunDebitReserve2(t *testing.T) { } } -//Test3 ExtraDuration ( 1m < duration) and LastUsage < initial +// Test3 ExtraDuration ( 1m < duration) and LastUsage < initial func TestSRunDebitReserve3(t *testing.T) { lastUsage := time.Minute + 30*time.Second duration := 2 * time.Minute @@ -221,7 +221,7 @@ func TestSRunDebitReserve3(t *testing.T) { } } -//Test4 ExtraDuration 1m and LastUsage > initial +// Test4 ExtraDuration 1m and LastUsage > initial func TestSRunDebitReserve4(t *testing.T) { lastUsage := 2*time.Minute + 30*time.Second duration := 2 * time.Minute @@ -245,7 +245,7 @@ func TestSRunDebitReserve4(t *testing.T) { } } -//Test5 ExtraDuration 3m ( > initialDuration) and LastUsage < initial +// Test5 ExtraDuration 3m ( > initialDuration) and LastUsage < initial func TestSRunDebitReserve5(t *testing.T) { lastUsage := time.Minute + 30*time.Second duration := 2 * time.Minute @@ -271,7 +271,7 @@ func TestSRunDebitReserve5(t *testing.T) { } } -//Test6 ExtraDuration 3m ( > initialDuration) and LastUsage > initial +// Test6 ExtraDuration 3m ( > initialDuration) and LastUsage > initial func TestSRunDebitReserve6(t *testing.T) { lastUsage := 2*time.Minute + 30*time.Second duration := 2 * time.Minute diff --git a/sessions/sessionscover_test.go b/sessions/sessionscover_test.go index 32bd58137..9f24d6040 100644 --- a/sessions/sessionscover_test.go +++ b/sessions/sessionscover_test.go @@ -450,7 +450,7 @@ func TestDebitSession(t *testing.T) { } } -//mocking for +// mocking for type testMockClients struct { calls map[string]func(args interface{}, reply interface{}) error } diff --git a/utils/logger.go b/utils/logger.go index d03fd854a..88d258c03 100644 --- a/utils/logger.go +++ b/utils/logger.go @@ -97,7 +97,7 @@ func (sl *StdLogger) Write(p []byte) (n int, err error) { return 1, nil } -//SetSyslog sets the logger for the server +// SetSyslog sets the logger for the server func (sl *StdLogger) SetSyslog(l *syslog.Writer) { sl.syslog = l } diff --git a/utils/pathitemlist_test.go b/utils/pathitemlist_test.go index c9a1c5eef..cfcec86ef 100644 --- a/utils/pathitemlist_test.go +++ b/utils/pathitemlist_test.go @@ -573,11 +573,12 @@ func BenchmarkGetPathIndexSlice(b *testing.B) { } /* -func BenchmarkGetPathIndexSliceSplit(b *testing.B) { - for i := 0; i < b.N; i++ { - GetPathIndexSlice(benchPath) + func BenchmarkGetPathIndexSliceSplit(b *testing.B) { + for i := 0; i < b.N; i++ { + GetPathIndexSlice(benchPath) + } } -}*/ +*/ func BenchmarkGetPathIndexSliceStringsIndex(b *testing.B) { for i := 0; i < b.N; i++ { GetPathIndexSliceStringsIndex(benchPath)