Documentation
¶
Index ¶
- Constants
- Variables
- func APItoAccount(tpAcc *utils.TPAccount, timezone string) (acc *utils.Account, err error)
- func APItoActionProfile(tpAp *utils.TPActionProfile, timezone string) (ap *utils.ActionProfile, err error)
- func APItoAttributeProfile(tpAttr *utils.TPAttributeProfile, timezone string) (attrPrf *utils.AttributeProfile, err error)
- func APItoChargerProfile(tpCPP *utils.TPChargerProfile, timezone string) (cpp *utils.ChargerProfile)
- func APItoRanking(tpRG *utils.TPRankingProfile) (rg *utils.RankingProfile, err error)
- func APItoRateProfile(tpRp *utils.TPRateProfile, timezone string) (rp *utils.RateProfile, err error)
- func APItoResource(tpRL *utils.TPResourceProfile, timezone string) (rp *utils.ResourceProfile, err error)
- func APItoRouteProfile(tpRp *utils.TPRouteProfile, timezone string) (rp *utils.RouteProfile, err error)
- func APItoTrends(tpTR *utils.TPTrendsProfile) (tr *utils.TrendProfile, err error)
- func AccountToAPI(acc *utils.Account) (tpAcc *utils.TPAccount)
- func ActionProfileToAPI(ap *utils.ActionProfile) (tpAp *utils.TPActionProfile)
- func AppendToMysqlDSNOpts(opts map[string]string) string
- func AttributeProfileToAPI(attrPrf *utils.AttributeProfile) (tpAttr *utils.TPAttributeProfile)
- func BlockerFromDynamics(ctx *context.Context, dBs []*utils.DynamicBlocker, fltrS *FilterS, tnt string, ...) (blckr bool, err error)
- func CallCache(connMgr *ConnManager, ctx *context.Context, cacheConns []string, ...) (err error)
- func ChargerProfileToAPI(chargerPrf *utils.ChargerProfile) (tpCharger *utils.TPChargerProfile)
- func CheckFilter(fltr *Filter) (err error)
- func CheckVersions(storage Storage) error
- func ComputeIndexes(ctx *context.Context, dm *DataManager, tnt, grp, idxItmType string, ...) (indexes utils.StringSet, err error)
- func ConvertOptsToMapStringAny(in any) (map[string]any, error)
- func CsvDump(s any) ([]string, error)
- func ExtractURLFromHTTPType(typeStr string) (string, error)
- func FilterToTPFilter(f *Filter) (tpFltr *utils.TPFilterProfile)
- func GetAPIBan(ctx *context.Context, ip string, apiKeys []string, ...) (banned bool, err error)
- func GetBoolOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt bool, err error)
- func GetDecimalBigOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt *decimal.Big, err error)
- func GetDurationOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt time.Duration, err error)
- func GetDurationOptsFromMultipleMaps(ctx *context.Context, tnt string, ...) (cfgOpt time.Duration, err error)
- func GetDurationPointerOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt *time.Duration, err error)
- func GetDurationPointerOptsFromMultipleMaps(ctx *context.Context, tnt string, ...) (cfgOpt *time.Duration, err error)
- func GetFloat64Opts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt float64, err error)
- func GetIntOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt int, err error)
- func GetIntPointerOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt *int, err error)
- func GetInterfaceOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt any, err error)
- func GetRevFltrIdxHealth(ctx *context.Context, dm *DataManager, ...) (rply map[string]*ReverseFilterIHReply, err error)
- func GetSentryPeer(ctx *context.Context, val string, sentryPeerCfg *config.SentryPeerCfg, ...) (found bool, err error)
- func GetStringOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt string, err error)
- func GetStringSliceOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (cfgOpt []string, err error)
- func GetTimeOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, ...) (_ time.Time, err error)
- func HTTPPstrTransport() *http.Transport
- func IsDynamicDPPath(path string) bool
- func MakeExternalAPIRequest(url string, reader io.Reader) (string, error)
- func MatchingItemIDsForEvent(ctx *context.Context, ev utils.MapStorage, ...) (itemIDs utils.StringSet, err error)
- func NewCsvFile() csvReaderCloser
- func NewCsvString() csvReaderCloser
- func NewRPCConnection(ctx *context.Context, cfg *config.RemoteHost, keyPath, certPath, caPath string, ...) (client birpc.ClientConnector, err error)
- func NewRPCPool(ctx *context.Context, dispatchStrategy string, ...) (rpcPool *rpcclient.RPCPool, err error)
- func NewServiceWithPing(val any, name, prefix string) (*birpc.Service, error)
- func OverwriteDBVersions(storage Storage) (err error)
- func RankingProfileToAPI(rg *utils.RankingProfile) (tpRG *utils.TPRankingProfile)
- func RateProfileToAPI(rp *utils.RateProfile) (tpRp *utils.TPRateProfile)
- func ResourceProfileToAPI(rp *utils.ResourceProfile) (tpRL *utils.TPResourceProfile)
- func RouteProfileToAPI(rp *utils.RouteProfile) (tpRp *utils.TPRouteProfile)
- func SetConnManager(cm *ConnManager)
- func SetDBVersions(storage Storage) (err error)
- func SetHTTPPstrTransport(pstrTransport *http.Transport)
- func StatQueueProfileToAPI(st *StatQueueProfile) (tpST *utils.TPStatProfile)
- func ThresholdProfileToAPI(th *ThresholdProfile) (tpTH *utils.TPThresholdProfile)
- func TrendProfileToAPI(tr *utils.TrendProfile) (tpTR *utils.TPTrendsProfile)
- func UpdateFilterIndex(ctx *context.Context, dm *DataManager, oldFlt, newFlt *Filter) (err error)
- func UpdateReplicationFilters(objType, objID, connID string)
- func WeightFromDynamics(ctx *context.Context, dWs []*utils.DynamicWeight, fltrS *FilterS, tnt string, ...) (wg float64, err error)
- type AccountMdl
- type AccountMdls
- type ActionProfileMdl
- type ActionProfileMdls
- type ArgsFiltersMatch
- type AttributeMdl
- type AttributeMdls
- type CDRsql
- type CSVStorage
- func NewCSVStorage(sep rune, ...) *CSVStorage
- func NewFileCSVStorage(sep rune, dataPath string) (*CSVStorage, error)
- func NewGoogleCSVStorage(sep rune, spreadsheetID string) (*CSVStorage, error)
- func NewStringCSVStorage(sep rune, ...) *CSVStorage
- func NewURLCSVStorage(sep rune, dataPath string) *CSVStorage
- func (csvs *CSVStorage) GetTPAccounts(tpid, tenant, id string) ([]*utils.TPAccount, error)
- func (csvs *CSVStorage) GetTPActionProfiles(tpid, tenant, id string) ([]*utils.TPActionProfile, error)
- func (csvs *CSVStorage) GetTPAttributes(tpid, tenant, id string) ([]*utils.TPAttributeProfile, error)
- func (csvs *CSVStorage) GetTPChargers(tpid, tenant, id string) ([]*utils.TPChargerProfile, error)
- func (csvs *CSVStorage) GetTPFilters(tpid, tenant, id string) ([]*utils.TPFilterProfile, error)
- func (csvs *CSVStorage) GetTPRankings(tpid, tenant, id string) ([]*utils.TPRankingProfile, error)
- func (csvs *CSVStorage) GetTPRateProfiles(tpid, tenant, id string) ([]*utils.TPRateProfile, error)
- func (csvs *CSVStorage) GetTPResources(tpid, tenant, id string) ([]*utils.TPResourceProfile, error)
- func (csvs *CSVStorage) GetTPRoutes(tpid, tenant, id string) ([]*utils.TPRouteProfile, error)
- func (csvs *CSVStorage) GetTPStats(tpid, tenant, id string) ([]*utils.TPStatProfile, error)
- func (csvs *CSVStorage) GetTPThresholds(tpid, tenant, id string) ([]*utils.TPThresholdProfile, error)
- func (csvs *CSVStorage) GetTPTrends(tpid, tenant, id string) ([]*utils.TPTrendsProfile, error)
- func (csvs *CSVStorage) GetTpIds(colName string) ([]string, error)
- func (csvs *CSVStorage) GetTpTableIds(tpid, table string, distinct []string, filters map[string]string, ...) ([]string, error)
- type CacheS
- func (chS *CacheS) BeginTransaction() string
- func (chS *CacheS) Clear(chIDs []string)
- func (chS *CacheS) CommitTransaction(transID string)
- func (chS *CacheS) Get(chID, itmID string) (any, bool)
- func (chS *CacheS) GetItemIDs(chID, prfx string) (itmIDs []string)
- func (chS *CacheS) GetPrecacheChannel(chID string) chan struct{}
- func (chS *CacheS) GetWithRemote(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts) (itm any, err error)
- func (chS *CacheS) HasItem(chID, itmID string) (has bool)
- func (chS *CacheS) Precache(shutdown *utils.SyncedChan)
- func (chS *CacheS) Remove(ctx *context.Context, chID, itmID string, commit bool, transID string) (err error)
- func (chS *CacheS) RemoveWithoutReplicate(chID, itmID string, commit bool, transID string)
- func (chS *CacheS) ReplicateRemove(ctx *context.Context, chID, itmID string) (err error)
- func (chS *CacheS) ReplicateSet(ctx *context.Context, chID, itmID string, value any) (err error)
- func (chS *CacheS) RollbackTransaction(transID string)
- func (chS *CacheS) Set(ctx *context.Context, chID, itmID string, value any, groupIDs []string, ...) (err error)
- func (chS *CacheS) SetWithReplicate(ctx *context.Context, args *utils.ArgCacheReplicateSet) (err error)
- func (chS *CacheS) SetWithoutReplicate(chID, itmID string, value any, groupIDs []string, commit bool, transID string)
- func (chS *CacheS) V1Clear(ctx *context.Context, args *utils.AttrCacheIDsWithAPIOpts, reply *string) (err error)
- func (chS *CacheS) V1GetCacheStats(ctx *context.Context, args *utils.AttrCacheIDsWithAPIOpts, ...) (err error)
- func (chS *CacheS) V1GetGroupItemIDs(_ *context.Context, args *utils.ArgsGetGroupWithAPIOpts, rply *[]string) (err error)
- func (chS *CacheS) V1GetItem(_ *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *any) (err error)
- func (chS *CacheS) V1GetItemExpiryTime(_ *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *time.Time) (err error)
- func (chS *CacheS) V1GetItemIDs(_ *context.Context, args *utils.ArgsGetCacheItemIDsWithAPIOpts, ...) (err error)
- func (chS *CacheS) V1GetItemWithRemote(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *any) (err error)
- func (chS *CacheS) V1HasGroup(_ *context.Context, args *utils.ArgsGetGroupWithAPIOpts, rply *bool) (err error)
- func (chS *CacheS) V1HasItem(_ *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *bool) (err error)
- func (chS *CacheS) V1LoadCache(ctx *context.Context, attrs *utils.AttrReloadCacheWithAPIOpts, reply *string) (err error)
- func (chS *CacheS) V1PrecacheStatus(_ *context.Context, args *utils.AttrCacheIDsWithAPIOpts, ...) (err error)
- func (chS *CacheS) V1ReloadCache(ctx *context.Context, attrs *utils.AttrReloadCacheWithAPIOpts, reply *string) (err error)
- func (chS *CacheS) V1RemoveGroup(_ *context.Context, args *utils.ArgsGetGroupWithAPIOpts, rply *string) (err error)
- func (chS *CacheS) V1RemoveItem(_ *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *string) (err error)
- func (chS *CacheS) V1RemoveItems(_ *context.Context, args *utils.AttrReloadCacheWithAPIOpts, reply *string) (err error)
- func (chS *CacheS) V1ReplicateRemove(_ *context.Context, args *utils.ArgCacheReplicateRemove, reply *string) (err error)
- func (chS *CacheS) V1ReplicateSet(_ *context.Context, args *utils.ArgCacheReplicateSet, reply *string) (err error)
- type Caps
- type CapsStats
- type ChargerMdl
- type ChargerMdls
- type ConnManager
- func (cM *ConnManager) AddInternalConn(connName, apiPrefix string, iConnCh chan birpc.ClientConnector)
- func (cM *ConnManager) Call(ctx *context.Context, connIDs []string, method string, arg, reply any) (err error)
- func (cM *ConnManager) CallWithConnIDs(connIDs []string, ctx *context.Context, subsHostIDs utils.StringSet, ...) (err error)
- func (cM *ConnManager) GetDispInternalChan() chan birpc.ClientConnector
- func (cM *ConnManager) GetInternalChan() chan birpc.ClientConnector
- func (cM *ConnManager) Reload()
- type DataDB
- type DataDBDriver
- type DataDBMock
- func (dbM *DataDBMock) AddLoadHistory(*utils.LoadInstance, int, string) error
- func (dbM *DataDBMock) BackupDataDB(backupFolderPath string, zip bool) (err error)
- func (dbM *DataDBMock) BackupStorDBDump(backupFolderPath string, zip bool) (err error)
- func (dbM *DataDBMock) Close()
- func (dbM *DataDBMock) DumpDataDB() error
- func (dbM *DataDBMock) Flush(string) error
- func (dbM *DataDBMock) GetAccountDrv(ctx *context.Context, str1 string, str2 string) (*utils.Account, error)
- func (dbM *DataDBMock) GetActionProfileDrv(ctx *context.Context, tenant string, ID string) (*utils.ActionProfile, error)
- func (dbM *DataDBMock) GetAttributeProfileDrv(ctx *context.Context, str1 string, str2 string) (*utils.AttributeProfile, error)
- func (dbM *DataDBMock) GetChargerProfileDrv(ctx *context.Context, tnt, id string) (*utils.ChargerProfile, error)
- func (dbM *DataDBMock) GetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) (map[string][]byte, error)
- func (dbM *DataDBMock) GetFilterDrv(ctx *context.Context, str1 string, str2 string) (*Filter, error)
- func (dbM *DataDBMock) GetIPAllocationsDrv(ctx *context.Context, tenant, id string) (*utils.IPAllocations, error)
- func (dbM *DataDBMock) GetIPProfileDrv(ctx *context.Context, tnt, id string) (*utils.IPProfile, error)
- func (dbM *DataDBMock) GetIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (indexes map[string]utils.StringSet, err error)
- func (dbM *DataDBMock) GetItemLoadIDsDrv(ctx *context.Context, itemIDPrefix string) (loadIDs map[string]int64, err error)
- func (dbM *DataDBMock) GetKeysForPrefix(ctx *context.Context, prf string) ([]string, error)
- func (dbM *DataDBMock) GetLoadHistory(int, bool, string) ([]*utils.LoadInstance, error)
- func (dbM *DataDBMock) GetRankingDrv(ctx *context.Context, tenant, id string) (*utils.Ranking, error)
- func (dbM *DataDBMock) GetRankingProfileDrv(ctx *context.Context, tenant, id string) (sg *utils.RankingProfile, err error)
- func (dbM *DataDBMock) GetRateProfileDrv(ctx *context.Context, tnt string, id string) (*utils.RateProfile, error)
- func (dbM *DataDBMock) GetRateProfileRatesDrv(ctx *context.Context, tnt string, id string, rtPrfx string, needIDs bool) ([]string, []*utils.Rate, error)
- func (dbM *DataDBMock) GetResourceDrv(ctx *context.Context, tenant, id string) (*utils.Resource, error)
- func (dbM *DataDBMock) GetResourceProfileDrv(ctx *context.Context, tnt, id string) (*utils.ResourceProfile, error)
- func (dbM *DataDBMock) GetRouteProfileDrv(ctx *context.Context, tnt, id string) (*utils.RouteProfile, error)
- func (dbM *DataDBMock) GetStatQueueDrv(ctx *context.Context, tenant, id string) (sq *StatQueue, err error)
- func (dbM *DataDBMock) GetStatQueueProfileDrv(ctx *context.Context, tenant, id string) (sq *StatQueueProfile, err error)
- func (dbM *DataDBMock) GetStorageType() string
- func (dbM *DataDBMock) GetThresholdDrv(ctx *context.Context, tenant, id string) (*Threshold, error)
- func (dbM *DataDBMock) GetThresholdProfileDrv(ctx *context.Context, tenant, id string) (tp *ThresholdProfile, err error)
- func (dbM *DataDBMock) GetTrendDrv(ctx *context.Context, tenant, id string) (*utils.Trend, error)
- func (dbM *DataDBMock) GetTrendProfileDrv(ctx *context.Context, tenant, id string) (sg *utils.TrendProfile, err error)
- func (dbM *DataDBMock) GetVersions(itm string) (vrs Versions, err error)
- func (dbM *DataDBMock) HasDataDrv(ctx *context.Context, category, subject, tenant string) (bool, error)
- func (dbM *DataDBMock) IsDBEmpty() (resp bool, err error)
- func (dbM *DataDBMock) RemRankingProfileDrv(ctx *context.Context, tenant string, id string) (err error)
- func (dbM *DataDBMock) RemStatQueueDrv(ctx *context.Context, tenant, id string) (err error)
- func (dbM *DataDBMock) RemStatQueueProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (dbM *DataDBMock) RemThresholdProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (dbM *DataDBMock) RemTrendProfileDrv(ctx *context.Context, tenant string, id string) (err error)
- func (dbM *DataDBMock) RemoveAccountDrv(ctx *context.Context, str1 string, str2 string) error
- func (dbM *DataDBMock) RemoveActionProfileDrv(ctx *context.Context, tenant string, ID string) error
- func (dbM *DataDBMock) RemoveAttributeProfileDrv(ctx *context.Context, str1 string, str2 string) error
- func (dbM *DataDBMock) RemoveChargerProfileDrv(ctx *context.Context, chr string, rpl string) error
- func (dbM *DataDBMock) RemoveConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) error
- func (dbM *DataDBMock) RemoveFilterDrv(ctx *context.Context, str1 string, str2 string) error
- func (dbM *DataDBMock) RemoveIPAllocationsDrv(ctx *context.Context, tnt, id string) error
- func (dbM *DataDBMock) RemoveIPProfileDrv(ctx *context.Context, tnt string, id string) error
- func (dbM *DataDBMock) RemoveIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey string) (err error)
- func (dbM *DataDBMock) RemoveLoadIDsDrv() error
- func (dbM *DataDBMock) RemoveRankingDrv(ctx *context.Context, _ string, _ string) error
- func (dbM *DataDBMock) RemoveRateProfileDrv(ctx *context.Context, str1 string, str2 string, rateIDs *[]string) error
- func (dbM *DataDBMock) RemoveRatingProfileDrv(string) error
- func (dbM *DataDBMock) RemoveResourceDrv(ctx *context.Context, tnt, id string) error
- func (dbM *DataDBMock) RemoveResourceProfileDrv(ctx *context.Context, tnt string, id string) error
- func (dbM *DataDBMock) RemoveRouteProfileDrv(ctx *context.Context, tnt, id string) error
- func (dbM *DataDBMock) RemoveThresholdDrv(ctx *context.Context, tnt, id string) error
- func (dbM *DataDBMock) RemoveTrendDrv(ctx *context.Context, _ string, _ string) error
- func (dbM *DataDBMock) RemoveVersions(vrs Versions) (err error)
- func (dbM *DataDBMock) RewriteDataDB() (err error)
- func (dbM *DataDBMock) SelectDatabase(dbName string) (err error)
- func (dbM *DataDBMock) SetAccountDrv(ctx *context.Context, profile *utils.Account) error
- func (dbM *DataDBMock) SetActionProfileDrv(ctx *context.Context, ap *utils.ActionProfile) error
- func (dbM *DataDBMock) SetAttributeProfileDrv(ctx *context.Context, attr *utils.AttributeProfile) error
- func (dbM *DataDBMock) SetChargerProfileDrv(ctx *context.Context, chrg *utils.ChargerProfile) error
- func (dbM *DataDBMock) SetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionsData map[string][]byte) error
- func (dbM *DataDBMock) SetFilterDrv(ctx *context.Context, fltr *Filter) error
- func (dbM *DataDBMock) SetIPAllocationsDrv(ctx *context.Context, ip *utils.IPAllocations) error
- func (dbM *DataDBMock) SetIPProfileDrv(ctx *context.Context, ipp *utils.IPProfile) error
- func (dbM *DataDBMock) SetIndexesDrv(ctx *context.Context, idxItmType, tntCtx string, ...) (err error)
- func (dbM *DataDBMock) SetLoadIDsDrv(ctx *context.Context, loadIDs map[string]int64) error
- func (dbM *DataDBMock) SetRankingDrv(ctx *context.Context, _ *utils.Ranking) error
- func (dbM *DataDBMock) SetRankingProfileDrv(ctx *context.Context, rg *utils.RankingProfile) (err error)
- func (dbM *DataDBMock) SetRateProfileDrv(ctx *context.Context, rt *utils.RateProfile, optOverwrite bool) error
- func (dbM *DataDBMock) SetResourceDrv(ctx *context.Context, r *utils.Resource) error
- func (dbM *DataDBMock) SetResourceProfileDrv(ctx *context.Context, resPrf *utils.ResourceProfile) error
- func (dbM *DataDBMock) SetRouteProfileDrv(ctx *context.Context, rtPrf *utils.RouteProfile) error
- func (dbM *DataDBMock) SetStatQueueDrv(ctx *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
- func (dbM *DataDBMock) SetStatQueueProfileDrv(ctx *context.Context, sq *StatQueueProfile) (err error)
- func (dbM *DataDBMock) SetThresholdDrv(*context.Context, *Threshold) error
- func (dbM *DataDBMock) SetThresholdProfileDrv(ctx *context.Context, tp *ThresholdProfile) (err error)
- func (dbM *DataDBMock) SetTrendDrv(ctx *context.Context, tr *utils.Trend) error
- func (dbM *DataDBMock) SetTrendProfileDrv(ctx *context.Context, trend *utils.TrendProfile) (err error)
- func (dbM *DataDBMock) SetVersions(vrs Versions, overwrite bool) (err error)
- type DataManager
- func (dm *DataManager) CacheDataFromDB(ctx *context.Context, prfx string, ids []string, mustBeCached bool) (err error)
- func (dm *DataManager) DataDB() DataDB
- func (dm *DataManager) GetAccount(ctx *context.Context, tenant, id string) (ap *utils.Account, err error)
- func (dm *DataManager) GetActionProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (ap *utils.ActionProfile, err error)
- func (dm *DataManager) GetAttributeProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (attrPrfl *utils.AttributeProfile, err error)
- func (dm *DataManager) GetChargerProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (cpp *utils.ChargerProfile, err error)
- func (dm *DataManager) GetFilter(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (fltr *Filter, err error)
- func (dm *DataManager) GetIPAllocations(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (ip *utils.IPAllocations, err error)
- func (dm *DataManager) GetIPProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (ipp *utils.IPProfile, err error)
- func (dm *DataManager) GetIndexes(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string, ...) (indexes map[string]utils.StringSet, err error)
- func (dm *DataManager) GetItemLoadIDs(ctx *context.Context, itemIDPrefix string, cacheWrite bool) (loadIDs map[string]int64, err error)
- func (dm *DataManager) GetRanking(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (rn *utils.Ranking, err error)
- func (dm *DataManager) GetRankingProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (rgp *utils.RankingProfile, err error)
- func (dm *DataManager) GetRankingProfileIDs(ctx *context.Context, tenants []string) (rns map[string][]string, err error)
- func (dm *DataManager) GetRateProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (rpp *utils.RateProfile, err error)
- func (dm *DataManager) GetRateProfileRates(ctx *context.Context, args *utils.ArgsSubItemIDs, needIDs bool) (rateIDs []string, rates []*utils.Rate, err error)
- func (dm *DataManager) GetResource(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (rs *utils.Resource, err error)
- func (dm *DataManager) GetResourceProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (rp *utils.ResourceProfile, err error)
- func (dm *DataManager) GetRouteProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (rpp *utils.RouteProfile, err error)
- func (dm *DataManager) GetStatQueue(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (sq *StatQueue, err error)
- func (dm *DataManager) GetStatQueueProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (sqp *StatQueueProfile, err error)
- func (dm *DataManager) GetThreshold(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (th *Threshold, err error)
- func (dm *DataManager) GetThresholdProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (th *ThresholdProfile, err error)
- func (dm *DataManager) GetTrend(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (tr *utils.Trend, err error)
- func (dm *DataManager) GetTrendProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, ...) (trp *utils.TrendProfile, err error)
- func (dm *DataManager) GetTrendProfileIDs(ctx *context.Context, tenants []string) (tps map[string][]string, err error)
- func (dm *DataManager) HasData(category, subject, tenant string) (has bool, err error)
- func (dm *DataManager) Reconnect(d DataDB)
- func (dm *DataManager) RemoveAccount(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveActionProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveAttributeProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveChargerProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveFilter(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveIPAllocations(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) RemoveIPProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveIndexes(ctx *context.Context, idxItmType, tntCtx, idxKey string) (err error)
- func (dm *DataManager) RemoveRanking(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) RemoveRankingProfile(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) RemoveRateProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveRateProfileRates(ctx *context.Context, tenant, id string, rateIDs *[]string, withIndex bool) (err error)
- func (dm *DataManager) RemoveResource(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) RemoveResourceProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveRouteProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveStatQueue(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) RemoveStatQueueProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveThreshold(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) RemoveThresholdProfile(ctx *context.Context, tenant, id string, withIndex bool) (err error)
- func (dm *DataManager) RemoveTrend(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) RemoveTrendProfile(ctx *context.Context, tenant, id string) (err error)
- func (dm *DataManager) SetAccount(ctx *context.Context, ap *utils.Account, withIndex bool) (err error)
- func (dm *DataManager) SetActionProfile(ctx *context.Context, ap *utils.ActionProfile, withIndex bool) (err error)
- func (dm *DataManager) SetAttributeProfile(ctx *context.Context, ap *utils.AttributeProfile, withIndex bool) (err error)
- func (dm *DataManager) SetChargerProfile(ctx *context.Context, cpp *utils.ChargerProfile, withIndex bool) (err error)
- func (dm *DataManager) SetFilter(ctx *context.Context, fltr *Filter, withIndex bool) (err error)
- func (dm *DataManager) SetIPAllocations(ctx *context.Context, ip *utils.IPAllocations) (err error)
- func (dm *DataManager) SetIPProfile(ctx *context.Context, ipp *utils.IPProfile, withIndex bool) (err error)
- func (dm *DataManager) SetIndexes(ctx *context.Context, idxItmType, tntCtx string, ...) (err error)
- func (dm *DataManager) SetLoadIDs(ctx *context.Context, loadIDs map[string]int64) (err error)
- func (dm *DataManager) SetRanking(ctx *context.Context, rn *utils.Ranking) (err error)
- func (dm *DataManager) SetRankingProfile(ctx *context.Context, rnp *utils.RankingProfile) (err error)
- func (dm *DataManager) SetRateProfile(ctx *context.Context, rpp *utils.RateProfile, optOverwrite, withIndex bool) (err error)
- func (dm *DataManager) SetResource(ctx *context.Context, rs *utils.Resource) (err error)
- func (dm *DataManager) SetResourceProfile(ctx *context.Context, rp *utils.ResourceProfile, withIndex bool) (err error)
- func (dm *DataManager) SetRouteProfile(ctx *context.Context, rpp *utils.RouteProfile, withIndex bool) (err error)
- func (dm *DataManager) SetStatQueue(ctx *context.Context, sq *StatQueue) (err error)
- func (dm *DataManager) SetStatQueueProfile(ctx *context.Context, sqp *StatQueueProfile, withIndex bool) (err error)
- func (dm *DataManager) SetThreshold(ctx *context.Context, th *Threshold) (err error)
- func (dm *DataManager) SetThresholdProfile(ctx *context.Context, th *ThresholdProfile, withIndex bool) (err error)
- func (dm *DataManager) SetTrend(ctx *context.Context, tr *utils.Trend) (err error)
- func (dm *DataManager) SetTrendProfile(ctx *context.Context, trp *utils.TrendProfile) (err error)
- type DecimalWithCompress
- type DispatcherHost
- func (dH *DispatcherHost) FieldAsInterface(fldPath []string) (_ any, err error)
- func (dH *DispatcherHost) FieldAsString(fldPath []string) (_ string, err error)
- func (dH *DispatcherHost) GetConn(ctx *context.Context, cfg *config.CGRConfig, iPRCCh chan birpc.ClientConnector) (_ birpc.ClientConnector, err error)
- func (dH *DispatcherHost) Merge(v2 any)
- func (dH *DispatcherHost) Set(path []string, val any, newBranch bool) (err error)
- func (dH *DispatcherHost) String() string
- func (dH *DispatcherHost) TenantID() string
- type DispatcherHostIDs
- type DispatcherHostProfile
- func (dC *DispatcherHostProfile) Clone() (cln *DispatcherHostProfile)
- func (dC *DispatcherHostProfile) FieldAsInterface(fldPath []string) (_ any, err error)
- func (dC *DispatcherHostProfile) FieldAsString(fldPath []string) (_ string, err error)
- func (dspHost *DispatcherHostProfile) Merge(v2 *DispatcherHostProfile)
- func (dC *DispatcherHostProfile) String() string
- type DispatcherHostProfiles
- type DispatcherHostWithAPIOpts
- type DynamicDP
- type ExportLogger
- func (el *ExportLogger) Alert(m string) (err error)
- func (el *ExportLogger) Close() (err error)
- func (el *ExportLogger) Crit(m string) (err error)
- func (el *ExportLogger) Debug(m string) (err error)
- func (el *ExportLogger) Emerg(m string) (err error)
- func (el *ExportLogger) Err(m string) (err error)
- func (el *ExportLogger) GetLogLevel() int
- func (el *ExportLogger) GetMeta() map[string]any
- func (sl *ExportLogger) GetSyslog() *syslog.Writer
- func (el *ExportLogger) Info(m string) (err error)
- func (el *ExportLogger) Notice(m string) (err error)
- func (el *ExportLogger) SetLogLevel(level int)
- func (el *ExportLogger) Warning(m string) (err error)
- func (el *ExportLogger) Write(p []byte) (n int, err error)
- type Filter
- func (fltr *Filter) CacheClone() any
- func (fltr *Filter) Clone() *Filter
- func (fltr *Filter) Compile() (err error)
- func (fltr *Filter) Compress()
- func (fltr *Filter) FieldAsInterface(fldPath []string) (_ any, err error)
- func (fltr *Filter) FieldAsString(fldPath []string) (_ string, err error)
- func (fltr *Filter) Merge(v2 any)
- func (fltr *Filter) Set(path []string, val any, newBranch bool) (err error)
- func (fltr *Filter) String() string
- func (fltr *Filter) TenantID() string
- type FilterIHReply
- type FilterMdl
- type FilterMdls
- type FilterRule
- func (fltr *FilterRule) Clone() *FilterRule
- func (fltr *FilterRule) CompileValues() (err error)
- func (fltr *FilterRule) FieldAsInterface(fldPath []string) (_ any, err error)
- func (fltr *FilterRule) FieldAsString(fldPath []string) (_ string, err error)
- func (fltr *FilterRule) IsValid() bool
- func (fltr *FilterRule) Pass(ctx *context.Context, dDP utils.DataProvider) (result bool, err error)
- func (fltr *FilterRule) String() string
- type FilterS
- type FilterWithAPIOpts
- type IndexHealthArgs
- type IntService
- type InternalDB
- func (iDB *InternalDB) AddLoadHistory(*utils.LoadInstance, int, string) error
- func (iDB *InternalDB) BackupConfigDB(backupFolderPath string, zip bool) (err error)
- func (iDB *InternalDB) BackupDataDB(backupFolderPath string, zip bool) (err error)
- func (iDB *InternalDB) BackupStorDB(backupFolderPath string, zip bool) (err error)
- func (iDB *InternalDB) Close()
- func (iDB *InternalDB) DumpConfigDB() (err error)
- func (iDB *InternalDB) DumpDataDB() (err error)
- func (iDB *InternalDB) DumpStorDB() (err error)
- func (iDB *InternalDB) Flush(string) error
- func (iDB *InternalDB) GetAccountDrv(_ *context.Context, tenant, id string) (ap *utils.Account, err error)
- func (iDB *InternalDB) GetActionProfileDrv(_ *context.Context, tenant, id string) (ap *utils.ActionProfile, err error)
- func (iDB *InternalDB) GetAttributeProfileDrv(_ *context.Context, tenant, id string) (attr *utils.AttributeProfile, err error)
- func (iDB *InternalDB) GetCDRs(ctx *context.Context, qryFltr []*Filter, opts map[string]any) (cdrs []*utils.CDR, err error)
- func (iDB *InternalDB) GetChargerProfileDrv(_ *context.Context, tenant, id string) (ch *utils.ChargerProfile, err error)
- func (iDB *InternalDB) GetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) (sectionMap map[string][]byte, err error)
- func (iDB *InternalDB) GetFilterDrv(_ *context.Context, tenant, id string) (fltr *Filter, err error)
- func (iDB *InternalDB) GetIPAllocationsDrv(_ *context.Context, tenant, id string) (*utils.IPAllocations, error)
- func (iDB *InternalDB) GetIPProfileDrv(_ *context.Context, tenant, id string) (*utils.IPProfile, error)
- func (iDB *InternalDB) GetIndexesDrv(_ *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (indexes map[string]utils.StringSet, err error)
- func (iDB *InternalDB) GetItemLoadIDsDrv(_ *context.Context, itemIDPrefix string) (loadIDs map[string]int64, err error)
- func (iDB *InternalDB) GetKeysForPrefix(_ *context.Context, prefix string) (ids []string, err error)
- func (iDB *InternalDB) GetLoadHistory(int, bool, string) ([]*utils.LoadInstance, error)
- func (iDB *InternalDB) GetRankingDrv(_ *context.Context, tenant, id string) (rn *utils.Ranking, err error)
- func (iDB *InternalDB) GetRankingProfileDrv(_ *context.Context, tenant, id string) (sg *utils.RankingProfile, err error)
- func (iDB *InternalDB) GetRateProfileDrv(_ *context.Context, tenant, id string) (rpp *utils.RateProfile, err error)
- func (iDB *InternalDB) GetRateProfileRatesDrv(ctx *context.Context, tenant, profileID, rtPrfx string, needIDs bool) (rateIDs []string, rates []*utils.Rate, err error)
- func (iDB *InternalDB) GetResourceDrv(_ *context.Context, tenant, id string) (r *utils.Resource, err error)
- func (iDB *InternalDB) GetResourceProfileDrv(_ *context.Context, tenant, id string) (rp *utils.ResourceProfile, err error)
- func (iDB *InternalDB) GetRouteProfileDrv(_ *context.Context, tenant, id string) (spp *utils.RouteProfile, err error)
- func (iDB *InternalDB) GetSection(_ *context.Context, section string, val any) error
- func (iDB *InternalDB) GetStatQueueDrv(_ *context.Context, tenant, id string) (sq *StatQueue, err error)
- func (iDB *InternalDB) GetStatQueueProfileDrv(_ *context.Context, tenant string, id string) (sq *StatQueueProfile, err error)
- func (iDB *InternalDB) GetStorageType() string
- func (iDB *InternalDB) GetThresholdDrv(_ *context.Context, tenant, id string) (th *Threshold, err error)
- func (iDB *InternalDB) GetThresholdProfileDrv(_ *context.Context, tenant, id string) (tp *ThresholdProfile, err error)
- func (iDB *InternalDB) GetTrendDrv(_ *context.Context, tenant, id string) (th *utils.Trend, err error)
- func (iDB *InternalDB) GetTrendProfileDrv(_ *context.Context, tenant, id string) (sg *utils.TrendProfile, err error)
- func (iDB *InternalDB) GetVersions(itm string) (vrs Versions, err error)
- func (iDB *InternalDB) HasDataDrv(_ *context.Context, category, subject, tenant string) (bool, error)
- func (iDB *InternalDB) IsDBEmpty() (isEmpty bool, err error)
- func (iDB *InternalDB) RemRankingProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemStatQueueDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemStatQueueProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemThresholdProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemTrendProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveAccountDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveActionProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveAttributeProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveCDRs(ctx *context.Context, qryFltr []*Filter) (err error)
- func (iDB *InternalDB) RemoveChargerProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) (err error)
- func (iDB *InternalDB) RemoveFilterDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveIPAllocationsDrv(_ *context.Context, tenant, id string) error
- func (iDB *InternalDB) RemoveIPProfileDrv(_ *context.Context, tenant, id string) error
- func (iDB *InternalDB) RemoveIndexesDrv(_ *context.Context, idxItmType, tntCtx, idxKey string) (err error)
- func (iDB *InternalDB) RemoveLoadIDsDrv() (err error)
- func (iDB *InternalDB) RemoveRankingDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveRateProfileDrv(_ *context.Context, tenant, id string, rateIDs *[]string) (err error)
- func (iDB *InternalDB) RemoveResourceDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveResourceProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveRouteProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveThresholdDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveTrendDrv(_ *context.Context, tenant, id string) (err error)
- func (iDB *InternalDB) RemoveVersions(vrs Versions) (err error)
- func (iDB *InternalDB) RewriteConfigDB() (err error)
- func (iDB *InternalDB) RewriteDataDB() (err error)
- func (iDB *InternalDB) RewriteStorDB() (err error)
- func (iDB *InternalDB) SelectDatabase(string) (err error)
- func (iDB *InternalDB) SetAccountDrv(_ *context.Context, ap *utils.Account) (err error)
- func (iDB *InternalDB) SetActionProfileDrv(_ *context.Context, ap *utils.ActionProfile) (err error)
- func (iDB *InternalDB) SetAttributeProfileDrv(_ *context.Context, attr *utils.AttributeProfile) (err error)
- func (iDB *InternalDB) SetCDR(_ *context.Context, cdr *utils.CGREvent, allowUpdate bool) error
- func (iDB *InternalDB) SetChargerProfileDrv(_ *context.Context, chr *utils.ChargerProfile) (err error)
- func (iDB *InternalDB) SetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionsData map[string][]byte) (err error)
- func (iDB *InternalDB) SetFilterDrv(_ *context.Context, fltr *Filter) (err error)
- func (iDB *InternalDB) SetIPAllocationsDrv(_ *context.Context, ip *utils.IPAllocations) error
- func (iDB *InternalDB) SetIPProfileDrv(_ *context.Context, ipp *utils.IPProfile) error
- func (iDB *InternalDB) SetIndexesDrv(_ *context.Context, idxItmType, tntCtx string, ...) (err error)
- func (iDB *InternalDB) SetLoadIDsDrv(_ *context.Context, loadIDs map[string]int64) (err error)
- func (iDB *InternalDB) SetPrefixIndexedFields(prefixIndexedFields []string)
- func (iDB *InternalDB) SetRankingDrv(_ *context.Context, rn *utils.Ranking) (err error)
- func (iDB *InternalDB) SetRankingProfileDrv(_ *context.Context, sgp *utils.RankingProfile) (err error)
- func (iDB *InternalDB) SetRateProfileDrv(_ *context.Context, rpp *utils.RateProfile, optOverwrite bool) (err error)
- func (iDB *InternalDB) SetResourceDrv(_ *context.Context, r *utils.Resource) (err error)
- func (iDB *InternalDB) SetResourceProfileDrv(_ *context.Context, rp *utils.ResourceProfile) (err error)
- func (iDB *InternalDB) SetRouteProfileDrv(_ *context.Context, spp *utils.RouteProfile) (err error)
- func (iDB *InternalDB) SetSection(_ *context.Context, section string, val any) error
- func (iDB *InternalDB) SetStatQueueDrv(_ *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
- func (iDB *InternalDB) SetStatQueueProfileDrv(_ *context.Context, sq *StatQueueProfile) (err error)
- func (iDB *InternalDB) SetStringIndexedFields(stringIndexedFields []string)
- func (iDB *InternalDB) SetThresholdDrv(_ *context.Context, th *Threshold) (err error)
- func (iDB *InternalDB) SetThresholdProfileDrv(_ *context.Context, tp *ThresholdProfile) (err error)
- func (iDB *InternalDB) SetTrendDrv(_ *context.Context, tr *utils.Trend) (err error)
- func (iDB *InternalDB) SetTrendProfileDrv(_ *context.Context, srp *utils.TrendProfile) (err error)
- func (iDB *InternalDB) SetVersions(vrs Versions, overwrite bool) (err error)
- type LoadReader
- type LoadStorage
- type LoadWriter
- type MapEvent
- func (me MapEvent) AsMapString(ignoredFlds utils.StringSet) (mp map[string]string)
- func (me MapEvent) Clone() (mp MapEvent)
- func (me MapEvent) Data() map[string]any
- func (me MapEvent) FieldAsInterface(fldPath []string) (any, error)
- func (me MapEvent) FieldAsString(fldPath []string) (string, error)
- func (me MapEvent) GetBoolOrDefault(fldName string, dflt bool) (out bool)
- func (me MapEvent) GetDuration(fldName string) (d time.Duration, err error)
- func (me MapEvent) GetDurationIgnoreErrors(fldName string) (d time.Duration)
- func (me MapEvent) GetDurationPtr(fldName string) (d *time.Duration, err error)
- func (me MapEvent) GetDurationPtrIgnoreErrors(fldName string) (d *time.Duration)
- func (me MapEvent) GetDurationPtrOrDefault(fldName string, dflt *time.Duration) (d *time.Duration, err error)
- func (me MapEvent) GetFloat64(fldName string) (f float64, err error)
- func (me MapEvent) GetString(fldName string) (out string, err error)
- func (me MapEvent) GetStringIgnoreErrors(fldName string) (out string)
- func (me MapEvent) GetTInt64(fldName string) (out int64, err error)
- func (me MapEvent) GetTime(fldName string, timezone string) (t time.Time, err error)
- func (me MapEvent) GetTimeIgnoreErrors(fldName string, tmz string) (t time.Time)
- func (me MapEvent) GetTimePtr(fldName, tmz string) (t *time.Time, err error)
- func (me MapEvent) GetTimePtrIgnoreErrors(fldName, tmz string) (t *time.Time)
- func (me MapEvent) HasField(fldName string) (has bool)
- func (me MapEvent) String() string
- type MapStringDP
- type Metric
- func (sum *Metric) Clone() (cln *Metric)
- func (sum *Metric) Compress(queueLen uint64, defaultID string) (eventIDs []string)
- func (sum *Metric) Equal(v *Metric) bool
- func (sum *Metric) GetCompressFactor(events map[string]uint64) map[string]uint64
- func (sum *Metric) GetFilterIDs() []string
- func (sum *Metric) GetMinItems() uint64
- func (sum *Metric) GetStringValue(rounding int) string
- func (sum *Metric) GetValue() (v *utils.Decimal)
- func (sum *Metric) RemEvent(evID string) (err error)
- type MetricWithFilters
- type MongoStorage
- func (ms *MongoStorage) AddLoadHistory(ldInst *utils.LoadInstance, loadHistSize int, transactionID string) error
- func (ms *MongoStorage) BackupConfigDB(backupFolderPath string, zip bool) (err error)
- func (ms *MongoStorage) BackupDataDB(backupFolderPath string, zip bool) (err error)
- func (ms *MongoStorage) BackupStorDB(backupFolderPath string, zip bool) (err error)
- func (ms *MongoStorage) Close()
- func (ms *MongoStorage) DB() *mongo.Database
- func (ms *MongoStorage) DumpConfigDB() (err error)
- func (ms *MongoStorage) DumpDataDB() error
- func (ms *MongoStorage) DumpStorDB() (err error)
- func (ms *MongoStorage) EnsureIndexes(cols ...string) error
- func (ms *MongoStorage) Flush(_ string) error
- func (ms *MongoStorage) GetAccountDrv(ctx *context.Context, tenant, id string) (*utils.Account, error)
- func (ms *MongoStorage) GetActionProfileDrv(ctx *context.Context, tenant, id string) (*utils.ActionProfile, error)
- func (ms *MongoStorage) GetAttributeProfileDrv(ctx *context.Context, tenant, id string) (*utils.AttributeProfile, error)
- func (ms *MongoStorage) GetCDRs(ctx *context.Context, qryFltr []*Filter, opts map[string]any) (cdrs []*utils.CDR, err error)
- func (ms *MongoStorage) GetChargerProfileDrv(ctx *context.Context, tenant, id string) (*utils.ChargerProfile, error)
- func (ms *MongoStorage) GetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) (map[string][]byte, error)
- func (ms *MongoStorage) GetContext() *context.Context
- func (ms *MongoStorage) GetFilterDrv(ctx *context.Context, tenant, id string) (*Filter, error)
- func (ms *MongoStorage) GetIPAllocationsDrv(ctx *context.Context, tenant, id string) (*utils.IPAllocations, error)
- func (ms *MongoStorage) GetIPProfileDrv(ctx *context.Context, tenant, id string) (*utils.IPProfile, error)
- func (ms *MongoStorage) GetIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (map[string]utils.StringSet, error)
- func (ms *MongoStorage) GetItemLoadIDsDrv(ctx *context.Context, itemIDPrefix string) (map[string]int64, error)
- func (ms *MongoStorage) GetKeysForPrefix(ctx *context.Context, prefix string) (keys []string, err error)
- func (ms *MongoStorage) GetLoadHistory(limit int, skipCache bool, transactionID string) ([]*utils.LoadInstance, error)
- func (ms *MongoStorage) GetRankingDrv(ctx *context.Context, tenant, id string) (*utils.Ranking, error)
- func (ms *MongoStorage) GetRankingProfileDrv(ctx *context.Context, tenant, id string) (*utils.RankingProfile, error)
- func (ms *MongoStorage) GetRateProfileDrv(ctx *context.Context, tenant, id string) (*utils.RateProfile, error)
- func (ms *MongoStorage) GetRateProfileRatesDrv(ctx *context.Context, tenant, profileID, rtPrfx string, needIDs bool) (rateIDs []string, rates []*utils.Rate, err error)
- func (ms *MongoStorage) GetResourceDrv(ctx *context.Context, tenant, id string) (*utils.Resource, error)
- func (ms *MongoStorage) GetResourceProfileDrv(ctx *context.Context, tenant, id string) (*utils.ResourceProfile, error)
- func (ms *MongoStorage) GetRouteProfileDrv(ctx *context.Context, tenant, id string) (*utils.RouteProfile, error)
- func (ms *MongoStorage) GetSection(ctx *context.Context, section string, val any) error
- func (ms *MongoStorage) GetStatQueueDrv(ctx *context.Context, tenant, id string) (*StatQueue, error)
- func (ms *MongoStorage) GetStatQueueProfileDrv(ctx *context.Context, tenant string, id string) (*StatQueueProfile, error)
- func (ms *MongoStorage) GetStorageType() string
- func (ms *MongoStorage) GetThresholdDrv(ctx *context.Context, tenant, id string) (*Threshold, error)
- func (ms *MongoStorage) GetThresholdProfileDrv(ctx *context.Context, tenant, ID string) (*ThresholdProfile, error)
- func (ms *MongoStorage) GetTrendDrv(ctx *context.Context, tenant, id string) (*utils.Trend, error)
- func (ms *MongoStorage) GetTrendProfileDrv(ctx *context.Context, tenant, id string) (*utils.TrendProfile, error)
- func (ms *MongoStorage) GetVersions(itm string) (vrs Versions, err error)
- func (ms *MongoStorage) HasDataDrv(ctx *context.Context, category, subject, tenant string) (has bool, err error)
- func (ms *MongoStorage) IsDBEmpty() (isEmpty bool, err error)
- func (ms *MongoStorage) IsDataDB() bool
- func (ms *MongoStorage) RemRankingProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (ms *MongoStorage) RemStatQueueDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemStatQueueProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemThresholdProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemTrendProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (ms *MongoStorage) RemoveAccountDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveActionProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveAttributeProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveCDRs(ctx *context.Context, qryFltr []*Filter) (err error)
- func (ms *MongoStorage) RemoveChargerProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) error
- func (ms *MongoStorage) RemoveFilterDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveIPAllocationsDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveIPProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey string) error
- func (ms *MongoStorage) RemoveLoadIDsDrv() error
- func (ms *MongoStorage) RemoveRankingDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveRateProfileDrv(ctx *context.Context, tenant, id string, rateIDs *[]string) (err error)
- func (ms *MongoStorage) RemoveResourceDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveResourceProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveRouteProfileDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveThresholdDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveTrendDrv(ctx *context.Context, tenant, id string) error
- func (ms *MongoStorage) RemoveVersions(vrs Versions) (err error)
- func (ms *MongoStorage) RewriteConfigDB() (err error)
- func (ms *MongoStorage) RewriteDataDB() (err error)
- func (ms *MongoStorage) RewriteStorDB() (err error)
- func (ms *MongoStorage) SelectDatabase(dbName string) error
- func (ms *MongoStorage) SetAccountDrv(ctx *context.Context, ap *utils.Account) error
- func (ms *MongoStorage) SetActionProfileDrv(ctx *context.Context, ap *utils.ActionProfile) error
- func (ms *MongoStorage) SetAttributeProfileDrv(ctx *context.Context, r *utils.AttributeProfile) error
- func (ms *MongoStorage) SetCDR(ctx *context.Context, cdr *utils.CGREvent, allowUpdate bool) error
- func (ms *MongoStorage) SetChargerProfileDrv(ctx *context.Context, r *utils.ChargerProfile) error
- func (ms *MongoStorage) SetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionsData map[string][]byte) error
- func (ms *MongoStorage) SetFilterDrv(ctx *context.Context, r *Filter) error
- func (ms *MongoStorage) SetIPAllocationsDrv(ctx *context.Context, ip *utils.IPAllocations) error
- func (ms *MongoStorage) SetIPProfileDrv(ctx *context.Context, ipp *utils.IPProfile) error
- func (ms *MongoStorage) SetIndexesDrv(ctx *context.Context, idxItmType, tntCtx string, ...) error
- func (ms *MongoStorage) SetLoadIDsDrv(ctx *context.Context, loadIDs map[string]int64) error
- func (ms *MongoStorage) SetRankingDrv(ctx *context.Context, rn *utils.Ranking) error
- func (ms *MongoStorage) SetRankingProfileDrv(ctx *context.Context, sgp *utils.RankingProfile) (err error)
- func (ms *MongoStorage) SetRateProfileDrv(ctx *context.Context, rpp *utils.RateProfile, optOverwrite bool) error
- func (ms *MongoStorage) SetResourceDrv(ctx *context.Context, r *utils.Resource) error
- func (ms *MongoStorage) SetResourceProfileDrv(ctx *context.Context, rp *utils.ResourceProfile) error
- func (ms *MongoStorage) SetRouteProfileDrv(ctx *context.Context, r *utils.RouteProfile) error
- func (ms *MongoStorage) SetSection(ctx *context.Context, section string, jsn any) (err error)
- func (ms *MongoStorage) SetStatQueueDrv(ctx *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
- func (ms *MongoStorage) SetStatQueueProfileDrv(ctx *context.Context, sq *StatQueueProfile) error
- func (ms *MongoStorage) SetTTL(ttl time.Duration)
- func (ms *MongoStorage) SetThresholdDrv(ctx *context.Context, r *Threshold) error
- func (ms *MongoStorage) SetThresholdProfileDrv(ctx *context.Context, tp *ThresholdProfile) error
- func (ms *MongoStorage) SetTrendDrv(ctx *context.Context, tr *utils.Trend) error
- func (ms *MongoStorage) SetTrendProfileDrv(ctx *context.Context, srp *utils.TrendProfile) (err error)
- func (ms *MongoStorage) SetVersions(vrs Versions, overwrite bool) (err error)
- type MySQLStorage
- type PostgresStorage
- type RPCClientSet
- type RankingMdl
- type RankingMdls
- type RateProfileMdl
- type RateProfileMdls
- type RedisStorage
- func (rs *RedisStorage) AddLoadHistory(ldInst *utils.LoadInstance, loadHistSize int, transactionID string) (err error)
- func (rs *RedisStorage) BackupConfigDB(backupFolderPath string, zip bool) (err error)
- func (rs *RedisStorage) BackupDataDB(backupFolderPath string, zip bool) (err error)
- func (rs *RedisStorage) Close()
- func (rs *RedisStorage) Cmd(rcv any, cmd string, args ...string) error
- func (rs *RedisStorage) DumpConfigDB() (err error)
- func (rs *RedisStorage) DumpDataDB() error
- func (rs *RedisStorage) FlatCmd(rcv any, cmd, key string, args ...any) error
- func (rs *RedisStorage) Flush(ignore string) error
- func (rs *RedisStorage) GetAccountDrv(ctx *context.Context, tenant, id string) (ap *utils.Account, err error)
- func (rs *RedisStorage) GetActionProfileDrv(ctx *context.Context, tenant, id string) (ap *utils.ActionProfile, err error)
- func (rs *RedisStorage) GetAttributeProfileDrv(ctx *context.Context, tenant, id string) (r *utils.AttributeProfile, err error)
- func (rs *RedisStorage) GetChargerProfileDrv(_ *context.Context, tenant, id string) (r *utils.ChargerProfile, err error)
- func (rs *RedisStorage) GetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) (sectionMap map[string][]byte, err error)
- func (rs *RedisStorage) GetFilterDrv(ctx *context.Context, tenant, id string) (r *Filter, err error)
- func (rs *RedisStorage) GetIPAllocationsDrv(ctx *context.Context, tenant, id string) (*utils.IPAllocations, error)
- func (rs *RedisStorage) GetIPProfileDrv(ctx *context.Context, tenant, id string) (*utils.IPProfile, error)
- func (rs *RedisStorage) GetIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (indexes map[string]utils.StringSet, err error)
- func (rs *RedisStorage) GetItemLoadIDsDrv(ctx *context.Context, itemIDPrefix string) (loadIDs map[string]int64, err error)
- func (rs *RedisStorage) GetKeysForPrefix(ctx *context.Context, prefix string) (keys []string, err error)
- func (rs *RedisStorage) GetLoadHistory(limit int, skipCache bool, transactionID string) (loadInsts []*utils.LoadInstance, err error)
- func (rs *RedisStorage) GetRankingDrv(ctx *context.Context, tenant, id string) (rn *utils.Ranking, err error)
- func (rs *RedisStorage) GetRankingProfileDrv(ctx *context.Context, tenant string, id string) (sg *utils.RankingProfile, err error)
- func (rs *RedisStorage) GetRateProfileDrv(ctx *context.Context, tenant, id string) (rpp *utils.RateProfile, err error)
- func (rs *RedisStorage) GetRateProfileRatesDrv(ctx *context.Context, tnt, profileID, rtPrfx string, needIDs bool) (rateIDs []string, rates []*utils.Rate, err error)
- func (rs *RedisStorage) GetResourceDrv(ctx *context.Context, tenant, id string) (r *utils.Resource, err error)
- func (rs *RedisStorage) GetResourceProfileDrv(ctx *context.Context, tenant, id string) (rsp *utils.ResourceProfile, err error)
- func (rs *RedisStorage) GetRouteProfileDrv(ctx *context.Context, tenant, id string) (r *utils.RouteProfile, err error)
- func (rs *RedisStorage) GetSection(ctx *context.Context, section string, val any) (err error)
- func (rs *RedisStorage) GetStatQueueDrv(ctx *context.Context, tenant, id string) (sq *StatQueue, err error)
- func (rs *RedisStorage) GetStatQueueProfileDrv(ctx *context.Context, tenant string, id string) (sq *StatQueueProfile, err error)
- func (rs *RedisStorage) GetStorageType() string
- func (rs *RedisStorage) GetThresholdDrv(ctx *context.Context, tenant, id string) (r *Threshold, err error)
- func (rs *RedisStorage) GetThresholdProfileDrv(ctx *context.Context, tenant, ID string) (tp *ThresholdProfile, err error)
- func (rs *RedisStorage) GetTrendDrv(ctx *context.Context, tenant, id string) (r *utils.Trend, err error)
- func (rs *RedisStorage) GetTrendProfileDrv(ctx *context.Context, tenant string, id string) (sg *utils.TrendProfile, err error)
- func (rs *RedisStorage) GetVersions(itm string) (vrs Versions, err error)
- func (rs *RedisStorage) HasDataDrv(ctx *context.Context, category, subject, tenant string) (exists bool, err error)
- func (rs *RedisStorage) IsDBEmpty() (resp bool, err error)
- func (rs *RedisStorage) Marshaler() utils.Marshaler
- func (rs *RedisStorage) RemRankingProfileDrv(ctx *context.Context, tenant string, id string) (err error)
- func (rs *RedisStorage) RemStatQueueDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemStatQueueProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemThresholdProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemTrendProfileDrv(ctx *context.Context, tenant string, id string) (err error)
- func (rs *RedisStorage) RemoveAccountDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveActionProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveAttributeProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveChargerProfileDrv(_ *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveConfigSectionsDrv(ctx *context.Context, nodeID string, sectionIDs []string) (err error)
- func (rs *RedisStorage) RemoveFilterDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveIPAllocationsDrv(ctx *context.Context, tenant, id string) error
- func (rs *RedisStorage) RemoveIPProfileDrv(ctx *context.Context, tenant, id string) error
- func (rs *RedisStorage) RemoveIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey string) (err error)
- func (rs *RedisStorage) RemoveLoadIDsDrv() (err error)
- func (rs *RedisStorage) RemoveRankingDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveRateProfileDrv(ctx *context.Context, tenant, id string, rateIDs *[]string) (err error)
- func (rs *RedisStorage) RemoveResourceDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveResourceProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveRouteProfileDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveThresholdDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveTrendDrv(ctx *context.Context, tenant, id string) (err error)
- func (rs *RedisStorage) RemoveVersions(vrs Versions) (err error)
- func (rs *RedisStorage) RewriteConfigDB() (err error)
- func (rs *RedisStorage) RewriteDataDB() (err error)
- func (rs *RedisStorage) SelectDatabase(dbName string) (err error)
- func (rs *RedisStorage) SetAccountDrv(ctx *context.Context, ap *utils.Account) (err error)
- func (rs *RedisStorage) SetActionProfileDrv(ctx *context.Context, ap *utils.ActionProfile) (err error)
- func (rs *RedisStorage) SetAttributeProfileDrv(ctx *context.Context, r *utils.AttributeProfile) (err error)
- func (rs *RedisStorage) SetChargerProfileDrv(_ *context.Context, r *utils.ChargerProfile) (err error)
- func (rs *RedisStorage) SetConfigSectionsDrv(ctx *context.Context, nodeID string, sectionsData map[string][]byte) (err error)
- func (rs *RedisStorage) SetFilterDrv(ctx *context.Context, r *Filter) (err error)
- func (rs *RedisStorage) SetIPAllocationsDrv(ctx *context.Context, ip *utils.IPAllocations) error
- func (rs *RedisStorage) SetIPProfileDrv(ctx *context.Context, ipp *utils.IPProfile) error
- func (rs *RedisStorage) SetIndexesDrv(ctx *context.Context, idxItmType, tntCtx string, ...) (err error)
- func (rs *RedisStorage) SetLoadIDsDrv(ctx *context.Context, loadIDs map[string]int64) error
- func (rs *RedisStorage) SetRankingDrv(_ *context.Context, rn *utils.Ranking) (err error)
- func (rs *RedisStorage) SetRankingProfileDrv(ctx *context.Context, sg *utils.RankingProfile) (err error)
- func (rs *RedisStorage) SetRateProfileDrv(ctx *context.Context, rpp *utils.RateProfile, optOverwrite bool) (err error)
- func (rs *RedisStorage) SetResourceDrv(ctx *context.Context, r *utils.Resource) (err error)
- func (rs *RedisStorage) SetResourceProfileDrv(ctx *context.Context, rsp *utils.ResourceProfile) (err error)
- func (rs *RedisStorage) SetRouteProfileDrv(ctx *context.Context, r *utils.RouteProfile) (err error)
- func (rs *RedisStorage) SetSection(_ *context.Context, section string, jsn any) (err error)
- func (rs *RedisStorage) SetStatQueueDrv(ctx *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
- func (rs *RedisStorage) SetStatQueueProfileDrv(ctx *context.Context, sq *StatQueueProfile) (err error)
- func (rs *RedisStorage) SetThresholdDrv(ctx *context.Context, r *Threshold) (err error)
- func (rs *RedisStorage) SetThresholdProfileDrv(ctx *context.Context, tp *ThresholdProfile) (err error)
- func (rs *RedisStorage) SetTrendDrv(ctx *context.Context, r *utils.Trend) (err error)
- func (rs *RedisStorage) SetTrendProfileDrv(ctx *context.Context, sg *utils.TrendProfile) (err error)
- func (rs *RedisStorage) SetVersions(vrs Versions, overwrite bool) (err error)
- type ResourceMdl
- type ResourceMdls
- type ReverseFilterIHReply
- type RouteMdl
- type RouteMdls
- type SQItem
- type SQLImpl
- type SQLStorage
- func (sqls *SQLStorage) BackupStorDB(backupFolderPath string, zip bool) (err error)
- func (sqls *SQLStorage) Close()
- func (sqls *SQLStorage) CreateTablesFromScript(scriptPath string) error
- func (sqls *SQLStorage) DumpStorDB() (err error)
- func (sqls *SQLStorage) ExportGormDB() *gorm.DB
- func (sqls *SQLStorage) Flush(scriptsPath string) (err error)
- func (sqls *SQLStorage) GetCDRs(ctx *context.Context, qryFltr []*Filter, opts map[string]any) ([]*utils.CDR, error)
- func (sqls *SQLStorage) GetKeysForPrefix(ctx *context.Context, prefix string) ([]string, error)
- func (sqls *SQLStorage) GetVersions(itm string) (vrs Versions, err error)
- func (sqls *SQLStorage) IsDBEmpty() (resp bool, err error)
- func (sqls *SQLStorage) RemoveCDRs(ctx *context.Context, qryFltr []*Filter) (err error)
- func (sqls *SQLStorage) RemoveVersions(vrs Versions) (err error)
- func (sqls *SQLStorage) RewriteStorDB() (err error)
- func (sqls *SQLStorage) SelectDatabase(dbName string) (err error)
- func (sqls *SQLStorage) SetCDR(_ *context.Context, cdr *utils.CGREvent, allowUpdate bool) error
- type SessionCostsSQL
- type StatACC
- type StatACD
- type StatASR
- func (asr *StatASR) AddEvent(evID string, ev utils.DataProvider) (err error)
- func (asr *StatASR) AddOneEvent(ev utils.DataProvider) (err error)
- func (asr *StatASR) Clone() StatMetric
- func (asr *StatASR) GetStringValue(rounding int) (valStr string)
- func (asr *StatASR) GetValue() (val *utils.Decimal)
- func (asr *StatASR) RemEvent(evID string) (err error)
- type StatAverage
- type StatDDC
- func (ddc *StatDDC) AddEvent(evID string, ev utils.DataProvider) (err error)
- func (ddc *StatDDC) AddOneEvent(ev utils.DataProvider) (err error)
- func (ddc *StatDDC) Clone() StatMetric
- func (ddc *StatDDC) Compress(queueLen uint64, defaultID string) (eventIDs []string)
- func (ddc *StatDDC) GetCompressFactor(events map[string]uint64) map[string]uint64
- func (ddc *StatDDC) GetFilterIDs() []string
- func (ddc *StatDDC) GetMinItems() (minIts uint64)
- func (ddc *StatDDC) GetStringValue(rounding int) (valStr string)
- func (ddc *StatDDC) GetValue() *utils.Decimal
- func (ddc *StatDDC) RemEvent(evID string) (err error)
- type StatDistinct
- func (dst *StatDistinct) AddEvent(evID string, ev utils.DataProvider) (err error)
- func (dst *StatDistinct) AddOneEvent(ev utils.DataProvider) (err error)
- func (dst *StatDistinct) Clone() StatMetric
- func (dst *StatDistinct) Compress(uint64, string) (eventIDs []string)
- func (dst *StatDistinct) GetCompressFactor(events map[string]uint64) map[string]uint64
- func (dst *StatDistinct) GetFilterIDs() []string
- func (dst *StatDistinct) GetMinItems() uint64
- func (dst *StatDistinct) GetStringValue(rounding int) (valStr string)
- func (dst *StatDistinct) GetValue() *utils.Decimal
- func (dst *StatDistinct) RemEvent(evID string) (err error)
- type StatMdl
- type StatMdls
- type StatMetric
- func NewACC(minItems uint64, _ string, filterIDs []string) StatMetric
- func NewACD(minItems uint64, _ string, filterIDs []string) StatMetric
- func NewASR(minItems uint64, _ string, filterIDs []string) StatMetric
- func NewDDC(minItems uint64, _ string, filterIDs []string) StatMetric
- func NewPDD(minItems uint64, _ string, filterIDs []string) StatMetric
- func NewStatAverage(minItems uint64, fieldName string, filterIDs []string) StatMetric
- func NewStatDistinct(minItems uint64, fieldName string, filterIDs []string) StatMetric
- func NewStatMetric(metricID string, minItems uint64, filterIDs []string) (sm StatMetric, err error)
- func NewStatSum(minItems uint64, fieldName string, filterIDs []string) StatMetric
- func NewTCC(minItems uint64, _ string, filterIDs []string) StatMetric
- func NewTCD(minItems uint64, _ string, filterIDs []string) StatMetric
- type StatPDD
- type StatQueue
- func (sq *StatQueue) CacheClone() any
- func (sq *StatQueue) Clone() (cln *StatQueue)
- func (sq *StatQueue) Compress(maxQL uint64) bool
- func (sq *StatQueue) Expand()
- func (sq *StatQueue) GobDecode(rply []byte) (err error)
- func (sq StatQueue) GobEncode() (rply []byte, err error)
- func (sq *StatQueue) MarshalJSON() (rply []byte, err error)
- func (sq *StatQueue) ProcessEvent(ctx *context.Context, tnt, evID string, filterS *FilterS, ...) (err error)
- func (sq *StatQueue) TenantID() string
- func (sq *StatQueue) UnmarshalJSON(data []byte) (err error)
- type StatQueueProfile
- func (sqp *StatQueueProfile) CacheClone() any
- func (sqp *StatQueueProfile) Clone() *StatQueueProfile
- func (sqp *StatQueueProfile) FieldAsInterface(fldPath []string) (_ any, err error)
- func (sqp *StatQueueProfile) FieldAsString(fldPath []string) (_ string, err error)
- func (sqp *StatQueueProfile) Merge(v2 any)
- func (sqp *StatQueueProfile) Set(path []string, val any, newBranch bool) (err error)
- func (sqp *StatQueueProfile) String() string
- func (sqp *StatQueueProfile) TenantID() string
- type StatQueueProfileWithAPIOpts
- type StatQueueWithAPIOpts
- type StatS
- func (sS *StatS) Reload(ctx *context.Context)
- func (sS *StatS) Shutdown(ctx *context.Context)
- func (sS *StatS) StartLoop(ctx *context.Context)
- func (sS *StatS) StoreStatQueue(ctx *context.Context, sq *StatQueue) (err error)
- func (sS *StatS) V1GetQueueDecimalMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, ...) (err error)
- func (sS *StatS) V1GetQueueFloatMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, ...) (err error)
- func (sS *StatS) V1GetQueueIDs(ctx *context.Context, args *utils.TenantWithAPIOpts, qIDs *[]string) (err error)
- func (sS *StatS) V1GetQueueStringMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, ...) (err error)
- func (sS *StatS) V1GetStatQueue(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *StatQueue) (err error)
- func (sS *StatS) V1GetStatQueuesForEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error)
- func (sS *StatS) V1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error)
- func (sS *StatS) V1ResetStatQueue(ctx *context.Context, tntID *utils.TenantIDWithAPIOpts, rply *string) (err error)
- type StatSum
- type StatTCC
- type StatTCD
- type StorDB
- type Storage
- type StoredStatQueue
- type TBLVersion
- type Threshold
- type ThresholdMdl
- type ThresholdMdls
- type ThresholdProfile
- func (tp *ThresholdProfile) CacheClone() any
- func (tp *ThresholdProfile) Clone() *ThresholdProfile
- func (tp *ThresholdProfile) FieldAsInterface(fldPath []string) (_ any, err error)
- func (tp *ThresholdProfile) FieldAsString(fldPath []string) (_ string, err error)
- func (tp *ThresholdProfile) Merge(v2 any)
- func (tp *ThresholdProfile) Set(path []string, val any, _ bool) (err error)
- func (tp *ThresholdProfile) String() string
- func (tp *ThresholdProfile) TenantID() string
- type ThresholdProfileWithAPIOpts
- type ThresholdS
- func (tS *ThresholdS) Reload(ctx *context.Context)
- func (tS *ThresholdS) Shutdown(ctx *context.Context)
- func (tS *ThresholdS) StartLoop(ctx *context.Context)
- func (tS *ThresholdS) StoreThreshold(ctx *context.Context, t *Threshold) (err error)
- func (tS *ThresholdS) V1GetThreshold(ctx *context.Context, tntID *utils.TenantIDWithAPIOpts, t *Threshold) (err error)
- func (tS *ThresholdS) V1GetThresholdIDs(ctx *context.Context, args *utils.TenantWithAPIOpts, tIDs *[]string) (err error)
- func (tS *ThresholdS) V1GetThresholdsForEvent(ctx *context.Context, args *utils.CGREvent, reply *[]*Threshold) (err error)
- func (tS *ThresholdS) V1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error)
- func (tS *ThresholdS) V1ResetThreshold(ctx *context.Context, tntID *utils.TenantIDWithAPIOpts, rply *string) (err error)
- type ThresholdWithAPIOpts
- type TpReader
- func (tpr *TpReader) GetLoadedIds(categ string) ([]string, error)
- func (tpr *TpReader) Init()
- func (tpr *TpReader) LoadAccounts() error
- func (tpr *TpReader) LoadAccountsFiltered(tag string) (err error)
- func (tpr *TpReader) LoadActionProfiles() error
- func (tpr *TpReader) LoadActionProfilesFiltered(tag string) (err error)
- func (tpr *TpReader) LoadAll() (err error)
- func (tpr *TpReader) LoadAttributeProfiles() error
- func (tpr *TpReader) LoadAttributeProfilesFiltered(tag string) (err error)
- func (tpr *TpReader) LoadChargerProfiles() error
- func (tpr *TpReader) LoadChargerProfilesFiltered(tag string) (err error)
- func (tpr *TpReader) LoadFilters() error
- func (tpr *TpReader) LoadFiltersFiltered(tag string) error
- func (tpr *TpReader) LoadRankings() error
- func (tpr *TpReader) LoadRankingsFiltered(tag string) error
- func (tpr *TpReader) LoadRateProfiles() error
- func (tpr *TpReader) LoadRateProfilesFiltered(tag string) (err error)
- func (tpr *TpReader) LoadResourceProfiles() error
- func (tpr *TpReader) LoadResourceProfilesFiltered(tag string) (err error)
- func (tpr *TpReader) LoadRouteProfiles() error
- func (tpr *TpReader) LoadRouteProfilesFiltered(tag string) (err error)
- func (tpr *TpReader) LoadStats() error
- func (tpr *TpReader) LoadStatsFiltered(tag string) (err error)
- func (tpr *TpReader) LoadThresholds() error
- func (tpr *TpReader) LoadThresholdsFiltered(tag string) (err error)
- func (tpr *TpReader) LoadTrends() error
- func (tpr *TpReader) LoadTrendsFiltered(tag string) error
- func (tpr *TpReader) ReloadCache(ctx *context.Context, caching string, verbose bool, opts map[string]any, ...) (err error)
- func (tpr *TpReader) ReloadScheduler(verbose bool) (err error)
- func (tpr *TpReader) RemoveFromDatabase(verbose, disableReverse bool) (err error)
- func (tpr *TpReader) ShowStatistics()
- func (tpr *TpReader) WriteToDatabase(verbose, disableReverse bool) (err error)
- type TrendMdl
- type TrendMdls
- type Versions
Constants ¶
const ( ColDst = "destinations" ColRds = "reverse_destinations" ColAct = "actions" ColApl = "action_plans" ColAAp = "account_action_plans" ColTsk = "tasks" ColAtr = "action_triggers" ColRpl = "rating_plans" ColRpf = "rating_profiles" ColAcc = "accounts" ColShg = "shared_groups" ColLht = "load_history" ColVer = "versions" ColRsP = "resource_profiles" ColIPp = "ip_profiles" ColIndx = "indexes" ColRes = "resources" ColIPs = "ips" ColSqs = "statqueues" ColSqp = "statqueue_profiles" ColTps = "threshold_profiles" ColThs = "thresholds" ColTrs = "trend_profiles" ColTrd = "trends" ColRgp = "ranking_profiles" ColRnk = "rankings" ColFlt = "filters" ColRts = "route_profiles" ColAttr = "attribute_profiles" ColCDRs = "cdrs" ColCpp = "charger_profiles" ColRpp = "rate_profiles" ColApp = "action_profiles" ColLID = "load_ids" ColAnp = "account_profiles" )
Collection names in MongoDB.
const (
ColCfg = "config"
)
const (
RedisLimit = 524287 // https://github.com/StackExchange/StackExchange.Redis/issues/201#issuecomment-98639005
)
Redis commands
Variables ¶
var ( FilterIndexTypes = utils.NewStringSet([]string{utils.MetaPrefix, utils.MetaString, utils.MetaSuffix, utils.MetaExists, utils.MetaNotExists}) // Element or values of a filter that starts with one of this should not be indexed ToNotBeIndexed = []string{utils.DynamicDataPrefix + utils.MetaAccounts, utils.DynamicDataPrefix + utils.MetaStats, utils.DynamicDataPrefix + utils.MetaResources, utils.DynamicDataPrefix + utils.MetaLibPhoneNumber} )
var ( MetaOriginLow = strings.ToLower(utils.MetaOriginID) RunIDLow = strings.ToLower(utils.RunID) OrderIDLow = strings.ToLower(utils.OrderID) OriginHostLow = strings.ToLower(utils.OriginHost) OriginIDLow = strings.ToLower(utils.OriginID) ToRLow = strings.ToLower(utils.ToR) CDRHostLow = strings.ToLower(utils.OriginHost) CDRSourceLow = strings.ToLower(utils.Source) RequestTypeLow = strings.ToLower(utils.RequestType) TenantLow = strings.ToLower(utils.Tenant) CategoryLow = strings.ToLower(utils.Category) AccountLow = strings.ToLower(utils.AccountField) SubjectLow = strings.ToLower(utils.Subject) SetupTimeLow = strings.ToLower(utils.SetupTime) AnswerTimeLow = strings.ToLower(utils.AnswerTime) CreatedAtLow = strings.ToLower(utils.CreatedAt) UpdatedAtLow = strings.ToLower(utils.UpdatedAt) UsageLow = strings.ToLower(utils.Usage) DestinationLow = strings.ToLower(utils.Destination) CostLow = strings.ToLower(utils.Cost) CostSourceLow = strings.ToLower(utils.CostSource) )
Functions ¶
func APItoAccount ¶
func APItoActionProfile ¶
func APItoActionProfile(tpAp *utils.TPActionProfile, timezone string) (ap *utils.ActionProfile, err error)
func APItoAttributeProfile ¶
func APItoAttributeProfile(tpAttr *utils.TPAttributeProfile, timezone string) (attrPrf *utils.AttributeProfile, err error)
func APItoChargerProfile ¶
func APItoChargerProfile(tpCPP *utils.TPChargerProfile, timezone string) (cpp *utils.ChargerProfile)
func APItoRanking ¶
func APItoRanking(tpRG *utils.TPRankingProfile) (rg *utils.RankingProfile, err error)
func APItoRateProfile ¶
func APItoRateProfile(tpRp *utils.TPRateProfile, timezone string) (rp *utils.RateProfile, err error)
func APItoResource ¶
func APItoResource(tpRL *utils.TPResourceProfile, timezone string) (rp *utils.ResourceProfile, err error)
func APItoRouteProfile ¶
func APItoRouteProfile(tpRp *utils.TPRouteProfile, timezone string) (rp *utils.RouteProfile, err error)
func APItoTrends ¶
func APItoTrends(tpTR *utils.TPTrendsProfile) (tr *utils.TrendProfile, err error)
func ActionProfileToAPI ¶
func ActionProfileToAPI(ap *utils.ActionProfile) (tpAp *utils.TPActionProfile)
func AppendToMysqlDSNOpts ¶
func AttributeProfileToAPI ¶
func AttributeProfileToAPI(attrPrf *utils.AttributeProfile) (tpAttr *utils.TPAttributeProfile)
func BlockerFromDynamics ¶
func BlockerFromDynamics(ctx *context.Context, dBs []*utils.DynamicBlocker, fltrS *FilterS, tnt string, ev utils.DataProvider) (blckr bool, err error)
BlockerFromDynamics returns the value of the blocker specified by the first matching DynamicBlocker
func CallCache ¶
func CallCache(connMgr *ConnManager, ctx *context.Context, cacheConns []string, caching string, args map[string][]string, cacheIDs []string, opts map[string]any, verbose bool, tenant string) (err error)
CallCache call the cache reload after data load
func ChargerProfileToAPI ¶
func ChargerProfileToAPI(chargerPrf *utils.ChargerProfile) (tpCharger *utils.TPChargerProfile)
func CheckFilter ¶
func CheckVersions ¶
CheckVersions returns an error if the db needs migration.
func ComputeIndexes ¶
func ComputeIndexes(ctx *context.Context, dm *DataManager, tnt, grp, idxItmType string, IDs *[]string, transactionID string, getFilters func(tnt, id, grp string) (*[]string, error), newFltr *Filter) (indexes utils.StringSet, err error)
ComputeIndexes gets the indexes from the DB and ensure that the items are indexed getFilters returns a list of filters IDs for the given profile id
func ExtractURLFromHTTPType ¶
ExtractURLFromHTTPType parses a type string in the format "prefix#url" and returns the URL portion.
func FilterToTPFilter ¶
func FilterToTPFilter(f *Filter) (tpFltr *utils.TPFilterProfile)
func GetBoolOpts ¶
func GetBoolOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicBoolOpt, optNames ...string) (cfgOpt bool, err error)
GetBoolOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as bool, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetDecimalBigOpts ¶
func GetDecimalBigOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicDecimalOpt, optNames ...string) (cfgOpt *decimal.Big, err error)
GetDecimalBigOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as *decimal.Big, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetDurationOpts ¶
func GetDurationOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicDurationOpt, optNames ...string) (cfgOpt time.Duration, err error)
GetDurationOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as time.Duration, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetDurationOptsFromMultipleMaps ¶
func GetDurationOptsFromMultipleMaps(ctx *context.Context, tnt string, eventStart, apiOpts, startOpts map[string]any, fS *FilterS, dynOpts []*config.DynamicDurationOpt, dftOpt time.Duration, optName string) (cfgOpt time.Duration, err error)
GetDurationOptsFromMultipleMaps checks the specified option names in order among the keys in APIOpts, then in startOpts, returning the first value it finds as time.Duration, otherwise it returns the config option if at least one filter passes or the default one if none of them do
func GetDurationPointerOpts ¶
func GetDurationPointerOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicDurationPointerOpt, optNames ...string) (cfgOpt *time.Duration, err error)
GetDurationPointerOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as *time.Duration, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetDurationPointerOptsFromMultipleMaps ¶
func GetDurationPointerOptsFromMultipleMaps(ctx *context.Context, tnt string, eventStart, apiOpts, startOpts map[string]any, fS *FilterS, dynOpts []*config.DynamicDurationPointerOpt, optName string) (cfgOpt *time.Duration, err error)
GetDurationPointerOptsFromMultipleMaps checks the specified option names in order among the keys in APIOpts, then in startOpts, returning the first value it finds as *time.Duration, otherwise it returns the config option if at least one filter passes or NOT_FOUND if none of them do
func GetFloat64Opts ¶
func GetFloat64Opts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicFloat64Opt, optNames ...string) (cfgOpt float64, err error)
GetFloat64Opts checks the specified option names in order among the keys in APIOpts returning the first value it finds as float64, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetIntOpts ¶
func GetIntOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicIntOpt, optNames ...string) (cfgOpt int, err error)
GetIntOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as int, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetIntPointerOpts ¶
func GetIntPointerOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicIntPointerOpt, optNames ...string) (cfgOpt *int, err error)
GetIntPointerOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as *int, otherwise it returns the config option if at least one filter passes or NOT_FOUND if none of them do
func GetInterfaceOpts ¶
func GetInterfaceOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicInterfaceOpt, optNames ...string) (cfgOpt any, err error)
GetInterfaceOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as any, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetRevFltrIdxHealth ¶
func GetRevFltrIdxHealth(ctx *context.Context, dm *DataManager, fltrCache, revFltrIdxCache *ltcache.Cache, objCaches map[string]*ltcache.Cache) (rply map[string]*ReverseFilterIHReply, err error)
GetRevFltrIdxHealth will return all the broken indexes
func GetSentryPeer ¶
func GetStringOpts ¶
func GetStringOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicStringOpt, optNames ...string) (cfgOpt string, err error)
GetStringOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as string, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetStringSliceOpts ¶
func GetStringSliceOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicStringSliceOpt, dftOpt []string, optNames ...string) (cfgOpt []string, err error)
GetStringSliceOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as []string, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func GetTimeOpts ¶
func GetTimeOpts(ctx *context.Context, tnt string, dP utils.DataProvider, cch map[string]any, fS *FilterS, dynOpts []*config.DynamicStringOpt, tmz string, optNames ...string) (_ time.Time, err error)
GetTimeOpts checks the specified option names in order among the keys in APIOpts returning the first value it finds as time.Time, otherwise it returns the config option if at least one filter passes or the default value if none of them do
func HTTPPstrTransport ¶
HTTPPstrTransport gets the http transport to be used by the HTTP Poster
func IsDynamicDPPath ¶
IsDynamicDPPath check dynamic path with ~*stats, ~*resources, ~*accounts, ~*libphonenumber, ~*asm to not be indexed Used to determine if the rule will be indexed
func MakeExternalAPIRequest ¶
MakeExternalAPIRequest makes an HTTP GET request to the specified URL with the provided request body and returns the response body as a string.
func MatchingItemIDsForEvent ¶
func MatchingItemIDsForEvent(ctx *context.Context, ev utils.MapStorage, stringFldIDs, prefixFldIDs, suffixFldIDs, existsFldIDs, notExistsFldIDs *[]string, dm *DataManager, cacheID, itemIDPrefix string, indexedSelects, nestedFields bool) (itemIDs utils.StringSet, err error)
MatchingItemIDsForEvent returns the list of item IDs matching fieldName/fieldValue for an event fieldIDs limits the fields which are checked against indexes helper on top of dataDB.GetIndexes, adding utils.MetaAny to list of fields queried
func NewCsvFile ¶
func NewCsvFile() csvReaderCloser
func NewCsvString ¶
func NewCsvString() csvReaderCloser
func NewRPCConnection ¶
func NewRPCConnection(ctx *context.Context, cfg *config.RemoteHost, keyPath, certPath, caPath string, connAttempts, reconnects int, maxReconnectInterval, connectTimeout, replyTimeout time.Duration, internalConnChan chan birpc.ClientConnector, lazyConnect bool, biRPCClient any, poolID, connID string, connCache *ltcache.Cache) (client birpc.ClientConnector, err error)
NewRPCConnection creates a new connection based on the RemoteHost structure connCache is used to cache the connection with ID
func NewRPCPool ¶
func NewRPCPool(ctx *context.Context, dispatchStrategy string, keyPath, certPath, caPath string, connAttempts, reconnects int, maxReconnectInterval, connectTimeout, replyTimeout time.Duration, rpcConnCfgs []*config.RemoteHost, internalConnChan chan birpc.ClientConnector, lazyConnect bool, biRPCClient any, poolID string, connCache *ltcache.Cache) (rpcPool *rpcclient.RPCPool, err error)
NewRPCPool returns a new pool of connection with the given configuration
func NewServiceWithPing ¶
func OverwriteDBVersions ¶
OverwriteDBVersions sets the version overwriting them
func RankingProfileToAPI ¶
func RankingProfileToAPI(rg *utils.RankingProfile) (tpRG *utils.TPRankingProfile)
func RateProfileToAPI ¶
func RateProfileToAPI(rp *utils.RateProfile) (tpRp *utils.TPRateProfile)
func ResourceProfileToAPI ¶
func ResourceProfileToAPI(rp *utils.ResourceProfile) (tpRL *utils.TPResourceProfile)
func RouteProfileToAPI ¶
func RouteProfileToAPI(rp *utils.RouteProfile) (tpRp *utils.TPRouteProfile)
func SetConnManager ¶
func SetConnManager(cm *ConnManager)
SetConnManager is the exported method to set the connectionManager used when operate on an account.
func SetDBVersions ¶
SetDBVersions sets the version without overwriting them
func SetHTTPPstrTransport ¶
SetHTTPPstrTransport sets the http transport to be used by the HTTP Poster
func StatQueueProfileToAPI ¶
func StatQueueProfileToAPI(st *StatQueueProfile) (tpST *utils.TPStatProfile)
func ThresholdProfileToAPI ¶
func ThresholdProfileToAPI(th *ThresholdProfile) (tpTH *utils.TPThresholdProfile)
func TrendProfileToAPI ¶
func TrendProfileToAPI(tr *utils.TrendProfile) (tpTR *utils.TPTrendsProfile)
func UpdateFilterIndex ¶
func UpdateFilterIndex(ctx *context.Context, dm *DataManager, oldFlt, newFlt *Filter) (err error)
UpdateFilterIndex will update the indexes for the new Filter we do not care what is added exported for the migrator
func UpdateReplicationFilters ¶ added in v0.10.3
func UpdateReplicationFilters(objType, objID, connID string)
UpdateReplicationFilters will set the connID in cache
func WeightFromDynamics ¶
func WeightFromDynamics(ctx *context.Context, dWs []*utils.DynamicWeight, fltrS *FilterS, tnt string, ev utils.DataProvider) (wg float64, err error)
Weight returns the weight specified by the first matching DynamicWeight
Types ¶
type AccountMdl ¶
type AccountMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
Blockers string `index:"4" re:".*"`
Opts string `index:"5" re:".*"`
BalanceID string `index:"6" re:".*"`
BalanceFilterIDs string `index:"7" re:".*"`
BalanceWeights string `index:"8" re:".*"`
BalanceBlockers string `index:"9" re:".*"`
BalanceType string `index:"10" re:".*"`
BalanceUnits string `index:"11" re:".*"`
BalanceUnitFactors string `index:"12" re:".*"`
BalanceOpts string `index:"13" re:".*"`
BalanceCostIncrements string `index:"14" re:".*"`
BalanceAttributeIDs string `index:"15" re:".*"`
BalanceRateProfileIDs string `index:"16" re:".*"`
ThresholdIDs string `index:"17" re:".*"`
CreatedAt time.Time
}
func (AccountMdl) TableName ¶
func (AccountMdl) TableName() string
type AccountMdls ¶
type AccountMdls []*AccountMdl
func APItoModelTPAccount ¶
func APItoModelTPAccount(tPrf *utils.TPAccount) (mdls AccountMdls)
func (AccountMdls) AsTPAccount ¶
func (apm AccountMdls) AsTPAccount() (result []*utils.TPAccount, err error)
func (AccountMdls) CSVHeader ¶
func (apm AccountMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type ActionProfileMdl ¶
type ActionProfileMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
Blockers string `index:"4" re:".*"`
Schedule string `index:"5" re:".*"`
TargetType string `index:"6" re:".*"`
TargetIDs string `index:"7" re:".*"`
ActionID string `index:"8" re:".*"`
ActionFilterIDs string `index:"9" re:".*"`
ActionTTL string `index:"10" re:".*"`
ActionType string `index:"11" re:".*"`
ActionOpts string `index:"12" re:".*"`
ActionPath string `index:"13" re:".*"`
ActionValue string `index:"14" re:".*"`
CreatedAt time.Time
}
func (ActionProfileMdl) TableName ¶
func (ActionProfileMdl) TableName() string
type ActionProfileMdls ¶
type ActionProfileMdls []*ActionProfileMdl
func APItoModelTPActionProfile ¶
func APItoModelTPActionProfile(tPrf *utils.TPActionProfile) (mdls ActionProfileMdls)
func (ActionProfileMdls) AsTPActionProfile ¶
func (apm ActionProfileMdls) AsTPActionProfile() (result []*utils.TPActionProfile)
func (ActionProfileMdls) CSVHeader ¶
func (apm ActionProfileMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type ArgsFiltersMatch ¶
type AttributeMdl ¶
type AttributeMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
Blockers string `index:"4" re:".*"`
AttributeFilterIDs string `index:"5" re:".*"`
AttributeBlockers string `index:"6" re:".*"`
Path string `index:"7" re:".*"`
Type string `index:"8" re:".*"`
Value string `index:"9" re:".*"`
CreatedAt time.Time
}
func (AttributeMdl) TableName ¶
func (AttributeMdl) TableName() string
type AttributeMdls ¶
type AttributeMdls []*AttributeMdl
func APItoModelTPAttribute ¶
func APItoModelTPAttribute(ap *utils.TPAttributeProfile) (mdls AttributeMdls)
func (AttributeMdls) AsTPAttributes ¶
func (tps AttributeMdls) AsTPAttributes() (result []*utils.TPAttributeProfile)
func (AttributeMdls) CSVHeader ¶
func (tps AttributeMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type CDRsql ¶
type CDRsql struct {
ID int64
RunID string
OriginHost string
Source string
OriginID string
TOR string
RequestType string
Tenant string
Category string
Account string
Subject string
Destination string
SetupTime time.Time
AnswerTime *time.Time
Usage int64
ExtraFields string
CostSource string
Cost float64
CostDetails string
ExtraInfo string
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
}
func (CDRsql) AsMapStringInterface ¶
type CSVStorage ¶
type CSVStorage struct {
// contains filtered or unexported fields
}
CSVStorage the basic csv storage
func NewCSVStorage ¶
func NewCSVStorage(sep rune, resProfilesFn, statsFn, rankingsFn, trendsFn, thresholdsFn, filterFn, routeProfilesFn, attributeProfilesFn, chargerProfilesFn, rateProfilesFn, actionProfilesFn, accountsFn []string) *CSVStorage
NewCSVStorage creates a CSV storege that takes the data from the paths specified
func NewFileCSVStorage ¶
func NewFileCSVStorage(sep rune, dataPath string) (*CSVStorage, error)
NewFileCSVStorage returns a csv storage that uses all files from the folder
func NewGoogleCSVStorage ¶
func NewGoogleCSVStorage(sep rune, spreadsheetID string) (*CSVStorage, error)
NewGoogleCSVStorage creates a csv storege from google sheets
func NewStringCSVStorage ¶
func NewStringCSVStorage(sep rune, resProfilesFn, statsFn, rankingsFn, trendsFn, thresholdsFn, filterFn, routeProfilesFn, attributeProfilesFn, chargerProfilesFn, dispatcherProfilesFn, dispatcherHostsFn, rateProfilesFn, actionProfilesFn, accountsFn string) *CSVStorage
NewStringCSVStorage creates a csv storage from strings
func NewURLCSVStorage ¶
func NewURLCSVStorage(sep rune, dataPath string) *CSVStorage
NewURLCSVStorage returns a CSVStorage that can parse URLs
func (*CSVStorage) GetTPAccounts ¶
func (csvs *CSVStorage) GetTPAccounts(tpid, tenant, id string) ([]*utils.TPAccount, error)
func (*CSVStorage) GetTPActionProfiles ¶
func (csvs *CSVStorage) GetTPActionProfiles(tpid, tenant, id string) ([]*utils.TPActionProfile, error)
func (*CSVStorage) GetTPAttributes ¶
func (csvs *CSVStorage) GetTPAttributes(tpid, tenant, id string) ([]*utils.TPAttributeProfile, error)
func (*CSVStorage) GetTPChargers ¶
func (csvs *CSVStorage) GetTPChargers(tpid, tenant, id string) ([]*utils.TPChargerProfile, error)
func (*CSVStorage) GetTPFilters ¶
func (csvs *CSVStorage) GetTPFilters(tpid, tenant, id string) ([]*utils.TPFilterProfile, error)
func (*CSVStorage) GetTPRankings ¶
func (csvs *CSVStorage) GetTPRankings(tpid, tenant, id string) ([]*utils.TPRankingProfile, error)
func (*CSVStorage) GetTPRateProfiles ¶
func (csvs *CSVStorage) GetTPRateProfiles(tpid, tenant, id string) ([]*utils.TPRateProfile, error)
func (*CSVStorage) GetTPResources ¶
func (csvs *CSVStorage) GetTPResources(tpid, tenant, id string) ([]*utils.TPResourceProfile, error)
func (*CSVStorage) GetTPRoutes ¶
func (csvs *CSVStorage) GetTPRoutes(tpid, tenant, id string) ([]*utils.TPRouteProfile, error)
func (*CSVStorage) GetTPStats ¶
func (csvs *CSVStorage) GetTPStats(tpid, tenant, id string) ([]*utils.TPStatProfile, error)
func (*CSVStorage) GetTPThresholds ¶
func (csvs *CSVStorage) GetTPThresholds(tpid, tenant, id string) ([]*utils.TPThresholdProfile, error)
func (*CSVStorage) GetTPTrends ¶
func (csvs *CSVStorage) GetTPTrends(tpid, tenant, id string) ([]*utils.TPTrendsProfile, error)
func (*CSVStorage) GetTpTableIds ¶
func (csvs *CSVStorage) GetTpTableIds(tpid, table string, distinct []string, filters map[string]string, p *utils.PaginatorWithSearch) ([]string, error)
type CacheS ¶
type CacheS struct {
// contains filtered or unexported fields
}
CacheS deals with cache preload and other cache related tasks/APIs
var Cache *CacheS
func NewCacheS ¶
func NewCacheS(cfg *config.CGRConfig, dm *DataManager, connMgr *ConnManager, cpS *CapsStats) (c *CacheS)
NewCacheS initializes the Cache service and executes the precaching
func (*CacheS) BeginTransaction ¶
BeginTransaction is an exported method from TransCache
func (*CacheS) CommitTransaction ¶
CommitTransaction is an exported method from TransCache
func (*CacheS) GetItemIDs ¶
GetItemIDs is an exported method from TransCache
func (*CacheS) GetPrecacheChannel ¶
GetPrecacheChannel returns the channel used to signal precaching
func (*CacheS) GetWithRemote ¶
func (chS *CacheS) GetWithRemote(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts) (itm any, err error)
GetWithRemote queries locally the cache, followed by remotes
func (*CacheS) Precache ¶
func (chS *CacheS) Precache(shutdown *utils.SyncedChan)
Precache loads data from DataDB into cache at engine start
func (*CacheS) Remove ¶
func (chS *CacheS) Remove(ctx *context.Context, chID, itmID string, commit bool, transID string) (err error)
Remove is an exported method from TransCache
func (*CacheS) RemoveWithoutReplicate ¶
RemoveWithoutReplicate is an exported method from TransCache
func (*CacheS) ReplicateRemove ¶
ReplicateRemove replicate an item to ReplicationConns
func (*CacheS) ReplicateSet ¶
ReplicateSet replicate an item to ReplicationConns
func (*CacheS) RollbackTransaction ¶
RollbackTransaction is an exported method from TransCache
func (*CacheS) Set ¶
func (chS *CacheS) Set(ctx *context.Context, chID, itmID string, value any, groupIDs []string, commit bool, transID string) (err error)
Set is an exported method from TransCache handled Replicate functionality
func (*CacheS) SetWithReplicate ¶
func (chS *CacheS) SetWithReplicate(ctx *context.Context, args *utils.ArgCacheReplicateSet) (err error)
SetWithReplicate combines local set with replicate, receiving the arguments needed by dispatcher
func (*CacheS) SetWithoutReplicate ¶
func (chS *CacheS) SetWithoutReplicate(chID, itmID string, value any, groupIDs []string, commit bool, transID string)
SetWithoutReplicate is an exported method from TransCache handled Replicate functionality
func (*CacheS) V1GetCacheStats ¶
func (chS *CacheS) V1GetCacheStats(ctx *context.Context, args *utils.AttrCacheIDsWithAPIOpts, rply *map[string]*ltcache.CacheStats) (err error)
func (*CacheS) V1GetGroupItemIDs ¶
func (*CacheS) V1GetItem ¶
func (chS *CacheS) V1GetItem(_ *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *any) (err error)
V1GetItem returns a single item from the cache
func (*CacheS) V1GetItemExpiryTime ¶
func (*CacheS) V1GetItemIDs ¶
func (chS *CacheS) V1GetItemIDs(_ *context.Context, args *utils.ArgsGetCacheItemIDsWithAPIOpts, reply *[]string) (err error)
APIs start here
func (*CacheS) V1GetItemWithRemote ¶
func (chS *CacheS) V1GetItemWithRemote(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *any) (err error)
V1GetItemWithRemote queries the item from remote if not found locally
func (*CacheS) V1HasGroup ¶
func (*CacheS) V1LoadCache ¶
func (*CacheS) V1PrecacheStatus ¶
func (*CacheS) V1ReloadCache ¶
func (*CacheS) V1RemoveGroup ¶
func (*CacheS) V1RemoveItem ¶
func (*CacheS) V1RemoveItems ¶
func (*CacheS) V1ReplicateRemove ¶
func (chS *CacheS) V1ReplicateRemove(_ *context.Context, args *utils.ArgCacheReplicateRemove, reply *string) (err error)
V1ReplicateRemove replicate an item
func (*CacheS) V1ReplicateSet ¶
func (chS *CacheS) V1ReplicateSet(_ *context.Context, args *utils.ArgCacheReplicateSet, reply *string) (err error)
V1ReplicateSet receives an item via replication to store in the cache
type Caps ¶
type Caps struct {
// contains filtered or unexported fields
}
Caps the structure that allocs requests for API
func (*Caps) Deallocate ¶
func (cR *Caps) Deallocate()
Deallocate will free a channel for the API call
type CapsStats ¶
CapsStats stores the stats for caps
func NewCapsStats ¶
NewCapsStats returns the stats for the caps
func (*CapsStats) GetAverage ¶
GetAverage returns the average allocated caps
type ChargerMdl ¶
type ChargerMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
Blockers string `index:"4" re:".*"`
RunID string `index:"5" re:".*"`
AttributeIDs string `index:"6" re:".*"`
CreatedAt time.Time
}
func (ChargerMdl) TableName ¶
func (ChargerMdl) TableName() string
type ChargerMdls ¶
type ChargerMdls []*ChargerMdl
func APItoModelTPCharger ¶
func APItoModelTPCharger(tpCPP *utils.TPChargerProfile) (mdls ChargerMdls)
func (ChargerMdls) AsTPChargers ¶
func (tps ChargerMdls) AsTPChargers() (result []*utils.TPChargerProfile)
func (ChargerMdls) CSVHeader ¶
func (tps ChargerMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type ConnManager ¶
type ConnManager struct {
// contains filtered or unexported fields
}
ConnManager handle the RPC connections
func NewConnManager ¶
func NewConnManager(cfg *config.CGRConfig) (cM *ConnManager)
NewConnManager returns the Connection Manager
func (*ConnManager) AddInternalConn ¶
func (cM *ConnManager) AddInternalConn(connName, apiPrefix string, iConnCh chan birpc.ClientConnector)
func (*ConnManager) Call ¶
func (cM *ConnManager) Call(ctx *context.Context, connIDs []string, method string, arg, reply any) (err error)
Call gets the connection calls the method on it
func (*ConnManager) CallWithConnIDs ¶ added in v0.10.3
func (cM *ConnManager) CallWithConnIDs(connIDs []string, ctx *context.Context, subsHostIDs utils.StringSet, method string, arg, reply any) (err error)
CallWithConnIDs will call the method only on specified rpcconns
func (*ConnManager) GetDispInternalChan ¶
func (cM *ConnManager) GetDispInternalChan() chan birpc.ClientConnector
func (*ConnManager) GetInternalChan ¶
func (cM *ConnManager) GetInternalChan() chan birpc.ClientConnector
func (*ConnManager) Reload ¶ added in v0.10.3
func (cM *ConnManager) Reload()
Reload will clear all RPC related caches
type DataDB ¶
type DataDB interface {
Storage
HasDataDrv(*context.Context, string, string, string) (bool, error)
GetResourceProfileDrv(*context.Context, string, string) (*utils.ResourceProfile, error)
SetResourceProfileDrv(*context.Context, *utils.ResourceProfile) error
RemoveResourceProfileDrv(*context.Context, string, string) error
GetResourceDrv(*context.Context, string, string) (*utils.Resource, error)
SetResourceDrv(*context.Context, *utils.Resource) error
RemoveResourceDrv(*context.Context, string, string) error
GetIPProfileDrv(*context.Context, string, string) (*utils.IPProfile, error)
SetIPProfileDrv(*context.Context, *utils.IPProfile) error
RemoveIPProfileDrv(*context.Context, string, string) error
GetIPAllocationsDrv(*context.Context, string, string) (*utils.IPAllocations, error)
SetIPAllocationsDrv(*context.Context, *utils.IPAllocations) error
RemoveIPAllocationsDrv(*context.Context, string, string) error
GetLoadHistory(int, bool, string) ([]*utils.LoadInstance, error)
AddLoadHistory(*utils.LoadInstance, int, string) error
GetIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (indexes map[string]utils.StringSet, err error)
SetIndexesDrv(ctx *context.Context, idxItmType, tntCtx string,
indexes map[string]utils.StringSet, commit bool, transactionID string) (err error)
RemoveIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey string) (err error)
GetStatQueueProfileDrv(ctx *context.Context, tenant string, ID string) (sq *StatQueueProfile, err error)
SetStatQueueProfileDrv(ctx *context.Context, sq *StatQueueProfile) (err error)
RemStatQueueProfileDrv(ctx *context.Context, tenant, id string) (err error)
GetStatQueueDrv(ctx *context.Context, tenant, id string) (sq *StatQueue, err error)
SetStatQueueDrv(ctx *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
RemStatQueueDrv(ctx *context.Context, tenant, id string) (err error)
GetThresholdProfileDrv(ctx *context.Context, tenant string, ID string) (tp *ThresholdProfile, err error)
SetThresholdProfileDrv(ctx *context.Context, tp *ThresholdProfile) (err error)
RemThresholdProfileDrv(ctx *context.Context, tenant, id string) (err error)
GetThresholdDrv(*context.Context, string, string) (*Threshold, error)
SetThresholdDrv(*context.Context, *Threshold) error
RemoveThresholdDrv(*context.Context, string, string) error
SetRankingProfileDrv(ctx *context.Context, rp *utils.RankingProfile) (err error)
GetRankingProfileDrv(ctx *context.Context, tenant string, id string) (sq *utils.RankingProfile, err error)
RemRankingProfileDrv(ctx *context.Context, tenant string, id string) (err error)
SetRankingDrv(ctx *context.Context, rn *utils.Ranking) (err error)
GetRankingDrv(ctx *context.Context, tenant string, id string) (sq *utils.Ranking, err error)
RemoveRankingDrv(ctx *context.Context, tenant string, id string) (err error)
SetTrendProfileDrv(ctx *context.Context, sq *utils.TrendProfile) (err error)
GetTrendProfileDrv(ctx *context.Context, tenant string, id string) (sq *utils.TrendProfile, err error)
RemTrendProfileDrv(ctx *context.Context, tenant string, id string) (err error)
GetTrendDrv(ctx *context.Context, tenant string, id string) (*utils.Trend, error)
SetTrendDrv(ctx *context.Context, tr *utils.Trend) error
RemoveTrendDrv(ctx *context.Context, tenant string, id string) error
GetFilterDrv(ctx *context.Context, tnt string, id string) (*Filter, error)
SetFilterDrv(ctx *context.Context, f *Filter) error
RemoveFilterDrv(ctx *context.Context, tnt string, id string) error
GetRouteProfileDrv(*context.Context, string, string) (*utils.RouteProfile, error)
SetRouteProfileDrv(*context.Context, *utils.RouteProfile) error
RemoveRouteProfileDrv(*context.Context, string, string) error
GetAttributeProfileDrv(ctx *context.Context, tnt string, id string) (*utils.AttributeProfile, error)
SetAttributeProfileDrv(ctx *context.Context, attr *utils.AttributeProfile) error
RemoveAttributeProfileDrv(*context.Context, string, string) error
GetChargerProfileDrv(*context.Context, string, string) (*utils.ChargerProfile, error)
SetChargerProfileDrv(*context.Context, *utils.ChargerProfile) error
RemoveChargerProfileDrv(*context.Context, string, string) error
GetItemLoadIDsDrv(ctx *context.Context, itemIDPrefix string) (loadIDs map[string]int64, err error)
SetLoadIDsDrv(ctx *context.Context, loadIDs map[string]int64) error
RemoveLoadIDsDrv() error
GetRateProfileDrv(*context.Context, string, string) (*utils.RateProfile, error)
GetRateProfileRatesDrv(*context.Context, string, string, string, bool) ([]string, []*utils.Rate, error)
SetRateProfileDrv(*context.Context, *utils.RateProfile, bool) error
RemoveRateProfileDrv(*context.Context, string, string, *[]string) error
GetActionProfileDrv(*context.Context, string, string) (*utils.ActionProfile, error)
SetActionProfileDrv(*context.Context, *utils.ActionProfile) error
RemoveActionProfileDrv(*context.Context, string, string) error
GetAccountDrv(*context.Context, string, string) (*utils.Account, error)
SetAccountDrv(ctx *context.Context, profile *utils.Account) error
RemoveAccountDrv(*context.Context, string, string) error
GetConfigSectionsDrv(*context.Context, string, []string) (map[string][]byte, error)
SetConfigSectionsDrv(*context.Context, string, map[string][]byte) error
RemoveConfigSectionsDrv(*context.Context, string, []string) error
DumpDataDB() error
RewriteDataDB() error
BackupDataDB(string, bool) error
}
OnlineStorage contains methods to use for administering online data
type DataDBDriver ¶
DataDBDriver used as a DataDB but also as a ConfigProvider
func NewDataDBConn ¶
func NewDataDBConn(dbType, host, port, name, user, pass, marshaler string, opts *config.DataDBOpts, itmsCfg map[string]*config.ItemOpts) (d DataDBDriver, err error)
NewDataDBConn creates a DataDB connection
type DataDBMock ¶
type DataDBMock struct {
RemoveRateProfileDrvF func(ctx *context.Context, str1 string, str2 string, rateIDs *[]string) error
SetRateProfileDrvF func(*context.Context, *utils.RateProfile, bool) error
GetRateProfileDrvF func(*context.Context, string, string) (*utils.RateProfile, error)
GetRateProfileRatesDrvF func(*context.Context, string, string, string, bool) ([]string, []*utils.Rate, error)
GetKeysForPrefixF func(*context.Context, string) ([]string, error)
GetIndexesDrvF func(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (indexes map[string]utils.StringSet, err error)
SetIndexesDrvF func(ctx *context.Context, idxItmType, tntCtx string, indexes map[string]utils.StringSet, commit bool, transactionID string) (err error)
GetAttributeProfileDrvF func(ctx *context.Context, str1 string, str2 string) (*utils.AttributeProfile, error)
SetAttributeProfileDrvF func(ctx *context.Context, attr *utils.AttributeProfile) error
RemoveAttributeProfileDrvF func(ctx *context.Context, str1 string, str2 string) error
SetLoadIDsDrvF func(ctx *context.Context, loadIDs map[string]int64) error
GetFilterDrvF func(ctx *context.Context, str1 string, str2 string) (*Filter, error)
GetChargerProfileDrvF func(ctx *context.Context, tnt, id string) (*utils.ChargerProfile, error)
SetChargerProfileDrvF func(ctx *context.Context, chr *utils.ChargerProfile) (err error)
GetThresholdProfileDrvF func(ctx *context.Context, tenant, id string) (tp *ThresholdProfile, err error)
SetThresholdProfileDrvF func(ctx *context.Context, tp *ThresholdProfile) (err error)
RemThresholdProfileDrvF func(ctx *context.Context, tenant, id string) (err error)
GetThresholdDrvF func(ctx *context.Context, tenant, id string) (*Threshold, error)
RemoveThresholdDrvF func(ctx *context.Context, tnt, id string) error
GetResourceProfileDrvF func(ctx *context.Context, tnt, id string) (*utils.ResourceProfile, error)
SetResourceProfileDrvF func(ctx *context.Context, rp *utils.ResourceProfile) error
RemoveResourceProfileDrvF func(ctx *context.Context, tnt, id string) error
RemoveResourceDrvF func(ctx *context.Context, tnt, id string) error
SetResourceDrvF func(ctx *context.Context, r *utils.Resource) error
GetResourceDrvF func(ctx *context.Context, tenant, id string) (*utils.Resource, error)
GetIPProfileDrvF func(ctx *context.Context, tnt, id string) (*utils.IPProfile, error)
SetIPProfileDrvF func(ctx *context.Context, ipp *utils.IPProfile) error
RemoveIPProfileDrvF func(ctx *context.Context, tnt, id string) error
RemoveIPAllocationsDrvF func(ctx *context.Context, tnt, id string) error
SetIPAllocationsDrvF func(ctx *context.Context, ip *utils.IPAllocations) error
GetIPAllocationsDrvF func(ctx *context.Context, tenant, id string) (*utils.IPAllocations, error)
SetTrendProfileDrvF func(ctx *context.Context, tr *utils.TrendProfile) (err error)
GetTrendProfileDrvF func(ctx *context.Context, tenant string, id string) (sq *utils.TrendProfile, err error)
RemTrendProfileDrvF func(ctx *context.Context, tenant string, id string) (err error)
SetRankingProfileDrvF func(ctx *context.Context, sq *utils.RankingProfile) (err error)
GetRankingProfileDrvF func(ctx *context.Context, tenant string, id string) (sq *utils.RankingProfile, err error)
RemRankingProfileDrvF func(ctx *context.Context, tenant string, id string) (err error)
GetStatQueueProfileDrvF func(ctx *context.Context, tenant, id string) (sq *StatQueueProfile, err error)
SetStatQueueProfileDrvF func(ctx *context.Context, sq *StatQueueProfile) (err error)
RemStatQueueProfileDrvF func(ctx *context.Context, tenant, id string) (err error)
RemStatQueueDrvF func(ctx *context.Context, tenant, id string) (err error)
SetFilterDrvF func(ctx *context.Context, fltr *Filter) error
GetActionProfileDrvF func(ctx *context.Context, tenant string, ID string) (*utils.ActionProfile, error)
SetActionProfileDrvF func(ctx *context.Context, ap *utils.ActionProfile) error
RemoveActionProfileDrvF func(ctx *context.Context, tenant string, ID string) error
RemoveFilterDrvF func(ctx *context.Context, str1 string, str2 string) error
SetAccountDrvF func(ctx *context.Context, profile *utils.Account) error
GetAccountDrvF func(ctx *context.Context, str1 string, str2 string) (*utils.Account, error)
RemoveAccountDrvF func(ctx *context.Context, str1 string, str2 string) error
GetRouteProfileDrvF func(ctx *context.Context, tnt, id string) (*utils.RouteProfile, error)
SetRouteProfileDrvF func(ctx *context.Context, rtPrf *utils.RouteProfile) error
RemoveRouteProfileDrvF func(ctx *context.Context, tnt, id string) error
RemoveChargerProfileDrvF func(ctx *context.Context, chr string, rpl string) error
GetItemLoadIDsDrvF func(ctx *context.Context, itemIDPrefix string) (loadIDs map[string]int64, err error)
SetThresholdDrvF func(*context.Context, *Threshold) error
SetStatQueueDrvF func(*context.Context, *StoredStatQueue, *StatQueue) error
HasDataDrvF func(ctx *context.Context, category, subject, tenant string) (bool, error)
RemoveIndexesDrvF func(ctx *context.Context, idxItmType, tntCtx, idxKey string) error
GetStatQueueDrvF func(ctx *context.Context, tenant, id string) (sq *StatQueue, err error)
}
func (*DataDBMock) AddLoadHistory ¶
func (dbM *DataDBMock) AddLoadHistory(*utils.LoadInstance, int, string) error
func (*DataDBMock) BackupDataDB ¶
func (dbM *DataDBMock) BackupDataDB(backupFolderPath string, zip bool) (err error)
func (*DataDBMock) BackupStorDBDump ¶
func (dbM *DataDBMock) BackupStorDBDump(backupFolderPath string, zip bool) (err error)
func (*DataDBMock) DumpDataDB ¶
func (dbM *DataDBMock) DumpDataDB() error
func (*DataDBMock) Flush ¶
func (dbM *DataDBMock) Flush(string) error
func (*DataDBMock) GetAccountDrv ¶
func (*DataDBMock) GetActionProfileDrv ¶
func (dbM *DataDBMock) GetActionProfileDrv(ctx *context.Context, tenant string, ID string) (*utils.ActionProfile, error)
func (*DataDBMock) GetAttributeProfileDrv ¶
func (dbM *DataDBMock) GetAttributeProfileDrv(ctx *context.Context, str1 string, str2 string) (*utils.AttributeProfile, error)
func (*DataDBMock) GetChargerProfileDrv ¶
func (dbM *DataDBMock) GetChargerProfileDrv(ctx *context.Context, tnt, id string) (*utils.ChargerProfile, error)
func (*DataDBMock) GetConfigSectionsDrv ¶
func (*DataDBMock) GetFilterDrv ¶
func (*DataDBMock) GetIPAllocationsDrv ¶
func (dbM *DataDBMock) GetIPAllocationsDrv(ctx *context.Context, tenant, id string) (*utils.IPAllocations, error)
func (*DataDBMock) GetIPProfileDrv ¶
func (*DataDBMock) GetIndexesDrv ¶
func (*DataDBMock) GetItemLoadIDsDrv ¶
func (*DataDBMock) GetKeysForPrefix ¶
func (*DataDBMock) GetLoadHistory ¶
func (dbM *DataDBMock) GetLoadHistory(int, bool, string) ([]*utils.LoadInstance, error)
func (*DataDBMock) GetRankingDrv ¶
func (*DataDBMock) GetRankingProfileDrv ¶
func (dbM *DataDBMock) GetRankingProfileDrv(ctx *context.Context, tenant, id string) (sg *utils.RankingProfile, err error)
func (*DataDBMock) GetRateProfileDrv ¶
func (dbM *DataDBMock) GetRateProfileDrv(ctx *context.Context, tnt string, id string) (*utils.RateProfile, error)
func (*DataDBMock) GetRateProfileRatesDrv ¶
func (*DataDBMock) GetResourceDrv ¶
func (*DataDBMock) GetResourceProfileDrv ¶
func (dbM *DataDBMock) GetResourceProfileDrv(ctx *context.Context, tnt, id string) (*utils.ResourceProfile, error)
func (*DataDBMock) GetRouteProfileDrv ¶
func (dbM *DataDBMock) GetRouteProfileDrv(ctx *context.Context, tnt, id string) (*utils.RouteProfile, error)
func (*DataDBMock) GetStatQueueDrv ¶
func (*DataDBMock) GetStatQueueProfileDrv ¶
func (dbM *DataDBMock) GetStatQueueProfileDrv(ctx *context.Context, tenant, id string) (sq *StatQueueProfile, err error)
func (*DataDBMock) GetStorageType ¶
func (dbM *DataDBMock) GetStorageType() string
func (*DataDBMock) GetThresholdDrv ¶
func (*DataDBMock) GetThresholdProfileDrv ¶
func (dbM *DataDBMock) GetThresholdProfileDrv(ctx *context.Context, tenant, id string) (tp *ThresholdProfile, err error)
func (*DataDBMock) GetTrendDrv ¶
func (*DataDBMock) GetTrendProfileDrv ¶
func (dbM *DataDBMock) GetTrendProfileDrv(ctx *context.Context, tenant, id string) (sg *utils.TrendProfile, err error)
func (*DataDBMock) GetVersions ¶
func (dbM *DataDBMock) GetVersions(itm string) (vrs Versions, err error)
func (*DataDBMock) HasDataDrv ¶
func (dbM *DataDBMock) HasDataDrv(ctx *context.Context, category, subject, tenant string) (bool, error)
DataDB methods
func (*DataDBMock) IsDBEmpty ¶
func (dbM *DataDBMock) IsDBEmpty() (resp bool, err error)
func (*DataDBMock) RemRankingProfileDrv ¶
func (*DataDBMock) RemStatQueueDrv ¶
func (dbM *DataDBMock) RemStatQueueDrv(ctx *context.Context, tenant, id string) (err error)
func (*DataDBMock) RemStatQueueProfileDrv ¶
func (dbM *DataDBMock) RemStatQueueProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*DataDBMock) RemThresholdProfileDrv ¶
func (dbM *DataDBMock) RemThresholdProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*DataDBMock) RemTrendProfileDrv ¶
func (*DataDBMock) RemoveAccountDrv ¶
func (*DataDBMock) RemoveActionProfileDrv ¶
func (*DataDBMock) RemoveAttributeProfileDrv ¶
func (*DataDBMock) RemoveChargerProfileDrv ¶
func (*DataDBMock) RemoveConfigSectionsDrv ¶
func (*DataDBMock) RemoveFilterDrv ¶
func (*DataDBMock) RemoveIPAllocationsDrv ¶
func (dbM *DataDBMock) RemoveIPAllocationsDrv(ctx *context.Context, tnt, id string) error
func (*DataDBMock) RemoveIPProfileDrv ¶
func (*DataDBMock) RemoveIndexesDrv ¶
func (dbM *DataDBMock) RemoveIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey string) (err error)
func (*DataDBMock) RemoveLoadIDsDrv ¶
func (dbM *DataDBMock) RemoveLoadIDsDrv() error
func (*DataDBMock) RemoveRankingDrv ¶
func (*DataDBMock) RemoveRateProfileDrv ¶
func (*DataDBMock) RemoveRatingProfileDrv ¶
func (dbM *DataDBMock) RemoveRatingProfileDrv(string) error
func (*DataDBMock) RemoveResourceDrv ¶
func (dbM *DataDBMock) RemoveResourceDrv(ctx *context.Context, tnt, id string) error
func (*DataDBMock) RemoveResourceProfileDrv ¶
func (*DataDBMock) RemoveRouteProfileDrv ¶
func (dbM *DataDBMock) RemoveRouteProfileDrv(ctx *context.Context, tnt, id string) error
func (*DataDBMock) RemoveThresholdDrv ¶
func (dbM *DataDBMock) RemoveThresholdDrv(ctx *context.Context, tnt, id string) error
func (*DataDBMock) RemoveTrendDrv ¶
func (*DataDBMock) RemoveVersions ¶
func (dbM *DataDBMock) RemoveVersions(vrs Versions) (err error)
func (*DataDBMock) RewriteDataDB ¶
func (dbM *DataDBMock) RewriteDataDB() (err error)
func (*DataDBMock) SelectDatabase ¶
func (dbM *DataDBMock) SelectDatabase(dbName string) (err error)
func (*DataDBMock) SetAccountDrv ¶
func (*DataDBMock) SetActionProfileDrv ¶
func (dbM *DataDBMock) SetActionProfileDrv(ctx *context.Context, ap *utils.ActionProfile) error
func (*DataDBMock) SetAttributeProfileDrv ¶
func (dbM *DataDBMock) SetAttributeProfileDrv(ctx *context.Context, attr *utils.AttributeProfile) error
func (*DataDBMock) SetChargerProfileDrv ¶
func (dbM *DataDBMock) SetChargerProfileDrv(ctx *context.Context, chrg *utils.ChargerProfile) error
func (*DataDBMock) SetConfigSectionsDrv ¶
func (*DataDBMock) SetFilterDrv ¶
func (dbM *DataDBMock) SetFilterDrv(ctx *context.Context, fltr *Filter) error
func (*DataDBMock) SetIPAllocationsDrv ¶
func (dbM *DataDBMock) SetIPAllocationsDrv(ctx *context.Context, ip *utils.IPAllocations) error
func (*DataDBMock) SetIPProfileDrv ¶
func (*DataDBMock) SetIndexesDrv ¶
func (*DataDBMock) SetLoadIDsDrv ¶
func (*DataDBMock) SetRankingDrv ¶
func (*DataDBMock) SetRankingProfileDrv ¶
func (dbM *DataDBMock) SetRankingProfileDrv(ctx *context.Context, rg *utils.RankingProfile) (err error)
func (*DataDBMock) SetRateProfileDrv ¶
func (dbM *DataDBMock) SetRateProfileDrv(ctx *context.Context, rt *utils.RateProfile, optOverwrite bool) error
func (*DataDBMock) SetResourceDrv ¶
func (*DataDBMock) SetResourceProfileDrv ¶
func (dbM *DataDBMock) SetResourceProfileDrv(ctx *context.Context, resPrf *utils.ResourceProfile) error
func (*DataDBMock) SetRouteProfileDrv ¶
func (dbM *DataDBMock) SetRouteProfileDrv(ctx *context.Context, rtPrf *utils.RouteProfile) error
func (*DataDBMock) SetStatQueueDrv ¶
func (dbM *DataDBMock) SetStatQueueDrv(ctx *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
func (*DataDBMock) SetStatQueueProfileDrv ¶
func (dbM *DataDBMock) SetStatQueueProfileDrv(ctx *context.Context, sq *StatQueueProfile) (err error)
func (*DataDBMock) SetThresholdDrv ¶
func (dbM *DataDBMock) SetThresholdDrv(*context.Context, *Threshold) error
func (*DataDBMock) SetThresholdProfileDrv ¶
func (dbM *DataDBMock) SetThresholdProfileDrv(ctx *context.Context, tp *ThresholdProfile) (err error)
func (*DataDBMock) SetTrendDrv ¶
func (*DataDBMock) SetTrendProfileDrv ¶
func (dbM *DataDBMock) SetTrendProfileDrv(ctx *context.Context, trend *utils.TrendProfile) (err error)
func (*DataDBMock) SetVersions ¶
func (dbM *DataDBMock) SetVersions(vrs Versions, overwrite bool) (err error)
type DataManager ¶
type DataManager struct {
// contains filtered or unexported fields
}
DataManager is the data storage manager for CGRateS transparently manages data retrieval, further serialization and caching
func NewDataManager ¶
func NewDataManager(dataDB DataDB, cfg *config.CGRConfig, connMgr *ConnManager) *DataManager
NewDataManager returns a new DataManager
func (*DataManager) CacheDataFromDB ¶
func (*DataManager) GetAccount ¶
func (*DataManager) GetActionProfile ¶
func (dm *DataManager) GetActionProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (ap *utils.ActionProfile, err error)
func (*DataManager) GetAttributeProfile ¶
func (dm *DataManager) GetAttributeProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (attrPrfl *utils.AttributeProfile, err error)
GetAttributeProfile returns the AttributeProfile with the given id
func (*DataManager) GetChargerProfile ¶
func (dm *DataManager) GetChargerProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (cpp *utils.ChargerProfile, err error)
func (*DataManager) GetFilter ¶
func (dm *DataManager) GetFilter(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (fltr *Filter, err error)
GetFilter returns a filter based on the given ID
func (*DataManager) GetIPAllocations ¶
func (dm *DataManager) GetIPAllocations(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (ip *utils.IPAllocations, err error)
func (*DataManager) GetIPProfile ¶
func (*DataManager) GetIndexes ¶
func (*DataManager) GetItemLoadIDs ¶
func (*DataManager) GetRanking ¶
func (*DataManager) GetRankingProfile ¶
func (dm *DataManager) GetRankingProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (rgp *utils.RankingProfile, err error)
func (*DataManager) GetRankingProfileIDs ¶
func (*DataManager) GetRateProfile ¶
func (dm *DataManager) GetRateProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (rpp *utils.RateProfile, err error)
func (*DataManager) GetRateProfileRates ¶
func (dm *DataManager) GetRateProfileRates(ctx *context.Context, args *utils.ArgsSubItemIDs, needIDs bool) (rateIDs []string, rates []*utils.Rate, err error)
func (*DataManager) GetResource ¶
func (*DataManager) GetResourceProfile ¶
func (dm *DataManager) GetResourceProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (rp *utils.ResourceProfile, err error)
func (*DataManager) GetRouteProfile ¶
func (dm *DataManager) GetRouteProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (rpp *utils.RouteProfile, err error)
func (*DataManager) GetStatQueue ¶
func (dm *DataManager) GetStatQueue(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (sq *StatQueue, err error)
GetStatQueue retrieves a StatQueue from dataDB handles caching and deserialization of metrics
func (*DataManager) GetStatQueueProfile ¶
func (dm *DataManager) GetStatQueueProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (sqp *StatQueueProfile, err error)
func (*DataManager) GetThreshold ¶
func (*DataManager) GetThresholdProfile ¶
func (dm *DataManager) GetThresholdProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (th *ThresholdProfile, err error)
func (*DataManager) GetTrend ¶
func (dm *DataManager) GetTrend(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (tr *utils.Trend, err error)
GetTrend retrieves a Trend from dataDB
func (*DataManager) GetTrendProfile ¶
func (dm *DataManager) GetTrendProfile(ctx *context.Context, tenant, id string, cacheRead, cacheWrite bool, transactionID string) (trp *utils.TrendProfile, err error)
func (*DataManager) GetTrendProfileIDs ¶
func (*DataManager) HasData ¶
func (dm *DataManager) HasData(category, subject, tenant string) (has bool, err error)
func (*DataManager) Reconnect ¶
func (dm *DataManager) Reconnect(d DataDB)
Reconnect reconnects to the DB when the config was changed
func (*DataManager) RemoveAccount ¶
func (*DataManager) RemoveActionProfile ¶
func (*DataManager) RemoveAttributeProfile ¶
func (*DataManager) RemoveChargerProfile ¶
func (*DataManager) RemoveFilter ¶
func (*DataManager) RemoveIPAllocations ¶
func (dm *DataManager) RemoveIPAllocations(ctx *context.Context, tenant, id string) (err error)
func (*DataManager) RemoveIPProfile ¶
func (*DataManager) RemoveIndexes ¶
func (dm *DataManager) RemoveIndexes(ctx *context.Context, idxItmType, tntCtx, idxKey string) (err error)
func (*DataManager) RemoveRanking ¶
func (dm *DataManager) RemoveRanking(ctx *context.Context, tenant, id string) (err error)
RemoveRanking removes the stored Ranking
func (*DataManager) RemoveRankingProfile ¶
func (dm *DataManager) RemoveRankingProfile(ctx *context.Context, tenant, id string) (err error)
func (*DataManager) RemoveRateProfile ¶
func (*DataManager) RemoveRateProfileRates ¶
func (*DataManager) RemoveResource ¶
func (dm *DataManager) RemoveResource(ctx *context.Context, tenant, id string) (err error)
func (*DataManager) RemoveResourceProfile ¶
func (*DataManager) RemoveRouteProfile ¶
func (*DataManager) RemoveStatQueue ¶
func (dm *DataManager) RemoveStatQueue(ctx *context.Context, tenant, id string) (err error)
RemoveStatQueue removes the StoredStatQueue
func (*DataManager) RemoveStatQueueProfile ¶
func (*DataManager) RemoveThreshold ¶
func (dm *DataManager) RemoveThreshold(ctx *context.Context, tenant, id string) (err error)
func (*DataManager) RemoveThresholdProfile ¶
func (*DataManager) RemoveTrend ¶
func (dm *DataManager) RemoveTrend(ctx *context.Context, tenant, id string) (err error)
RemoveTrend removes the stored Trend
func (*DataManager) RemoveTrendProfile ¶
func (dm *DataManager) RemoveTrendProfile(ctx *context.Context, tenant, id string) (err error)
func (*DataManager) SetAccount ¶
func (*DataManager) SetActionProfile ¶
func (dm *DataManager) SetActionProfile(ctx *context.Context, ap *utils.ActionProfile, withIndex bool) (err error)
func (*DataManager) SetAttributeProfile ¶
func (dm *DataManager) SetAttributeProfile(ctx *context.Context, ap *utils.AttributeProfile, withIndex bool) (err error)
func (*DataManager) SetChargerProfile ¶
func (dm *DataManager) SetChargerProfile(ctx *context.Context, cpp *utils.ChargerProfile, withIndex bool) (err error)
func (*DataManager) SetIPAllocations ¶
func (dm *DataManager) SetIPAllocations(ctx *context.Context, ip *utils.IPAllocations) (err error)
func (*DataManager) SetIPProfile ¶
func (*DataManager) SetIndexes ¶
func (*DataManager) SetLoadIDs ¶
SetLoadIDs sets the loadIDs in the DB
func (*DataManager) SetRanking ¶
SetRanking stores Ranking in dataDB
func (*DataManager) SetRankingProfile ¶
func (dm *DataManager) SetRankingProfile(ctx *context.Context, rnp *utils.RankingProfile) (err error)
func (*DataManager) SetRateProfile ¶
func (dm *DataManager) SetRateProfile(ctx *context.Context, rpp *utils.RateProfile, optOverwrite, withIndex bool) (err error)
func (*DataManager) SetResource ¶
func (*DataManager) SetResourceProfile ¶
func (dm *DataManager) SetResourceProfile(ctx *context.Context, rp *utils.ResourceProfile, withIndex bool) (err error)
func (*DataManager) SetRouteProfile ¶
func (dm *DataManager) SetRouteProfile(ctx *context.Context, rpp *utils.RouteProfile, withIndex bool) (err error)
func (*DataManager) SetStatQueue ¶
func (dm *DataManager) SetStatQueue(ctx *context.Context, sq *StatQueue) (err error)
SetStatQueue converts to StoredStatQueue and stores the result in dataDB
func (*DataManager) SetStatQueueProfile ¶
func (dm *DataManager) SetStatQueueProfile(ctx *context.Context, sqp *StatQueueProfile, withIndex bool) (err error)
func (*DataManager) SetThreshold ¶
func (dm *DataManager) SetThreshold(ctx *context.Context, th *Threshold) (err error)
func (*DataManager) SetThresholdProfile ¶
func (dm *DataManager) SetThresholdProfile(ctx *context.Context, th *ThresholdProfile, withIndex bool) (err error)
func (*DataManager) SetTrendProfile ¶
func (dm *DataManager) SetTrendProfile(ctx *context.Context, trp *utils.TrendProfile) (err error)
type DecimalWithCompress ¶
ACDHelper structure
type DispatcherHost ¶
type DispatcherHost struct {
Tenant string
*config.RemoteHost
// contains filtered or unexported fields
}
DispatcherHost represents one virtual host used by dispatcher
func (*DispatcherHost) FieldAsInterface ¶
func (dH *DispatcherHost) FieldAsInterface(fldPath []string) (_ any, err error)
func (*DispatcherHost) FieldAsString ¶
func (dH *DispatcherHost) FieldAsString(fldPath []string) (_ string, err error)
func (*DispatcherHost) GetConn ¶
func (dH *DispatcherHost) GetConn(ctx *context.Context, cfg *config.CGRConfig, iPRCCh chan birpc.ClientConnector) (_ birpc.ClientConnector, err error)
GetConn will build and cache the connection if it is not defined yet
func (*DispatcherHost) Merge ¶
func (dH *DispatcherHost) Merge(v2 any)
func (*DispatcherHost) Set ¶
func (dH *DispatcherHost) Set(path []string, val any, newBranch bool) (err error)
func (*DispatcherHost) String ¶
func (dH *DispatcherHost) String() string
func (*DispatcherHost) TenantID ¶
func (dH *DispatcherHost) TenantID() string
TenantID returns the tenant concatenated with the ID
type DispatcherHostIDs ¶
type DispatcherHostIDs []string
func (DispatcherHostIDs) Clone ¶
func (dHPrflIDs DispatcherHostIDs) Clone() (cln DispatcherHostIDs)
func (DispatcherHostIDs) ReorderFromIndex ¶
func (dHPrflIDs DispatcherHostIDs) ReorderFromIndex(idx int)
ReorderFromIndex will consider idx as starting point for the reordered slice
func (DispatcherHostIDs) Shuffle ¶
func (dHPrflIDs DispatcherHostIDs) Shuffle()
Shuffle will mix the connections in place
type DispatcherHostProfile ¶
type DispatcherHostProfile struct {
ID string
FilterIDs []string
Weight float64 // applied in case of multiple connections need to be ordered
Params map[string]any // additional parameters stored for a session
Blocker bool // no connection after this one
}
func (*DispatcherHostProfile) Clone ¶
func (dC *DispatcherHostProfile) Clone() (cln *DispatcherHostProfile)
func (*DispatcherHostProfile) FieldAsInterface ¶
func (dC *DispatcherHostProfile) FieldAsInterface(fldPath []string) (_ any, err error)
func (*DispatcherHostProfile) FieldAsString ¶
func (dC *DispatcherHostProfile) FieldAsString(fldPath []string) (_ string, err error)
func (*DispatcherHostProfile) Merge ¶
func (dspHost *DispatcherHostProfile) Merge(v2 *DispatcherHostProfile)
func (*DispatcherHostProfile) String ¶
func (dC *DispatcherHostProfile) String() string
type DispatcherHostProfiles ¶
type DispatcherHostProfiles []*DispatcherHostProfile
func (DispatcherHostProfiles) Clone ¶
func (dHPrfls DispatcherHostProfiles) Clone() (cln DispatcherHostProfiles)
func (DispatcherHostProfiles) HostIDs ¶
func (dHPrfls DispatcherHostProfiles) HostIDs() (hostIDs []string)
func (DispatcherHostProfiles) ReorderFromIndex ¶
func (dHPrfls DispatcherHostProfiles) ReorderFromIndex(idx int)
ReorderFromIndex will consider idx as starting point for the reordered slice
func (DispatcherHostProfiles) Shuffle ¶
func (dHPrfls DispatcherHostProfiles) Shuffle()
Shuffle will mix the connections in place
func (DispatcherHostProfiles) Sort ¶
func (dHPrfls DispatcherHostProfiles) Sort()
Sort is part of sort interface, sort based on Weight
type DispatcherHostWithAPIOpts ¶
type DispatcherHostWithAPIOpts struct {
*DispatcherHost
APIOpts map[string]any
}
DispatcherHostWithOpts is used in replicatorV1 for dispatcher
type DynamicDP ¶
type DynamicDP struct {
// contains filtered or unexported fields
}
func NewDynamicDP ¶
func (*DynamicDP) FieldAsInterface ¶
func (*DynamicDP) FieldAsString ¶
type ExportLogger ¶
type ExportLogger struct {
sync.Mutex
LogLevel int
FldPostDir string
Writer *kafka.Writer
NodeID string
Tenant string
// contains filtered or unexported fields
}
Logs to kafka
func NewExportLogger ¶
func NewExportLogger(ctx *context.Context, tenant string, connMgr *ConnManager, cfg *config.CGRConfig) *ExportLogger
NewExportLogger will export loggers to kafka
func (*ExportLogger) Alert ¶
func (el *ExportLogger) Alert(m string) (err error)
Alert logs to EEs with alert level
func (*ExportLogger) Close ¶
func (el *ExportLogger) Close() (err error)
func (*ExportLogger) Crit ¶
func (el *ExportLogger) Crit(m string) (err error)
Crit logs to EEs with critical level
func (*ExportLogger) Debug ¶
func (el *ExportLogger) Debug(m string) (err error)
Debug logs to EEs with debug level
func (*ExportLogger) Emerg ¶
func (el *ExportLogger) Emerg(m string) (err error)
Emerg logs to EEs with emergency level
func (*ExportLogger) Err ¶
func (el *ExportLogger) Err(m string) (err error)
Err logs to EEs with error level
func (*ExportLogger) GetLogLevel ¶
func (el *ExportLogger) GetLogLevel() int
GetLogLevel() returns the level logger number for the server
func (*ExportLogger) GetMeta ¶
func (el *ExportLogger) GetMeta() map[string]any
func (*ExportLogger) GetSyslog ¶
func (sl *ExportLogger) GetSyslog() *syslog.Writer
func (*ExportLogger) Info ¶
func (el *ExportLogger) Info(m string) (err error)
Info logs to EEs with info level
func (*ExportLogger) Notice ¶
func (el *ExportLogger) Notice(m string) (err error)
Notice logs to EEs with notice level
func (*ExportLogger) SetLogLevel ¶
func (el *ExportLogger) SetLogLevel(level int)
SetLogLevel changes the log level
func (*ExportLogger) Warning ¶
func (el *ExportLogger) Warning(m string) (err error)
Warning logs to EEs with warning level
type Filter ¶
type Filter struct {
Tenant string
ID string
Rules []*FilterRule
}
Filter structure to define a basic filter
func APItoFilter ¶
func APItoFilter(tpTH *utils.TPFilterProfile, timezone string) (th *Filter, err error)
func GetFilters ¶
func GetFilters(ctx *context.Context, filterIDs []string, tenant string, dm *DataManager) ([]*Filter, error)
GetFilters retrieves and compiles the filters identified by filterIDs for the specified tenant.
func NewFilterFromInline ¶
NewFilterFromInline parses an inline rule into a compiled Filter
func (*Filter) CacheClone ¶
CacheClone returns a clone of Filter used by ltcache CacheCloner
func (*Filter) Compile ¶
Compile will compile the underlaying request filters where necessary (ie. regexp rules)
func (*Filter) FieldAsInterface ¶
func (*Filter) FieldAsString ¶
type FilterIHReply ¶ added in v0.10.3
type FilterIHReply struct {
MissingObjects []string // list of object that are referenced in indexes but are not found in the dataDB
MissingIndexes map[string][]string // list of missing indexes for each object (the map has the key as the objectID and a list of indexes)
BrokenIndexes map[string][]string // list of broken indexes for each object (the map has the key as the index and a list of objects)
MissingFilters map[string][]string // list of broken references (the map has the key as the filterID and a list of objectIDs)
}
func GetFltrIdxHealth ¶ added in v0.10.3
func GetFltrIdxHealth(ctx *context.Context, dm *DataManager, fltrCache, fltrIdxCache, objCache *ltcache.Cache, indxType string) (rply *FilterIHReply, err error)
GetFltrIdxHealth returns the missing indexes for all objects
func GetFltrIdxHealthForRateRates ¶
func GetFltrIdxHealthForRateRates(ctx *context.Context, dm *DataManager, fltrCache, fltrIdxCache, objCache *ltcache.Cache) (rply *FilterIHReply, err error)
GetFltrIdxHealth returns the missing indexes for all objects
type FilterMdl ¶
type FilterMdls ¶
type FilterMdls []*FilterMdl
func APItoModelTPFilter ¶
func APItoModelTPFilter(th *utils.TPFilterProfile) (mdls FilterMdls)
func (FilterMdls) AsTPFilter ¶
func (tps FilterMdls) AsTPFilter() (result []*utils.TPFilterProfile)
func (FilterMdls) CSVHeader ¶
func (tps FilterMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type FilterRule ¶
type FilterRule struct {
Type string // Filter type (*string, *timing, *rsr_filters, *stats, *lt, *lte, *gt, *gte)
Element string // Name of the field providing us the Values to check (used in case of some )
Values []string // Filter definition
// contains filtered or unexported fields
}
FilterRule filters requests coming into various places Pass rule: default negative, one matching rule should pass the filter
func NewFilterRule ¶
func NewFilterRule(rfType, fieldName string, vals []string) (*FilterRule, error)
NewFilterRule returns a new filter
func (*FilterRule) CompileValues ¶
func (fltr *FilterRule) CompileValues() (err error)
CompileValues compiles RSR fields
func (*FilterRule) FieldAsInterface ¶
func (fltr *FilterRule) FieldAsInterface(fldPath []string) (_ any, err error)
func (*FilterRule) FieldAsString ¶
func (fltr *FilterRule) FieldAsString(fldPath []string) (_ string, err error)
func (*FilterRule) IsValid ¶
func (fltr *FilterRule) IsValid() bool
IsValid checks whether a filter rule is valid or not
func (*FilterRule) Pass ¶
func (fltr *FilterRule) Pass(ctx *context.Context, dDP utils.DataProvider) (result bool, err error)
Pass is the method which should be used from outside.
func (*FilterRule) String ¶
func (fltr *FilterRule) String() string
type FilterS ¶
type FilterS struct {
// contains filtered or unexported fields
}
FilterS is a service used to take decisions in case of filters uses lazy connections where necessary to avoid deadlocks on service startup
func NewFilterS ¶
func NewFilterS(cfg *config.CGRConfig, connMgr *ConnManager, dm *DataManager) (fS *FilterS)
NewFilterS initializtes the filter service
func (*FilterS) LazyPass ¶
func (fS *FilterS) LazyPass(ctx *context.Context, tenant string, filterIDs []string, ev utils.DataProvider, pathPrfxs []string) (pass bool, lazyCheckRules []*FilterRule, err error)
LazyPass is almost the same as Pass except that it verify if the Element of the Values from FilterRules has as prefix one of the pathPrfxs
func (*FilterS) Pass ¶
func (fS *FilterS) Pass(ctx *context.Context, tenant string, filterIDs []string, ev utils.DataProvider) (pass bool, err error)
Pass will check all filters wihin filterIDs and require them passing for dataProvider there should be at least one filter passing, ie: if filters are not active event will fail to pass receives the event as DataProvider so we can accept undecoded data (ie: HttpRequest)
type FilterWithAPIOpts ¶
FilterWithOpts the arguments for the replication
type IndexHealthArgs ¶
type IndexHealthArgs struct {
Tenant string
IndexCacheLimit int
IndexCacheTTL time.Duration
IndexCacheStaticTTL bool
ObjectCacheLimit int
ObjectCacheTTL time.Duration
ObjectCacheStaticTTL bool
FilterCacheLimit int
FilterCacheTTL time.Duration
FilterCacheStaticTTL bool
APIOpts map[string]any // Only for dispatcher.
}
type IntService ¶
func NewDispatcherService ¶
func NewDispatcherService(val any) (_ IntService, err error)
func NewService ¶
func NewService(val any) (_ IntService, err error)
func NewServiceWithName ¶
func NewServiceWithName(val any, name string, useName bool) (_ IntService, err error)
NewServiceWithName is used by a service to return a number of *birpc.Service objects with different versions
which are groupped by the vX prefix in the RPC capable methods of val interface. (ie: CoreS and CoreSv1)
type InternalDB ¶
type InternalDB struct {
// contains filtered or unexported fields
}
InternalDB is used as a DataDB and/or StorDB
func NewInternalDB ¶
func NewInternalDB(stringIndexedFields, prefixIndexedFields []string, transCacheOpts *ltcache.TransCacheOpts, itmsCfg map[string]*config.ItemOpts) (iDB *InternalDB, err error)
NewInternalDB constructs an InternalDB
func (*InternalDB) AddLoadHistory ¶
func (iDB *InternalDB) AddLoadHistory(*utils.LoadInstance, int, string) error
func (*InternalDB) BackupConfigDB ¶
func (iDB *InternalDB) BackupConfigDB(backupFolderPath string, zip bool) (err error)
BackupConfigDB will momentarely stop any dumping and rewriting until all dump folder is backed up in folder path backupFolderPath, making zip true will create a zip file in the path instead
func (*InternalDB) BackupDataDB ¶
func (iDB *InternalDB) BackupDataDB(backupFolderPath string, zip bool) (err error)
BackupDataDB will momentarely stop any dumping and rewriting until all dump folder is backed up in folder path backupFolderPath, making zip true will create a zip file in the path instead
func (*InternalDB) BackupStorDB ¶
func (iDB *InternalDB) BackupStorDB(backupFolderPath string, zip bool) (err error)
BackupStorDB will momentarely stop any dumping and rewriting until all dump folder is backed up in folder path backupFolderPath, making zip true will create a zip file in the path instead
func (*InternalDB) Close ¶
func (iDB *InternalDB) Close()
Close depending on dump and rewrite intervals, will dump all thats left in cache collector to file and/or rewrite files, and close all files
func (*InternalDB) DumpConfigDB ¶
func (iDB *InternalDB) DumpConfigDB() (err error)
Will dump everything inside Configdb to files
func (*InternalDB) DumpDataDB ¶
func (iDB *InternalDB) DumpDataDB() (err error)
Will dump everything inside datadb to files
func (*InternalDB) DumpStorDB ¶
func (iDB *InternalDB) DumpStorDB() (err error)
Will dump everything inside stordb to files
func (*InternalDB) GetAccountDrv ¶
func (*InternalDB) GetActionProfileDrv ¶
func (iDB *InternalDB) GetActionProfileDrv(_ *context.Context, tenant, id string) (ap *utils.ActionProfile, err error)
func (*InternalDB) GetAttributeProfileDrv ¶
func (iDB *InternalDB) GetAttributeProfileDrv(_ *context.Context, tenant, id string) (attr *utils.AttributeProfile, err error)
func (*InternalDB) GetChargerProfileDrv ¶
func (iDB *InternalDB) GetChargerProfileDrv(_ *context.Context, tenant, id string) (ch *utils.ChargerProfile, err error)
func (*InternalDB) GetConfigSectionsDrv ¶
func (*InternalDB) GetFilterDrv ¶
func (*InternalDB) GetIPAllocationsDrv ¶
func (iDB *InternalDB) GetIPAllocationsDrv(_ *context.Context, tenant, id string) (*utils.IPAllocations, error)
func (*InternalDB) GetIPProfileDrv ¶
func (*InternalDB) GetIndexesDrv ¶
func (*InternalDB) GetItemLoadIDsDrv ¶
func (*InternalDB) GetKeysForPrefix ¶
func (iDB *InternalDB) GetKeysForPrefix(_ *context.Context, prefix string) (ids []string, err error)
GetKeysForPrefix returns the keys from cache that have the given prefix
func (*InternalDB) GetLoadHistory ¶
func (iDB *InternalDB) GetLoadHistory(int, bool, string) ([]*utils.LoadInstance, error)
func (*InternalDB) GetRankingDrv ¶
func (*InternalDB) GetRankingProfileDrv ¶
func (iDB *InternalDB) GetRankingProfileDrv(_ *context.Context, tenant, id string) (sg *utils.RankingProfile, err error)
func (*InternalDB) GetRateProfileDrv ¶
func (iDB *InternalDB) GetRateProfileDrv(_ *context.Context, tenant, id string) (rpp *utils.RateProfile, err error)
func (*InternalDB) GetRateProfileRatesDrv ¶
func (*InternalDB) GetResourceDrv ¶
func (*InternalDB) GetResourceProfileDrv ¶
func (iDB *InternalDB) GetResourceProfileDrv(_ *context.Context, tenant, id string) (rp *utils.ResourceProfile, err error)
func (*InternalDB) GetRouteProfileDrv ¶
func (iDB *InternalDB) GetRouteProfileDrv(_ *context.Context, tenant, id string) (spp *utils.RouteProfile, err error)
func (*InternalDB) GetSection ¶
func (*InternalDB) GetStatQueueDrv ¶
func (*InternalDB) GetStatQueueProfileDrv ¶
func (iDB *InternalDB) GetStatQueueProfileDrv(_ *context.Context, tenant string, id string) (sq *StatQueueProfile, err error)
func (*InternalDB) GetStorageType ¶
func (iDB *InternalDB) GetStorageType() string
GetStorageType returns the storage type
func (*InternalDB) GetThresholdDrv ¶
func (*InternalDB) GetThresholdProfileDrv ¶
func (iDB *InternalDB) GetThresholdProfileDrv(_ *context.Context, tenant, id string) (tp *ThresholdProfile, err error)
func (*InternalDB) GetTrendDrv ¶
func (*InternalDB) GetTrendProfileDrv ¶
func (iDB *InternalDB) GetTrendProfileDrv(_ *context.Context, tenant, id string) (sg *utils.TrendProfile, err error)
func (*InternalDB) GetVersions ¶
func (iDB *InternalDB) GetVersions(itm string) (vrs Versions, err error)
func (*InternalDB) HasDataDrv ¶
func (*InternalDB) IsDBEmpty ¶
func (iDB *InternalDB) IsDBEmpty() (isEmpty bool, err error)
IsDBEmpty returns true if the cache is empty
func (*InternalDB) RemRankingProfileDrv ¶
func (iDB *InternalDB) RemRankingProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemStatQueueDrv ¶
func (iDB *InternalDB) RemStatQueueDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemStatQueueProfileDrv ¶
func (iDB *InternalDB) RemStatQueueProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemThresholdProfileDrv ¶
func (iDB *InternalDB) RemThresholdProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemTrendProfileDrv ¶
func (iDB *InternalDB) RemTrendProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveAccountDrv ¶
func (iDB *InternalDB) RemoveAccountDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveActionProfileDrv ¶
func (iDB *InternalDB) RemoveActionProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveAttributeProfileDrv ¶
func (iDB *InternalDB) RemoveAttributeProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveCDRs ¶
func (iDB *InternalDB) RemoveCDRs(ctx *context.Context, qryFltr []*Filter) (err error)
func (*InternalDB) RemoveChargerProfileDrv ¶
func (iDB *InternalDB) RemoveChargerProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveConfigSectionsDrv ¶
func (*InternalDB) RemoveFilterDrv ¶
func (iDB *InternalDB) RemoveFilterDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveIPAllocationsDrv ¶
func (iDB *InternalDB) RemoveIPAllocationsDrv(_ *context.Context, tenant, id string) error
func (*InternalDB) RemoveIPProfileDrv ¶
func (iDB *InternalDB) RemoveIPProfileDrv(_ *context.Context, tenant, id string) error
func (*InternalDB) RemoveIndexesDrv ¶
func (iDB *InternalDB) RemoveIndexesDrv(_ *context.Context, idxItmType, tntCtx, idxKey string) (err error)
func (*InternalDB) RemoveLoadIDsDrv ¶
func (iDB *InternalDB) RemoveLoadIDsDrv() (err error)
func (*InternalDB) RemoveRankingDrv ¶
func (iDB *InternalDB) RemoveRankingDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveRateProfileDrv ¶
func (*InternalDB) RemoveResourceDrv ¶
func (iDB *InternalDB) RemoveResourceDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveResourceProfileDrv ¶
func (iDB *InternalDB) RemoveResourceProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveRouteProfileDrv ¶
func (iDB *InternalDB) RemoveRouteProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveThresholdDrv ¶
func (iDB *InternalDB) RemoveThresholdDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveTrendDrv ¶
func (iDB *InternalDB) RemoveTrendDrv(_ *context.Context, tenant, id string) (err error)
func (*InternalDB) RemoveVersions ¶
func (iDB *InternalDB) RemoveVersions(vrs Versions) (err error)
func (*InternalDB) RewriteConfigDB ¶
func (iDB *InternalDB) RewriteConfigDB() (err error)
Will rewrite every dump file of ConfigDB
func (*InternalDB) RewriteDataDB ¶
func (iDB *InternalDB) RewriteDataDB() (err error)
Will rewrite every dump file of DataDB
func (*InternalDB) RewriteStorDB ¶
func (iDB *InternalDB) RewriteStorDB() (err error)
Will rewrite every dump file of StorDB
func (*InternalDB) SelectDatabase ¶
func (iDB *InternalDB) SelectDatabase(string) (err error)
SelectDatabase only to implement Storage interface
func (*InternalDB) SetAccountDrv ¶
func (*InternalDB) SetActionProfileDrv ¶
func (iDB *InternalDB) SetActionProfileDrv(_ *context.Context, ap *utils.ActionProfile) (err error)
func (*InternalDB) SetAttributeProfileDrv ¶
func (iDB *InternalDB) SetAttributeProfileDrv(_ *context.Context, attr *utils.AttributeProfile) (err error)
func (*InternalDB) SetCDR ¶
SetCDR for ManagerDB interface. SetCDR will set a single CDR in internal based on the CGREvent
func (*InternalDB) SetChargerProfileDrv ¶
func (iDB *InternalDB) SetChargerProfileDrv(_ *context.Context, chr *utils.ChargerProfile) (err error)
func (*InternalDB) SetConfigSectionsDrv ¶
func (*InternalDB) SetFilterDrv ¶
func (iDB *InternalDB) SetFilterDrv(_ *context.Context, fltr *Filter) (err error)
func (*InternalDB) SetIPAllocationsDrv ¶
func (iDB *InternalDB) SetIPAllocationsDrv(_ *context.Context, ip *utils.IPAllocations) error
func (*InternalDB) SetIPProfileDrv ¶
func (*InternalDB) SetIndexesDrv ¶
func (*InternalDB) SetLoadIDsDrv ¶
func (*InternalDB) SetPrefixIndexedFields ¶
func (iDB *InternalDB) SetPrefixIndexedFields(prefixIndexedFields []string)
SetPrefixIndexedFields set the prefixIndexedFields, used at StorDB reload (is thread safe)
func (*InternalDB) SetRankingDrv ¶
func (*InternalDB) SetRankingProfileDrv ¶
func (iDB *InternalDB) SetRankingProfileDrv(_ *context.Context, sgp *utils.RankingProfile) (err error)
func (*InternalDB) SetRateProfileDrv ¶
func (iDB *InternalDB) SetRateProfileDrv(_ *context.Context, rpp *utils.RateProfile, optOverwrite bool) (err error)
func (*InternalDB) SetResourceDrv ¶
func (*InternalDB) SetResourceProfileDrv ¶
func (iDB *InternalDB) SetResourceProfileDrv(_ *context.Context, rp *utils.ResourceProfile) (err error)
func (*InternalDB) SetRouteProfileDrv ¶
func (iDB *InternalDB) SetRouteProfileDrv(_ *context.Context, spp *utils.RouteProfile) (err error)
func (*InternalDB) SetSection ¶
func (*InternalDB) SetStatQueueDrv ¶
func (iDB *InternalDB) SetStatQueueDrv(_ *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
func (*InternalDB) SetStatQueueProfileDrv ¶
func (iDB *InternalDB) SetStatQueueProfileDrv(_ *context.Context, sq *StatQueueProfile) (err error)
func (*InternalDB) SetStringIndexedFields ¶
func (iDB *InternalDB) SetStringIndexedFields(stringIndexedFields []string)
SetStringIndexedFields set the stringIndexedFields, used at StorDB reload (is thread safe)
func (*InternalDB) SetThresholdDrv ¶
func (iDB *InternalDB) SetThresholdDrv(_ *context.Context, th *Threshold) (err error)
func (*InternalDB) SetThresholdProfileDrv ¶
func (iDB *InternalDB) SetThresholdProfileDrv(_ *context.Context, tp *ThresholdProfile) (err error)
func (*InternalDB) SetTrendDrv ¶
func (*InternalDB) SetTrendProfileDrv ¶
func (iDB *InternalDB) SetTrendProfileDrv(_ *context.Context, srp *utils.TrendProfile) (err error)
func (*InternalDB) SetVersions ¶
func (iDB *InternalDB) SetVersions(vrs Versions, overwrite bool) (err error)
type LoadReader ¶
type LoadReader interface {
GetTpIds(string) ([]string, error)
GetTpTableIds(string, string, []string,
map[string]string, *utils.PaginatorWithSearch) ([]string, error)
GetTPResources(string, string, string) ([]*utils.TPResourceProfile, error)
GetTPStats(string, string, string) ([]*utils.TPStatProfile, error)
GetTPRankings(tpid, tenant, id string) ([]*utils.TPRankingProfile, error)
GetTPTrends(tpid, tenant, id string) ([]*utils.TPTrendsProfile, error)
GetTPThresholds(string, string, string) ([]*utils.TPThresholdProfile, error)
GetTPFilters(string, string, string) ([]*utils.TPFilterProfile, error)
GetTPRoutes(string, string, string) ([]*utils.TPRouteProfile, error)
GetTPAttributes(string, string, string) ([]*utils.TPAttributeProfile, error)
GetTPChargers(string, string, string) ([]*utils.TPChargerProfile, error)
GetTPRateProfiles(string, string, string) ([]*utils.TPRateProfile, error)
GetTPActionProfiles(string, string, string) ([]*utils.TPActionProfile, error)
GetTPAccounts(string, string, string) ([]*utils.TPAccount, error)
}
LoadReader reads from .csv or TP tables and provides the data ready for the tp_db or data_db.
type LoadStorage ¶
type LoadStorage interface {
Storage
LoadReader
LoadWriter
}
type LoadWriter ¶
type LoadWriter interface {
RemTpData(string, string, map[string]string) error
SetTPResources([]*utils.TPResourceProfile) error
SetTPStats([]*utils.TPStatProfile) error
SetTPThresholds([]*utils.TPThresholdProfile) error
SetTPFilters([]*utils.TPFilterProfile) error
SetTPRoutes([]*utils.TPRouteProfile) error
SetTPAttributes([]*utils.TPAttributeProfile) error
SetTPChargers([]*utils.TPChargerProfile) error
SetTPRateProfiles([]*utils.TPRateProfile) error
SetTPActionProfiles([]*utils.TPActionProfile) error
SetTPAccounts([]*utils.TPAccount) error
}
type MapEvent ¶
MapEvent is a map[string]any with convenience methods on top
func NewMapEvent ¶
NewMapEvent makes sure the content is not nil
func (MapEvent) AsMapString ¶
AsMapString returns a map[string]string out of mp, ignoring specific fields if needed most used when needing to export extraFields
func (MapEvent) FieldAsInterface ¶
func (MapEvent) GetBoolOrDefault ¶
GetBoolOrDefault returns the value as a bool or dflt if not present in map
func (MapEvent) GetDuration ¶
GetDuration returns a field as Duration
func (MapEvent) GetDurationIgnoreErrors ¶
GetDuration returns a field as Duration, ignoring errors
func (MapEvent) GetDurationPtr ¶
GetDurationPointer returns pointer towards duration, useful to detect presence of duration
func (MapEvent) GetDurationPtrIgnoreErrors ¶
GetDurationPointer returns pointer towards duration, useful to detect presence of duration
func (MapEvent) GetDurationPtrOrDefault ¶
func (me MapEvent) GetDurationPtrOrDefault(fldName string, dflt *time.Duration) (d *time.Duration, err error)
GetDurationPtrOrDefault returns pointer or default if fldName is missing
func (MapEvent) GetFloat64 ¶
GetFloat64 returns a field as float64 instance
func (MapEvent) GetStringIgnoreErrors ¶
func (MapEvent) GetTimeIgnoreErrors ¶
GetTimeIgnoreErrors returns a field as Time instance, ignoring errors
func (MapEvent) GetTimePtr ¶
GetTimePtr returns a pointer towards time or error
func (MapEvent) GetTimePtrIgnoreErrors ¶
GetTimePtrIgnoreErrors returns a pointer towards time or nil if errors
type MapStringDP ¶
func (MapStringDP) FieldAsInterface ¶
func (me MapStringDP) FieldAsInterface(fldPath []string) (any, error)
func (MapStringDP) FieldAsString ¶
func (me MapStringDP) FieldAsString(fldPath []string) (string, error)
func (MapStringDP) String ¶
func (me MapStringDP) String() string
type Metric ¶
type Metric struct {
Value *utils.Decimal
Count uint64
Events map[string]*DecimalWithCompress // map[EventTenantID]Cost
MinItems uint64
FilterIDs []string
}
func (*Metric) GetCompressFactor ¶
Compress is part of StatMetric interface
func (*Metric) GetFilterIDs ¶
func (*Metric) GetMinItems ¶
GetMinItems returns the minim items for the metric
func (*Metric) GetStringValue ¶
type MetricWithFilters ¶
type MetricWithFilters struct {
MetricID string
FilterIDs []string
Blockers utils.DynamicBlockers // blocker flag to stop processing for next metric on filters matched
}
func (*MetricWithFilters) Clone ¶
func (mwf *MetricWithFilters) Clone() *MetricWithFilters
Clone clones *MetricWithFilters
func (*MetricWithFilters) FieldAsInterface ¶
func (mf *MetricWithFilters) FieldAsInterface(fldPath []string) (_ any, err error)
func (*MetricWithFilters) FieldAsString ¶
func (mf *MetricWithFilters) FieldAsString(fldPath []string) (_ string, err error)
func (*MetricWithFilters) String ¶
func (mf *MetricWithFilters) String() string
type MongoStorage ¶
type MongoStorage struct {
// contains filtered or unexported fields
}
MongoStorage struct for new mongo driver
func NewMongoStorage ¶
func NewMongoStorage(scheme, host, port, db, user, pass, mrshlerStr string, storageType string, cdrsIndexes []string, ttl time.Duration) (*MongoStorage, error)
NewMongoStorage initializes a new MongoDB storage instance with provided connection parameters and settings. Returns an error if the setup fails.
func (*MongoStorage) AddLoadHistory ¶
func (ms *MongoStorage) AddLoadHistory(ldInst *utils.LoadInstance, loadHistSize int, transactionID string) error
AddLoadHistory adds a single load instance to the load history.
func (*MongoStorage) BackupConfigDB ¶
func (ms *MongoStorage) BackupConfigDB(backupFolderPath string, zip bool) (err error)
Only intended for InternalDB
func (*MongoStorage) BackupDataDB ¶
func (ms *MongoStorage) BackupDataDB(backupFolderPath string, zip bool) (err error)
BackupDataDB only for InternalDB
func (*MongoStorage) BackupStorDB ¶
func (ms *MongoStorage) BackupStorDB(backupFolderPath string, zip bool) (err error)
BackupStorDB used only for InternalDB
func (*MongoStorage) DB ¶
func (ms *MongoStorage) DB() *mongo.Database
DB returns the database object associated with the MongoDB client.
func (*MongoStorage) DumpConfigDB ¶
func (ms *MongoStorage) DumpConfigDB() (err error)
Only intended for InternalDB
func (*MongoStorage) DumpDataDB ¶
func (ms *MongoStorage) DumpDataDB() error
DumpDataDB will dump all of datadb from memory to a file, only for InternalDB
func (*MongoStorage) DumpStorDB ¶
func (ms *MongoStorage) DumpStorDB() (err error)
RewriteStorDB used only for InternalDB
func (*MongoStorage) EnsureIndexes ¶
func (ms *MongoStorage) EnsureIndexes(cols ...string) error
EnsureIndexes creates database indexes for the specified collections.
func (*MongoStorage) Flush ¶
func (ms *MongoStorage) Flush(_ string) error
Flush drops the datatable and recreates the indexes.
func (*MongoStorage) GetAccountDrv ¶
func (*MongoStorage) GetActionProfileDrv ¶
func (ms *MongoStorage) GetActionProfileDrv(ctx *context.Context, tenant, id string) (*utils.ActionProfile, error)
func (*MongoStorage) GetAttributeProfileDrv ¶
func (ms *MongoStorage) GetAttributeProfileDrv(ctx *context.Context, tenant, id string) (*utils.AttributeProfile, error)
func (*MongoStorage) GetChargerProfileDrv ¶
func (ms *MongoStorage) GetChargerProfileDrv(ctx *context.Context, tenant, id string) (*utils.ChargerProfile, error)
func (*MongoStorage) GetConfigSectionsDrv ¶
func (*MongoStorage) GetContext ¶
func (ms *MongoStorage) GetContext() *context.Context
GetContext returns the context used for the current database.
func (*MongoStorage) GetFilterDrv ¶
func (*MongoStorage) GetIPAllocationsDrv ¶
func (ms *MongoStorage) GetIPAllocationsDrv(ctx *context.Context, tenant, id string) (*utils.IPAllocations, error)
func (*MongoStorage) GetIPProfileDrv ¶
func (*MongoStorage) GetIndexesDrv ¶
func (ms *MongoStorage) GetIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (map[string]utils.StringSet, error)
GetIndexesDrv retrieves Indexes from dataDB the key is the tenant of the item or in case of context dependent profiles is a concatenatedKey between tenant and context id is used as a concatenated key in case of filterIndexes the id will be filterType:fieldName:fieldVal
func (*MongoStorage) GetItemLoadIDsDrv ¶
func (*MongoStorage) GetKeysForPrefix ¶
func (ms *MongoStorage) GetKeysForPrefix(ctx *context.Context, prefix string) (keys []string, err error)
GetKeysForPrefix implementation
func (*MongoStorage) GetLoadHistory ¶
func (ms *MongoStorage) GetLoadHistory(limit int, skipCache bool, transactionID string) ([]*utils.LoadInstance, error)
GetLoadHistory retrieves the last n items from the load history, newest first.
func (*MongoStorage) GetRankingDrv ¶
func (*MongoStorage) GetRankingProfileDrv ¶
func (ms *MongoStorage) GetRankingProfileDrv(ctx *context.Context, tenant, id string) (*utils.RankingProfile, error)
func (*MongoStorage) GetRateProfileDrv ¶
func (ms *MongoStorage) GetRateProfileDrv(ctx *context.Context, tenant, id string) (*utils.RateProfile, error)
func (*MongoStorage) GetRateProfileRatesDrv ¶
func (*MongoStorage) GetResourceDrv ¶
func (*MongoStorage) GetResourceProfileDrv ¶
func (ms *MongoStorage) GetResourceProfileDrv(ctx *context.Context, tenant, id string) (*utils.ResourceProfile, error)
func (*MongoStorage) GetRouteProfileDrv ¶
func (ms *MongoStorage) GetRouteProfileDrv(ctx *context.Context, tenant, id string) (*utils.RouteProfile, error)
func (*MongoStorage) GetSection ¶
func (*MongoStorage) GetStatQueueDrv ¶
func (ms *MongoStorage) GetStatQueueDrv(ctx *context.Context, tenant, id string) (*StatQueue, error)
GetStatQueueDrv retrieves a StoredStatQueue
func (*MongoStorage) GetStatQueueProfileDrv ¶
func (ms *MongoStorage) GetStatQueueProfileDrv(ctx *context.Context, tenant string, id string) (*StatQueueProfile, error)
GetStatQueueProfileDrv retrieves a StatQueueProfile from dataDB
func (*MongoStorage) GetStorageType ¶
func (ms *MongoStorage) GetStorageType() string
func (*MongoStorage) GetThresholdDrv ¶
func (*MongoStorage) GetThresholdProfileDrv ¶
func (ms *MongoStorage) GetThresholdProfileDrv(ctx *context.Context, tenant, ID string) (*ThresholdProfile, error)
GetThresholdProfileDrv retrieves a ThresholdProfile from dataDB
func (*MongoStorage) GetTrendDrv ¶
func (*MongoStorage) GetTrendProfileDrv ¶
func (ms *MongoStorage) GetTrendProfileDrv(ctx *context.Context, tenant, id string) (*utils.TrendProfile, error)
func (*MongoStorage) GetVersions ¶
func (ms *MongoStorage) GetVersions(itm string) (vrs Versions, err error)
func (*MongoStorage) HasDataDrv ¶
func (*MongoStorage) IsDBEmpty ¶
func (ms *MongoStorage) IsDBEmpty() (isEmpty bool, err error)
IsDBEmpty checks if the database is empty by verifying if each collection is empty.
func (*MongoStorage) IsDataDB ¶
func (ms *MongoStorage) IsDataDB() bool
IsDataDB returns whether or not the storage is used for DataDB.
func (*MongoStorage) RemRankingProfileDrv ¶
func (ms *MongoStorage) RemRankingProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*MongoStorage) RemStatQueueDrv ¶
func (ms *MongoStorage) RemStatQueueDrv(ctx *context.Context, tenant, id string) error
RemStatQueueDrv removes stored metrics for a StoredStatQueue
func (*MongoStorage) RemStatQueueProfileDrv ¶
func (ms *MongoStorage) RemStatQueueProfileDrv(ctx *context.Context, tenant, id string) error
RemStatQueueProfileDrv removes a StatsQueue from dataDB
func (*MongoStorage) RemThresholdProfileDrv ¶
func (ms *MongoStorage) RemThresholdProfileDrv(ctx *context.Context, tenant, id string) error
RemoveThresholdProfile removes a ThresholdProfile from dataDB/cache
func (*MongoStorage) RemTrendProfileDrv ¶
func (ms *MongoStorage) RemTrendProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*MongoStorage) RemoveAccountDrv ¶
func (ms *MongoStorage) RemoveAccountDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveActionProfileDrv ¶
func (ms *MongoStorage) RemoveActionProfileDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveAttributeProfileDrv ¶
func (ms *MongoStorage) RemoveAttributeProfileDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveCDRs ¶
func (ms *MongoStorage) RemoveCDRs(ctx *context.Context, qryFltr []*Filter) (err error)
RemoveCDRs removes CDRs from MongoDB based on provided query filters.
func (*MongoStorage) RemoveChargerProfileDrv ¶
func (ms *MongoStorage) RemoveChargerProfileDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveConfigSectionsDrv ¶
func (*MongoStorage) RemoveFilterDrv ¶
func (ms *MongoStorage) RemoveFilterDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveIPAllocationsDrv ¶
func (ms *MongoStorage) RemoveIPAllocationsDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveIPProfileDrv ¶
func (ms *MongoStorage) RemoveIPProfileDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveIndexesDrv ¶
func (ms *MongoStorage) RemoveIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey string) error
RemoveIndexesDrv removes the indexes
func (*MongoStorage) RemoveLoadIDsDrv ¶
func (ms *MongoStorage) RemoveLoadIDsDrv() error
func (*MongoStorage) RemoveRankingDrv ¶
func (ms *MongoStorage) RemoveRankingDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveRateProfileDrv ¶
func (*MongoStorage) RemoveResourceDrv ¶
func (ms *MongoStorage) RemoveResourceDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveResourceProfileDrv ¶
func (ms *MongoStorage) RemoveResourceProfileDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveRouteProfileDrv ¶
func (ms *MongoStorage) RemoveRouteProfileDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveThresholdDrv ¶
func (ms *MongoStorage) RemoveThresholdDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveTrendDrv ¶
func (ms *MongoStorage) RemoveTrendDrv(ctx *context.Context, tenant, id string) error
func (*MongoStorage) RemoveVersions ¶
func (ms *MongoStorage) RemoveVersions(vrs Versions) (err error)
func (*MongoStorage) RewriteConfigDB ¶
func (ms *MongoStorage) RewriteConfigDB() (err error)
Only intended for InternalDB
func (*MongoStorage) RewriteDataDB ¶
func (ms *MongoStorage) RewriteDataDB() (err error)
Will rewrite every dump file of DataDB, only for InternalDB
func (*MongoStorage) RewriteStorDB ¶
func (ms *MongoStorage) RewriteStorDB() (err error)
RewriteStorDB used only for InternalDB
func (*MongoStorage) SelectDatabase ¶
func (ms *MongoStorage) SelectDatabase(dbName string) error
SelectDatabase selects the specified database.
func (*MongoStorage) SetAccountDrv ¶
func (*MongoStorage) SetActionProfileDrv ¶
func (ms *MongoStorage) SetActionProfileDrv(ctx *context.Context, ap *utils.ActionProfile) error
func (*MongoStorage) SetAttributeProfileDrv ¶
func (ms *MongoStorage) SetAttributeProfileDrv(ctx *context.Context, r *utils.AttributeProfile) error
func (*MongoStorage) SetCDR ¶
SetCDR inserts or updates a CDR in MongoDB. If a CDR with the same cdrID already exists and allowUpdate is true, it updates the existing CDR. If allowUpdate is false and a CDR with the same cdrID exists, it returns an EXISTS error.
func (*MongoStorage) SetChargerProfileDrv ¶
func (ms *MongoStorage) SetChargerProfileDrv(ctx *context.Context, r *utils.ChargerProfile) error
func (*MongoStorage) SetConfigSectionsDrv ¶
func (*MongoStorage) SetFilterDrv ¶
func (ms *MongoStorage) SetFilterDrv(ctx *context.Context, r *Filter) error
func (*MongoStorage) SetIPAllocationsDrv ¶
func (ms *MongoStorage) SetIPAllocationsDrv(ctx *context.Context, ip *utils.IPAllocations) error
func (*MongoStorage) SetIPProfileDrv ¶
func (*MongoStorage) SetIndexesDrv ¶
func (ms *MongoStorage) SetIndexesDrv(ctx *context.Context, idxItmType, tntCtx string, indexes map[string]utils.StringSet, commit bool, transactionID string) error
SetIndexesDrv stores Indexes into DataDB the key is the tenant of the item or in case of context dependent profiles is a concatenatedKey between tenant and context
func (*MongoStorage) SetLoadIDsDrv ¶
func (*MongoStorage) SetRankingDrv ¶
func (*MongoStorage) SetRankingProfileDrv ¶
func (ms *MongoStorage) SetRankingProfileDrv(ctx *context.Context, sgp *utils.RankingProfile) (err error)
func (*MongoStorage) SetRateProfileDrv ¶
func (ms *MongoStorage) SetRateProfileDrv(ctx *context.Context, rpp *utils.RateProfile, optOverwrite bool) error
func (*MongoStorage) SetResourceDrv ¶
func (*MongoStorage) SetResourceProfileDrv ¶
func (ms *MongoStorage) SetResourceProfileDrv(ctx *context.Context, rp *utils.ResourceProfile) error
func (*MongoStorage) SetRouteProfileDrv ¶
func (ms *MongoStorage) SetRouteProfileDrv(ctx *context.Context, r *utils.RouteProfile) error
func (*MongoStorage) SetSection ¶
func (*MongoStorage) SetStatQueueDrv ¶
func (ms *MongoStorage) SetStatQueueDrv(ctx *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
SetStatQueueDrv stores the metrics for a StoredStatQueue
func (*MongoStorage) SetStatQueueProfileDrv ¶
func (ms *MongoStorage) SetStatQueueProfileDrv(ctx *context.Context, sq *StatQueueProfile) error
SetStatQueueProfileDrv stores a StatsQueue into DataDB
func (*MongoStorage) SetTTL ¶
func (ms *MongoStorage) SetTTL(ttl time.Duration)
SetTTL sets the context TTL used for queries (Thread-safe).
func (*MongoStorage) SetThresholdDrv ¶
func (ms *MongoStorage) SetThresholdDrv(ctx *context.Context, r *Threshold) error
func (*MongoStorage) SetThresholdProfileDrv ¶
func (ms *MongoStorage) SetThresholdProfileDrv(ctx *context.Context, tp *ThresholdProfile) error
SetThresholdProfileDrv stores a ThresholdProfile into DataDB
func (*MongoStorage) SetTrendDrv ¶
func (*MongoStorage) SetTrendProfileDrv ¶
func (ms *MongoStorage) SetTrendProfileDrv(ctx *context.Context, srp *utils.TrendProfile) (err error)
func (*MongoStorage) SetVersions ¶
func (ms *MongoStorage) SetVersions(vrs Versions, overwrite bool) (err error)
type MySQLStorage ¶
type MySQLStorage struct {
SQLStorage
}
func (*MySQLStorage) GetStorageType ¶
func (msqlS *MySQLStorage) GetStorageType() string
func (*MySQLStorage) SetVersions ¶
func (msqlS *MySQLStorage) SetVersions(vrs Versions, overwrite bool) (err error)
SetVersions will set a slice of versions, updating existing
type PostgresStorage ¶
type PostgresStorage struct {
SQLStorage
}
func (*PostgresStorage) GetStorageType ¶
func (poS *PostgresStorage) GetStorageType() string
func (*PostgresStorage) SetVersions ¶
func (poS *PostgresStorage) SetVersions(vrs Versions, overwrite bool) (err error)
type RPCClientSet ¶
type RPCClientSet map[string]chan birpc.ClientConnector
RPCClientSet is a RPC ClientConnector for the internal subsystems
func (RPCClientSet) GetInternalChanel ¶
func (s RPCClientSet) GetInternalChanel() chan birpc.ClientConnector
GetInternalChanel is used when RPCClientSet is passed as internal connection for RPCPool
type RankingMdl ¶
type RankingMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
Schedule string `index:"2" re:".*"`
StatIDs string `index:"3" re:".*"`
MetricIDs string `index:"4" re:".*"`
Sorting string `index:"5" re:".*"`
SortingParameters string `index:"6" re:".*"`
Stored bool `index:"7" re:".*"`
ThresholdIDs string `index:"8" re:".*"`
CreatedAt time.Time
}
func (RankingMdl) TableName ¶
func (RankingMdl) TableName() string
type RankingMdls ¶
type RankingMdls []*RankingMdl
func APItoModelTPRanking ¶
func APItoModelTPRanking(tpRG *utils.TPRankingProfile) (mdls RankingMdls)
func (RankingMdls) AsTPRanking ¶
func (models RankingMdls) AsTPRanking() (result []*utils.TPRankingProfile)
func (RankingMdls) CSVHeader ¶
func (tps RankingMdls) CSVHeader() (result []string)
type RateProfileMdl ¶
type RateProfileMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
MinCost float64 `index:"4" re:".*"`
MaxCost float64 `index:"5" re:".*"`
MaxCostStrategy string `index:"6" re:".*"`
RateID string `index:"7" re:".*"`
RateFilterIDs string `index:"8" re:".*"`
RateActivationTimes string `index:"9" re:".*"`
RateWeights string `index:"10" re:".*"`
RateBlocker bool `index:"11" re:".*"`
RateIntervalStart string `index:"12" re:".*"`
RateFixedFee float64 `index:"13" re:".*"`
RateRecurrentFee float64 `index:"14" re:".*"`
RateUnit string `index:"15" re:".*"`
RateIncrement string `index:"16" re:".*"`
CreatedAt time.Time
}
func (RateProfileMdl) TableName ¶
func (RateProfileMdl) TableName() string
type RateProfileMdls ¶
type RateProfileMdls []*RateProfileMdl
RateProfileMdls is used
func APItoModelTPRateProfile ¶
func APItoModelTPRateProfile(tPrf *utils.TPRateProfile) (mdls RateProfileMdls)
func (RateProfileMdls) AsTPRateProfile ¶
func (tps RateProfileMdls) AsTPRateProfile() (result []*utils.TPRateProfile)
func (RateProfileMdls) CSVHeader ¶
func (tps RateProfileMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func NewRedisStorage ¶
func NewRedisStorage(address string, db int, user, pass, mrshlerStr string, maxConns, attempts int, sentinelName string, isCluster bool, clusterSync, clusterOnDownDelay, connTimeout, readTimeout, writeTimeout time.Duration, pipelineWindow time.Duration, pipelineLimit int, tlsConn bool, tlsClientCert, tlsClientKey, tlsCACert string) (_ *RedisStorage, err error)
func (*RedisStorage) AddLoadHistory ¶
func (rs *RedisStorage) AddLoadHistory(ldInst *utils.LoadInstance, loadHistSize int, transactionID string) (err error)
Adds a single load instance to load history
func (*RedisStorage) BackupConfigDB ¶
func (rs *RedisStorage) BackupConfigDB(backupFolderPath string, zip bool) (err error)
Only intended for InternalDB
func (*RedisStorage) BackupDataDB ¶
func (rs *RedisStorage) BackupDataDB(backupFolderPath string, zip bool) (err error)
BackupDataDB will momentarely stop any dumping and rewriting until all dump folder is backed up in folder path backupFolderPath, making zip true will create a zip file in the path instead, only for InternalDB
func (*RedisStorage) Close ¶
func (rs *RedisStorage) Close()
func (*RedisStorage) Cmd ¶
func (rs *RedisStorage) Cmd(rcv any, cmd string, args ...string) error
Cmd function get a connection from the pool. Handles automatic failover in case of network disconnects
func (*RedisStorage) DumpConfigDB ¶
func (rs *RedisStorage) DumpConfigDB() (err error)
Only intended for InternalDB
func (*RedisStorage) DumpDataDB ¶
func (rs *RedisStorage) DumpDataDB() error
DumpDataDB will dump all of datadb from memory to a file, only for InternalDB
func (*RedisStorage) FlatCmd ¶
func (rs *RedisStorage) FlatCmd(rcv any, cmd, key string, args ...any) error
FlatCmd function get a connection from the pool. Handles automatic failover in case of network disconnects
func (*RedisStorage) Flush ¶
func (rs *RedisStorage) Flush(ignore string) error
func (*RedisStorage) GetAccountDrv ¶
func (*RedisStorage) GetActionProfileDrv ¶
func (rs *RedisStorage) GetActionProfileDrv(ctx *context.Context, tenant, id string) (ap *utils.ActionProfile, err error)
func (*RedisStorage) GetAttributeProfileDrv ¶
func (rs *RedisStorage) GetAttributeProfileDrv(ctx *context.Context, tenant, id string) (r *utils.AttributeProfile, err error)
func (*RedisStorage) GetChargerProfileDrv ¶
func (rs *RedisStorage) GetChargerProfileDrv(_ *context.Context, tenant, id string) (r *utils.ChargerProfile, err error)
func (*RedisStorage) GetConfigSectionsDrv ¶
func (*RedisStorage) GetFilterDrv ¶
func (*RedisStorage) GetIPAllocationsDrv ¶
func (rs *RedisStorage) GetIPAllocationsDrv(ctx *context.Context, tenant, id string) (*utils.IPAllocations, error)
func (*RedisStorage) GetIPProfileDrv ¶
func (*RedisStorage) GetIndexesDrv ¶
func (rs *RedisStorage) GetIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey, transactionID string) (indexes map[string]utils.StringSet, err error)
GetIndexesDrv retrieves Indexes from dataDB
func (*RedisStorage) GetItemLoadIDsDrv ¶
func (*RedisStorage) GetKeysForPrefix ¶
func (*RedisStorage) GetLoadHistory ¶
func (rs *RedisStorage) GetLoadHistory(limit int, skipCache bool, transactionID string) (loadInsts []*utils.LoadInstance, err error)
Limit will only retrieve the last n items out of history, newest first
func (*RedisStorage) GetRankingDrv ¶
func (*RedisStorage) GetRankingProfileDrv ¶
func (rs *RedisStorage) GetRankingProfileDrv(ctx *context.Context, tenant string, id string) (sg *utils.RankingProfile, err error)
func (*RedisStorage) GetRateProfileDrv ¶
func (rs *RedisStorage) GetRateProfileDrv(ctx *context.Context, tenant, id string) (rpp *utils.RateProfile, err error)
func (*RedisStorage) GetRateProfileRatesDrv ¶
func (rs *RedisStorage) GetRateProfileRatesDrv(ctx *context.Context, tnt, profileID, rtPrfx string, needIDs bool) (rateIDs []string, rates []*utils.Rate, err error)
GetRateProfileRateIDsDrv will return back all the rate IDs from a profile
func (*RedisStorage) GetResourceDrv ¶
func (*RedisStorage) GetResourceProfileDrv ¶
func (rs *RedisStorage) GetResourceProfileDrv(ctx *context.Context, tenant, id string) (rsp *utils.ResourceProfile, err error)
func (*RedisStorage) GetRouteProfileDrv ¶
func (rs *RedisStorage) GetRouteProfileDrv(ctx *context.Context, tenant, id string) (r *utils.RouteProfile, err error)
func (*RedisStorage) GetSection ¶
func (*RedisStorage) GetStatQueueDrv ¶
func (rs *RedisStorage) GetStatQueueDrv(ctx *context.Context, tenant, id string) (sq *StatQueue, err error)
GetStatQueueDrv retrieves the stored metrics for a StatsQueue
func (*RedisStorage) GetStatQueueProfileDrv ¶
func (rs *RedisStorage) GetStatQueueProfileDrv(ctx *context.Context, tenant string, id string) (sq *StatQueueProfile, err error)
GetStatQueueProfileDrv retrieves a StatQueueProfile from dataDB
func (*RedisStorage) GetStorageType ¶
func (rs *RedisStorage) GetStorageType() string
func (*RedisStorage) GetThresholdDrv ¶
func (*RedisStorage) GetThresholdProfileDrv ¶
func (rs *RedisStorage) GetThresholdProfileDrv(ctx *context.Context, tenant, ID string) (tp *ThresholdProfile, err error)
GetThresholdProfileDrv retrieves a ThresholdProfile from dataDB
func (*RedisStorage) GetTrendDrv ¶
func (*RedisStorage) GetTrendProfileDrv ¶
func (rs *RedisStorage) GetTrendProfileDrv(ctx *context.Context, tenant string, id string) (sg *utils.TrendProfile, err error)
func (*RedisStorage) GetVersions ¶
func (rs *RedisStorage) GetVersions(itm string) (vrs Versions, err error)
func (*RedisStorage) HasDataDrv ¶
func (rs *RedisStorage) HasDataDrv(ctx *context.Context, category, subject, tenant string) (exists bool, err error)
Used to check if specific subject is stored using prefix key attached to entity
func (*RedisStorage) IsDBEmpty ¶
func (rs *RedisStorage) IsDBEmpty() (resp bool, err error)
func (*RedisStorage) Marshaler ¶
func (rs *RedisStorage) Marshaler() utils.Marshaler
func (*RedisStorage) RemRankingProfileDrv ¶
func (*RedisStorage) RemStatQueueDrv ¶
func (rs *RedisStorage) RemStatQueueDrv(ctx *context.Context, tenant, id string) (err error)
RemStatQueueDrv removes a StatsQueue
func (*RedisStorage) RemStatQueueProfileDrv ¶
func (rs *RedisStorage) RemStatQueueProfileDrv(ctx *context.Context, tenant, id string) (err error)
RemStatQueueProfileDrv removes a StatsQueue from dataDB
func (*RedisStorage) RemThresholdProfileDrv ¶
func (rs *RedisStorage) RemThresholdProfileDrv(ctx *context.Context, tenant, id string) (err error)
RemThresholdProfileDrv removes a ThresholdProfile from dataDB/cache
func (*RedisStorage) RemTrendProfileDrv ¶
func (*RedisStorage) RemoveAccountDrv ¶
func (rs *RedisStorage) RemoveAccountDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveActionProfileDrv ¶
func (rs *RedisStorage) RemoveActionProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveAttributeProfileDrv ¶
func (rs *RedisStorage) RemoveAttributeProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveChargerProfileDrv ¶
func (rs *RedisStorage) RemoveChargerProfileDrv(_ *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveConfigSectionsDrv ¶
func (*RedisStorage) RemoveFilterDrv ¶
func (rs *RedisStorage) RemoveFilterDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveIPAllocationsDrv ¶
func (rs *RedisStorage) RemoveIPAllocationsDrv(ctx *context.Context, tenant, id string) error
func (*RedisStorage) RemoveIPProfileDrv ¶
func (rs *RedisStorage) RemoveIPProfileDrv(ctx *context.Context, tenant, id string) error
func (*RedisStorage) RemoveIndexesDrv ¶
func (rs *RedisStorage) RemoveIndexesDrv(ctx *context.Context, idxItmType, tntCtx, idxKey string) (err error)
func (*RedisStorage) RemoveLoadIDsDrv ¶
func (rs *RedisStorage) RemoveLoadIDsDrv() (err error)
func (*RedisStorage) RemoveRankingDrv ¶
func (rs *RedisStorage) RemoveRankingDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveRateProfileDrv ¶
func (*RedisStorage) RemoveResourceDrv ¶
func (rs *RedisStorage) RemoveResourceDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveResourceProfileDrv ¶
func (rs *RedisStorage) RemoveResourceProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveRouteProfileDrv ¶
func (rs *RedisStorage) RemoveRouteProfileDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveThresholdDrv ¶
func (rs *RedisStorage) RemoveThresholdDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveTrendDrv ¶
func (rs *RedisStorage) RemoveTrendDrv(ctx *context.Context, tenant, id string) (err error)
func (*RedisStorage) RemoveVersions ¶
func (rs *RedisStorage) RemoveVersions(vrs Versions) (err error)
func (*RedisStorage) RewriteConfigDB ¶
func (rs *RedisStorage) RewriteConfigDB() (err error)
Only intended for InternalDB
func (*RedisStorage) RewriteDataDB ¶
func (rs *RedisStorage) RewriteDataDB() (err error)
Will rewrite every dump file of DataDB, only for InternalDB
func (*RedisStorage) SelectDatabase ¶
func (rs *RedisStorage) SelectDatabase(dbName string) (err error)
func (*RedisStorage) SetAccountDrv ¶
func (*RedisStorage) SetActionProfileDrv ¶
func (rs *RedisStorage) SetActionProfileDrv(ctx *context.Context, ap *utils.ActionProfile) (err error)
func (*RedisStorage) SetAttributeProfileDrv ¶
func (rs *RedisStorage) SetAttributeProfileDrv(ctx *context.Context, r *utils.AttributeProfile) (err error)
func (*RedisStorage) SetChargerProfileDrv ¶
func (rs *RedisStorage) SetChargerProfileDrv(_ *context.Context, r *utils.ChargerProfile) (err error)
func (*RedisStorage) SetConfigSectionsDrv ¶
func (*RedisStorage) SetFilterDrv ¶
func (rs *RedisStorage) SetFilterDrv(ctx *context.Context, r *Filter) (err error)
func (*RedisStorage) SetIPAllocationsDrv ¶
func (rs *RedisStorage) SetIPAllocationsDrv(ctx *context.Context, ip *utils.IPAllocations) error
func (*RedisStorage) SetIPProfileDrv ¶
func (*RedisStorage) SetIndexesDrv ¶
func (rs *RedisStorage) SetIndexesDrv(ctx *context.Context, idxItmType, tntCtx string, indexes map[string]utils.StringSet, commit bool, transactionID string) (err error)
SetIndexesDrv stores Indexes into DataDB
func (*RedisStorage) SetLoadIDsDrv ¶
func (*RedisStorage) SetRankingDrv ¶
func (*RedisStorage) SetRankingProfileDrv ¶
func (rs *RedisStorage) SetRankingProfileDrv(ctx *context.Context, sg *utils.RankingProfile) (err error)
func (*RedisStorage) SetRateProfileDrv ¶
func (rs *RedisStorage) SetRateProfileDrv(ctx *context.Context, rpp *utils.RateProfile, optOverwrite bool) (err error)
func (*RedisStorage) SetResourceDrv ¶
func (*RedisStorage) SetResourceProfileDrv ¶
func (rs *RedisStorage) SetResourceProfileDrv(ctx *context.Context, rsp *utils.ResourceProfile) (err error)
func (*RedisStorage) SetRouteProfileDrv ¶
func (rs *RedisStorage) SetRouteProfileDrv(ctx *context.Context, r *utils.RouteProfile) (err error)
func (*RedisStorage) SetSection ¶
func (*RedisStorage) SetStatQueueDrv ¶
func (rs *RedisStorage) SetStatQueueDrv(ctx *context.Context, ssq *StoredStatQueue, sq *StatQueue) (err error)
SetStatQueueDrv stores the metrics for a StatsQueue
func (*RedisStorage) SetStatQueueProfileDrv ¶
func (rs *RedisStorage) SetStatQueueProfileDrv(ctx *context.Context, sq *StatQueueProfile) (err error)
SetStatQueueProfileDrv stores a StatsQueue into DataDB
func (*RedisStorage) SetThresholdDrv ¶
func (rs *RedisStorage) SetThresholdDrv(ctx *context.Context, r *Threshold) (err error)
func (*RedisStorage) SetThresholdProfileDrv ¶
func (rs *RedisStorage) SetThresholdProfileDrv(ctx *context.Context, tp *ThresholdProfile) (err error)
SetThresholdProfileDrv stores a ThresholdProfile into DataDB
func (*RedisStorage) SetTrendDrv ¶
func (*RedisStorage) SetTrendProfileDrv ¶
func (rs *RedisStorage) SetTrendProfileDrv(ctx *context.Context, sg *utils.TrendProfile) (err error)
func (*RedisStorage) SetVersions ¶
func (rs *RedisStorage) SetVersions(vrs Versions, overwrite bool) (err error)
type ResourceMdl ¶
type ResourceMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
UsageTTL string `index:"4" re:".*"`
Limit string `index:"5" re:".*"`
AllocationMessage string `index:"6" re:".*"`
Blocker bool `index:"7" re:".*"`
Stored bool `index:"8" re:".*"`
ThresholdIDs string `index:"9" re:".*"`
CreatedAt time.Time
}
func (ResourceMdl) TableName ¶
func (ResourceMdl) TableName() string
type ResourceMdls ¶
type ResourceMdls []*ResourceMdl
func APItoModelResource ¶
func APItoModelResource(rl *utils.TPResourceProfile) (mdls ResourceMdls)
func (ResourceMdls) AsTPResources ¶
func (tps ResourceMdls) AsTPResources() (result []*utils.TPResourceProfile)
func (ResourceMdls) CSVHeader ¶
func (tps ResourceMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type ReverseFilterIHReply ¶
type ReverseFilterIHReply struct {
MissingObjects []string // list of object that are referenced in indexes but are not found in the dataDB
MissingReverseIndexes map[string][]string // list of missing indexes for each object (the map has the key as the objectID and a list of indexes)
BrokenReverseIndexes map[string][]string // list of broken indexes for each object (the map has the key as the objectID and a list of indexes)
MissingFilters map[string][]string // list of broken references (the map has the key as the filterID and a list of objectIDs)
}
type RouteMdl ¶
type RouteMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
Blockers string `index:"4" re:".*"`
Sorting string `index:"5" re:".*"`
SortingParameters string `index:"6" re:".*"`
RouteID string `index:"7" re:".*"`
RouteFilterIDs string `index:"8" re:".*"`
RouteAccountIDs string `index:"9" re:".*"`
RouteRateProfileIDs string `index:"10" re:".*"`
RouteResourceIDs string `index:"11" re:".*"`
RouteStatIDs string `index:"12" re:".*"`
RouteWeights string `index:"13" re:".*"`
RouteBlockers string `index:"14" re:".*"`
RouteParameters string `index:"15" re:".*"`
CreatedAt time.Time
}
type RouteMdls ¶
type RouteMdls []*RouteMdl
func APItoModelTPRoutes ¶
func APItoModelTPRoutes(st *utils.TPRouteProfile) (mdls RouteMdls)
func (RouteMdls) AsTPRouteProfile ¶
func (tps RouteMdls) AsTPRouteProfile() (result []*utils.TPRouteProfile)
type SQLStorage ¶
func NewMySQLStorage ¶
func NewPostgresStorage ¶
func NewPostgresStorage(host, port, name, user, password, sslmode, sslcert, sslkey, sslpassword, sslcertmode, sslrootcert string, maxConn, maxIdleConn, sqlLogLevel int, connMaxLifetime time.Duration) (*SQLStorage, error)
NewPostgresStorage returns the posgres storDB
func (*SQLStorage) BackupStorDB ¶
func (sqls *SQLStorage) BackupStorDB(backupFolderPath string, zip bool) (err error)
BackupStorDB used only for InternalDB
func (*SQLStorage) Close ¶
func (sqls *SQLStorage) Close()
func (*SQLStorage) CreateTablesFromScript ¶
func (sqls *SQLStorage) CreateTablesFromScript(scriptPath string) error
func (*SQLStorage) DumpStorDB ¶
func (sqls *SQLStorage) DumpStorDB() (err error)
Will dump everything inside stordb to a file, only for InternalDB
func (*SQLStorage) ExportGormDB ¶
func (sqls *SQLStorage) ExportGormDB() *gorm.DB
func (*SQLStorage) Flush ¶
func (sqls *SQLStorage) Flush(scriptsPath string) (err error)
func (*SQLStorage) GetCDRs ¶
func (sqls *SQLStorage) GetCDRs(ctx *context.Context, qryFltr []*Filter, opts map[string]any) ([]*utils.CDR, error)
GetCDRs has ability to get the filtered CDRs, count them or simply return them qryFltr.Unscoped will ignore soft deletes or delete records permanently
func (*SQLStorage) GetKeysForPrefix ¶
func (*SQLStorage) GetVersions ¶
func (sqls *SQLStorage) GetVersions(itm string) (vrs Versions, err error)
GetVersions returns slice of all versions or a specific version if tag is specified
func (*SQLStorage) IsDBEmpty ¶
func (sqls *SQLStorage) IsDBEmpty() (resp bool, err error)
func (*SQLStorage) RemoveCDRs ¶
func (sqls *SQLStorage) RemoveCDRs(ctx *context.Context, qryFltr []*Filter) (err error)
func (*SQLStorage) RemoveVersions ¶
func (sqls *SQLStorage) RemoveVersions(vrs Versions) (err error)
RemoveVersions will remove specific versions out of storage
func (*SQLStorage) RewriteStorDB ¶
func (sqls *SQLStorage) RewriteStorDB() (err error)
Will rewrite every dump file of StorDB, only for InternalDB
func (*SQLStorage) SelectDatabase ¶
func (sqls *SQLStorage) SelectDatabase(dbName string) (err error)
type SessionCostsSQL ¶
type SessionCostsSQL struct {
ID int64
RunID string
OriginHost string
OriginID string
CostSource string
Usage int64
CostDetails string
CreatedAt time.Time
DeletedAt *time.Time
}
func (SessionCostsSQL) TableName ¶
func (t SessionCostsSQL) TableName() string
type StatACC ¶
type StatACC struct {
*Metric
}
ACC implements AverageCallCost metric
func (*StatACC) AddOneEvent ¶
func (acc *StatACC) AddOneEvent(ev utils.DataProvider) error
func (*StatACC) Clone ¶
func (acc *StatACC) Clone() StatMetric
func (*StatACC) GetStringValue ¶
type StatACD ¶
type StatACD struct {
*Metric
}
ACD implements AverageCallDuration metric
func (*StatACD) AddEvent ¶
func (acd *StatACD) AddEvent(evID string, ev utils.DataProvider) (err error)
func (*StatACD) AddOneEvent ¶
func (acd *StatACD) AddOneEvent(ev utils.DataProvider) (err error)
func (*StatACD) Clone ¶
func (acd *StatACD) Clone() StatMetric
func (*StatACD) GetStringValue ¶
type StatASR ¶
type StatASR struct {
*Metric
}
ASR implements AverageSuccessRatio metric
func (*StatASR) AddEvent ¶
func (asr *StatASR) AddEvent(evID string, ev utils.DataProvider) (err error)
AddEvent is part of StatMetric interface
func (*StatASR) AddOneEvent ¶
func (asr *StatASR) AddOneEvent(ev utils.DataProvider) (err error)
func (*StatASR) Clone ¶
func (asr *StatASR) Clone() StatMetric
func (*StatASR) GetStringValue ¶
type StatAverage ¶
StatAverage implements TotalCallCost metric
func (*StatAverage) AddEvent ¶
func (avg *StatAverage) AddEvent(evID string, ev utils.DataProvider) error
func (*StatAverage) AddOneEvent ¶
func (avg *StatAverage) AddOneEvent(ev utils.DataProvider) error
func (*StatAverage) Clone ¶
func (avg *StatAverage) Clone() StatMetric
func (*StatAverage) GetStringValue ¶
func (avg *StatAverage) GetStringValue(rounding int) string
func (*StatAverage) GetValue ¶
func (avg *StatAverage) GetValue() *utils.Decimal
type StatDDC ¶
type StatDDC struct {
FieldValues map[string]utils.StringSet // map[fieldValue]map[eventID]
Events map[string]map[string]uint64 // map[EventTenantID]map[fieldValue]compressfactor
MinItems uint64
Count uint64
FilterIDs []string
}
StatDDC count values occurring in destination field
func (*StatDDC) AddEvent ¶
func (ddc *StatDDC) AddEvent(evID string, ev utils.DataProvider) (err error)
func (*StatDDC) AddOneEvent ¶
func (ddc *StatDDC) AddOneEvent(ev utils.DataProvider) (err error)
func (*StatDDC) Clone ¶
func (ddc *StatDDC) Clone() StatMetric
func (*StatDDC) GetCompressFactor ¶
Compress is part of StatMetric interface
func (*StatDDC) GetFilterIDs ¶
func (*StatDDC) GetMinItems ¶
GetMinItems returns the minim items for the metric
func (*StatDDC) GetStringValue ¶
type StatDistinct ¶
type StatDistinct struct {
FieldValues map[string]utils.StringSet // map[fieldValue]map[eventID]
Events map[string]map[string]uint64 // map[EventTenantID]map[fieldValue]compressfactor
MinItems uint64
FieldName string
Count uint64
FilterIDs []string
}
func (*StatDistinct) AddEvent ¶
func (dst *StatDistinct) AddEvent(evID string, ev utils.DataProvider) (err error)
func (*StatDistinct) AddOneEvent ¶
func (dst *StatDistinct) AddOneEvent(ev utils.DataProvider) (err error)
func (*StatDistinct) Clone ¶
func (dst *StatDistinct) Clone() StatMetric
func (*StatDistinct) Compress ¶
func (dst *StatDistinct) Compress(uint64, string) (eventIDs []string)
func (*StatDistinct) GetCompressFactor ¶
func (dst *StatDistinct) GetCompressFactor(events map[string]uint64) map[string]uint64
Compress is part of StatMetric interface
func (*StatDistinct) GetFilterIDs ¶
func (dst *StatDistinct) GetFilterIDs() []string
func (*StatDistinct) GetMinItems ¶
func (dst *StatDistinct) GetMinItems() uint64
GetMinItems returns the minim items for the metric
func (*StatDistinct) GetStringValue ¶
func (dst *StatDistinct) GetStringValue(rounding int) (valStr string)
func (*StatDistinct) GetValue ¶
func (dst *StatDistinct) GetValue() *utils.Decimal
func (*StatDistinct) RemEvent ¶
func (dst *StatDistinct) RemEvent(evID string) (err error)
type StatMdl ¶
type StatMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
Blockers string `index:"4" re:".*"`
QueueLength int `index:"5" re:".*"`
TTL string `index:"6" re:".*"`
MinItems int `index:"7" re:".*"`
Stored bool `index:"8" re:".*"`
ThresholdIDs string `index:"9" re:".*"`
MetricIDs string `index:"10" re:".*"`
MetricFilterIDs string `index:"11" re:".*"`
MetricBlockers string `index:"12" re:".*"`
CreatedAt time.Time
}
type StatMdls ¶
type StatMdls []*StatMdl
func APItoModelStats ¶
func APItoModelStats(st *utils.TPStatProfile) (mdls StatMdls)
func (StatMdls) AsTPStats ¶
func (tps StatMdls) AsTPStats() (result []*utils.TPStatProfile)
type StatMetric ¶
type StatMetric interface {
GetValue() *utils.Decimal
GetStringValue(rounding int) string
AddOneEvent(ev utils.DataProvider) error
AddEvent(evID string, ev utils.DataProvider) error
RemEvent(evID string) error
GetMinItems() (minIts uint64)
Compress(queueLen uint64, defaultID string) (eventIDs []string)
GetCompressFactor(events map[string]uint64) map[string]uint64
Clone() StatMetric
GetFilterIDs() []string
}
StatMetric is the interface which a metric should implement
func NewStatAverage ¶
func NewStatAverage(minItems uint64, fieldName string, filterIDs []string) StatMetric
func NewStatDistinct ¶
func NewStatDistinct(minItems uint64, fieldName string, filterIDs []string) StatMetric
StatDistinct counts the different values occurring in a specific event field
func NewStatMetric ¶
func NewStatMetric(metricID string, minItems uint64, filterIDs []string) (sm StatMetric, err error)
NewStatMetric instantiates the StatMetric cfg serves as general purpose container to pass config options to metric
func NewStatSum ¶
func NewStatSum(minItems uint64, fieldName string, filterIDs []string) StatMetric
type StatPDD ¶
type StatPDD struct {
*Metric
}
PDD implements Post Dial Delay (average) metric
func (*StatPDD) AddOneEvent ¶
func (pdd *StatPDD) AddOneEvent(ev utils.DataProvider) error
func (*StatPDD) Clone ¶
func (pdd *StatPDD) Clone() StatMetric
func (*StatPDD) GetStringValue ¶
type StatQueue ¶
type StatQueue struct {
Tenant string
ID string
SQItems []SQItem
SQMetrics map[string]StatMetric
// contains filtered or unexported fields
}
StatQueue represents an individual stats instance
func NewStatQueue ¶
func NewStatQueue(tnt, id string, metrics []*MetricWithFilters, minItems uint64) (sq *StatQueue, err error)
func (*StatQueue) CacheClone ¶
CacheClone returns a clone of StatQueue used by ltcache CacheCloner
func (*StatQueue) MarshalJSON ¶
func (*StatQueue) ProcessEvent ¶
func (sq *StatQueue) ProcessEvent(ctx *context.Context, tnt, evID string, filterS *FilterS, evNm utils.MapStorage) (err error)
ProcessEvent processes a utils.CGREvent, returns true if processed
func (*StatQueue) TenantID ¶
TenantID will compose the unique identifier for the StatQueue out of Tenant and ID
func (*StatQueue) UnmarshalJSON ¶
UnmarshalJSON here only to fully support json for StatQueue
type StatQueueProfile ¶
type StatQueueProfile struct {
Tenant string
ID string // QueueID
FilterIDs []string
Weights utils.DynamicWeights
Blockers utils.DynamicBlockers // blocker flag to stop processing on filters matched
QueueLength int
TTL time.Duration
MinItems int
Stored bool
ThresholdIDs []string // list of thresholds to be checked after changes
Metrics []*MetricWithFilters // list of metrics to build
// contains filtered or unexported fields
}
StatsConfig represents the configuration of a StatsInstance in StatS
func APItoStats ¶
func APItoStats(tpST *utils.TPStatProfile, timezone string) (st *StatQueueProfile, err error)
func (*StatQueueProfile) CacheClone ¶
func (sqp *StatQueueProfile) CacheClone() any
CacheClone returns a clone of StatQueueProfile used by ltcache CacheCloner
func (*StatQueueProfile) Clone ¶
func (sqp *StatQueueProfile) Clone() *StatQueueProfile
Clone clones *StatQueueProfile (lkID excluded)
func (*StatQueueProfile) FieldAsInterface ¶
func (sqp *StatQueueProfile) FieldAsInterface(fldPath []string) (_ any, err error)
func (*StatQueueProfile) FieldAsString ¶
func (sqp *StatQueueProfile) FieldAsString(fldPath []string) (_ string, err error)
func (*StatQueueProfile) Merge ¶
func (sqp *StatQueueProfile) Merge(v2 any)
func (*StatQueueProfile) Set ¶
func (sqp *StatQueueProfile) Set(path []string, val any, newBranch bool) (err error)
func (*StatQueueProfile) String ¶
func (sqp *StatQueueProfile) String() string
func (*StatQueueProfile) TenantID ¶
func (sqp *StatQueueProfile) TenantID() string
type StatQueueProfileWithAPIOpts ¶
type StatQueueProfileWithAPIOpts struct {
*StatQueueProfile
APIOpts map[string]any
}
StatQueueProfileWithAPIOpts is used in replicatorV1 for dispatcher
type StatQueueWithAPIOpts ¶
func (*StatQueueWithAPIOpts) MarshalJSON ¶
func (ssq *StatQueueWithAPIOpts) MarshalJSON() (rply []byte, err error)
func (*StatQueueWithAPIOpts) UnmarshalJSON ¶
func (ssq *StatQueueWithAPIOpts) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON here only to fully support json for StatQueue
type StatS ¶
type StatS struct {
// contains filtered or unexported fields
}
StatS builds stats for events
func NewStatService ¶
func NewStatService(dm *DataManager, cgrcfg *config.CGRConfig, filterS *FilterS, connMgr *ConnManager) *StatS
NewStatService initializes a StatService
func (*StatS) StoreStatQueue ¶
StoreStatQueue stores the statQueue in DB and corrects dirty flag
func (*StatS) V1GetQueueDecimalMetrics ¶
func (sS *StatS) V1GetQueueDecimalMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *map[string]*utils.Decimal) (err error)
V1GetQueueDecimalMetrics returns the metrics as decimal values
func (*StatS) V1GetQueueFloatMetrics ¶
func (sS *StatS) V1GetQueueFloatMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *map[string]float64) (err error)
V1GetQueueFloatMetrics returns the metrics as float64 values
func (*StatS) V1GetQueueIDs ¶
func (sS *StatS) V1GetQueueIDs(ctx *context.Context, args *utils.TenantWithAPIOpts, qIDs *[]string) (err error)
V1GetQueueIDs returns list of queueIDs registered for a tenant
func (*StatS) V1GetQueueStringMetrics ¶
func (sS *StatS) V1GetQueueStringMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *map[string]string) (err error)
V1GetQueueStringMetrics returns the metrics of a Queue as string values
func (*StatS) V1GetStatQueue ¶
func (sS *StatS) V1GetStatQueue(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *StatQueue) (err error)
V1GetStatQueue returns a StatQueue object
func (*StatS) V1GetStatQueuesForEvent ¶
func (sS *StatS) V1GetStatQueuesForEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error)
V1GetStatQueuesForEvent implements StatV1 method for processing an Event
func (*StatS) V1ProcessEvent ¶
func (sS *StatS) V1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error)
V1ProcessEvent implements StatV1 method for processing an Event
func (*StatS) V1ResetStatQueue ¶
func (sS *StatS) V1ResetStatQueue(ctx *context.Context, tntID *utils.TenantIDWithAPIOpts, rply *string) (err error)
V1ResetStatQueue resets the stat queue
type StatSum ¶
func (*StatSum) AddOneEvent ¶
func (sum *StatSum) AddOneEvent(ev utils.DataProvider) error
func (*StatSum) Clone ¶
func (sum *StatSum) Clone() StatMetric
type StatTCC ¶
type StatTCC struct {
*Metric
}
TCC implements TotalCallCost metric
func (*StatTCC) AddOneEvent ¶
func (tcc *StatTCC) AddOneEvent(ev utils.DataProvider) error
func (*StatTCC) Clone ¶
func (tcc *StatTCC) Clone() StatMetric
type StatTCD ¶
type StatTCD struct {
*Metric
}
TCD implements TotalCallDuration metric
func (*StatTCD) AddEvent ¶
func (sum *StatTCD) AddEvent(evID string, ev utils.DataProvider) (err error)
func (*StatTCD) AddOneEvent ¶
func (sum *StatTCD) AddOneEvent(ev utils.DataProvider) (err error)
func (*StatTCD) Clone ¶
func (sum *StatTCD) Clone() StatMetric
func (*StatTCD) GetStringValue ¶
type StorDB ¶
type StorDB interface {
Storage
SetCDR(*context.Context, *utils.CGREvent, bool) error
GetCDRs(*context.Context, []*Filter, map[string]any) ([]*utils.CDR, error)
RemoveCDRs(*context.Context, []*Filter) error
DumpStorDB() error
RewriteStorDB() error
BackupStorDB(string, bool) error
}
func NewStorDBConn ¶
func NewStorDBConn(dbType, host, port, name, user, pass, marshaler string, stringIndexedFields, prefixIndexedFields []string, opts *config.StorDBOpts, itmsCfg map[string]*config.ItemOpts) (db StorDB, err error)
NewStorDBConn returns a StorDB(implements Storage interface) based on dbType
type Storage ¶
type Storage interface {
Close()
Flush(string) error
GetKeysForPrefix(ctx *context.Context, prefix string) ([]string, error)
GetVersions(itm string) (vrs Versions, err error)
SetVersions(vrs Versions, overwrite bool) (err error)
RemoveVersions(vrs Versions) (err error)
SelectDatabase(dbName string) (err error)
GetStorageType() string
IsDBEmpty() (resp bool, err error)
}
type StoredStatQueue ¶
type StoredStatQueue struct {
Tenant string
ID string
SQItems []SQItem
SQMetrics map[string][]byte
Compressed bool
}
StoredStatQueue differs from StatQueue due to serialization of SQMetrics
func NewStoredStatQueue ¶
func NewStoredStatQueue(sq *StatQueue, ms utils.Marshaler) (sSQ *StoredStatQueue, err error)
NewStoredStatQueue initiates a StoredStatQueue out of StatQueue
func (*StoredStatQueue) AsStatQueue ¶
func (ssq *StoredStatQueue) AsStatQueue(ms utils.Marshaler) (sq *StatQueue, err error)
AsStatQueue converts into StatQueue unmarshaling SQMetrics
func (*StoredStatQueue) SqID ¶
func (ssq *StoredStatQueue) SqID() string
SqID will compose the unique identifier for the StatQueue out of Tenant and ID
type TBLVersion ¶
func (TBLVersion) TableName ¶
func (t TBLVersion) TableName() string
type Threshold ¶
type Threshold struct {
Tenant string
ID string
Hits int // number of hits for this threshold
Snooze time.Time // prevent threshold to run too early
// contains filtered or unexported fields
}
Threshold is the unit matched by filters
func (*Threshold) CacheClone ¶
CacheClone returns a clone of Threshold used by ltcache CacheCloner
type ThresholdMdl ¶
type ThresholdMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
FilterIDs string `index:"2" re:".*"`
Weights string `index:"3" re:".*"`
MaxHits int `index:"4" re:".*"`
MinHits int `index:"5" re:".*"`
MinSleep string `index:"6" re:".*"`
Blocker bool `index:"7" re:".*"`
ActionProfileIDs string `index:"8" re:".*"`
Async bool `index:"9" re:".*"`
CreatedAt time.Time
}
func (ThresholdMdl) TableName ¶
func (ThresholdMdl) TableName() string
type ThresholdMdls ¶
type ThresholdMdls []*ThresholdMdl
func APItoModelTPThreshold ¶
func APItoModelTPThreshold(th *utils.TPThresholdProfile) (mdls ThresholdMdls)
func (ThresholdMdls) AsTPThreshold ¶
func (tps ThresholdMdls) AsTPThreshold() (result []*utils.TPThresholdProfile)
func (ThresholdMdls) CSVHeader ¶
func (tps ThresholdMdls) CSVHeader() (result []string)
CSVHeader return the header for csv fields as a slice of string
type ThresholdProfile ¶
type ThresholdProfile struct {
Tenant string
ID string
FilterIDs []string
MaxHits int
MinHits int
MinSleep time.Duration
Blocker bool // blocker flag to stop processing on filters matched
Weights utils.DynamicWeights // Weight to sort the thresholds
ActionProfileIDs []string
Async bool
// contains filtered or unexported fields
}
ThresholdProfile the profile for threshold
func APItoThresholdProfile ¶
func APItoThresholdProfile(tpTH *utils.TPThresholdProfile, timezone string) (th *ThresholdProfile, err error)
func (*ThresholdProfile) CacheClone ¶
func (tp *ThresholdProfile) CacheClone() any
CacheClone returns a clone of ThresholdProfile used by ltcache CacheCloner
func (*ThresholdProfile) Clone ¶
func (tp *ThresholdProfile) Clone() *ThresholdProfile
Clone clones *ThresholdProfile (lkID excluded)
func (*ThresholdProfile) FieldAsInterface ¶
func (tp *ThresholdProfile) FieldAsInterface(fldPath []string) (_ any, err error)
func (*ThresholdProfile) FieldAsString ¶
func (tp *ThresholdProfile) FieldAsString(fldPath []string) (_ string, err error)
func (*ThresholdProfile) Merge ¶
func (tp *ThresholdProfile) Merge(v2 any)
func (*ThresholdProfile) Set ¶
func (tp *ThresholdProfile) Set(path []string, val any, _ bool) (err error)
func (*ThresholdProfile) String ¶
func (tp *ThresholdProfile) String() string
func (*ThresholdProfile) TenantID ¶
func (tp *ThresholdProfile) TenantID() string
TenantID returns the concatenated key beteen tenant and ID
type ThresholdProfileWithAPIOpts ¶
type ThresholdProfileWithAPIOpts struct {
*ThresholdProfile
APIOpts map[string]any
}
ThresholdProfileWithAPIOpts is used in replicatorV1 for dispatcher
type ThresholdS ¶
type ThresholdS struct {
// contains filtered or unexported fields
}
ThresholdS manages Threshold execution and storing them to dataDB
func NewThresholdService ¶
func NewThresholdService(dm *DataManager, cgrcfg *config.CGRConfig, filterS *FilterS, connMgr *ConnManager) (tS *ThresholdS)
NewThresholdService the constructor for ThresoldS service
func (*ThresholdS) Reload ¶
func (tS *ThresholdS) Reload(ctx *context.Context)
Reload stops the backupLoop and restarts it
func (*ThresholdS) Shutdown ¶
func (tS *ThresholdS) Shutdown(ctx *context.Context)
Shutdown is called to shutdown the service
func (*ThresholdS) StartLoop ¶
func (tS *ThresholdS) StartLoop(ctx *context.Context)
StartLoop starts the gorutine with the backup loop
func (*ThresholdS) StoreThreshold ¶
func (tS *ThresholdS) StoreThreshold(ctx *context.Context, t *Threshold) (err error)
StoreThreshold stores the threshold in DB and corrects dirty flag
func (*ThresholdS) V1GetThreshold ¶
func (tS *ThresholdS) V1GetThreshold(ctx *context.Context, tntID *utils.TenantIDWithAPIOpts, t *Threshold) (err error)
V1GetThreshold retrieves a Threshold
func (*ThresholdS) V1GetThresholdIDs ¶
func (tS *ThresholdS) V1GetThresholdIDs(ctx *context.Context, args *utils.TenantWithAPIOpts, tIDs *[]string) (err error)
V1GetThresholdIDs returns list of thresholdIDs configured for a tenant
func (*ThresholdS) V1GetThresholdsForEvent ¶
func (tS *ThresholdS) V1GetThresholdsForEvent(ctx *context.Context, args *utils.CGREvent, reply *[]*Threshold) (err error)
V1GetThresholdsForEvent queries thresholds matching an Event
func (*ThresholdS) V1ProcessEvent ¶
func (tS *ThresholdS) V1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error)
V1ProcessEvent implements ThresholdService method for processing an Event
func (*ThresholdS) V1ResetThreshold ¶
func (tS *ThresholdS) V1ResetThreshold(ctx *context.Context, tntID *utils.TenantIDWithAPIOpts, rply *string) (err error)
V1ResetThreshold resets the threshold hits
type ThresholdWithAPIOpts ¶
ThresholdWithAPIOpts is used in replicatorV1 for dispatcher
type TpReader ¶
type TpReader struct {
// contains filtered or unexported fields
}
func NewTpReader ¶
func (*TpReader) GetLoadedIds ¶
GetLoadedIds returns the identities loaded for a specific category, useful for cache reloads
func (*TpReader) LoadAccounts ¶
func (*TpReader) LoadAccountsFiltered ¶
func (*TpReader) LoadActionProfiles ¶
func (*TpReader) LoadActionProfilesFiltered ¶
func (*TpReader) LoadAttributeProfiles ¶
func (*TpReader) LoadAttributeProfilesFiltered ¶
func (*TpReader) LoadChargerProfiles ¶
func (*TpReader) LoadChargerProfilesFiltered ¶
func (*TpReader) LoadFilters ¶
func (*TpReader) LoadFiltersFiltered ¶
func (*TpReader) LoadRankings ¶
func (*TpReader) LoadRankingsFiltered ¶
func (*TpReader) LoadRateProfiles ¶
func (*TpReader) LoadRateProfilesFiltered ¶
func (*TpReader) LoadResourceProfiles ¶
func (*TpReader) LoadResourceProfilesFiltered ¶
func (*TpReader) LoadRouteProfiles ¶
func (*TpReader) LoadRouteProfilesFiltered ¶
func (*TpReader) LoadStatsFiltered ¶
func (*TpReader) LoadThresholds ¶
func (*TpReader) LoadThresholdsFiltered ¶
func (*TpReader) LoadTrends ¶
func (*TpReader) LoadTrendsFiltered ¶
func (*TpReader) ReloadCache ¶
func (*TpReader) ReloadScheduler ¶
func (*TpReader) RemoveFromDatabase ¶
func (*TpReader) ShowStatistics ¶
func (tpr *TpReader) ShowStatistics()
func (*TpReader) WriteToDatabase ¶
type TrendMdl ¶
type TrendMdl struct {
PK uint `gorm:"primary_key"`
Tpid string
Tenant string `index:"0" re:".*"`
ID string `index:"1" re:".*"`
Schedule string `index:"2" re:".*"`
StatID string `index:"3" re:".*"`
Metrics string `index:"4" re:".*"`
TTL string `index:"5" re:".*"`
QueueLength int `index:"6" re:".*"`
MinItems int `index:"7" re:".*"`
CorrelationType string `index:"8" re:".*"`
Tolerance float64 `index:"9" re:".*"`
Stored bool `index:"10" re:".*"`
ThresholdIDs string `index:"11" re:".*"`
CreatedAt time.Time
}
type TrendMdls ¶
type TrendMdls []*TrendMdl
func APItoModelTrends ¶
func APItoModelTrends(tr *utils.TPTrendsProfile) (mdls TrendMdls)
func (TrendMdls) AsTPTrends ¶
func (models TrendMdls) AsTPTrends() (result []*utils.TPTrendsProfile)
type Versions ¶
Versions will keep trac of various item versions
func CurrentAllDBVersions ¶
func CurrentAllDBVersions() Versions
CurrentAllDBVersions returns the both DataDB
func CurrentDBVersions ¶
CurrentDBVersions returns versions based on dbType
func CurrentDataDBVersions ¶
func CurrentDataDBVersions() Versions
CurrentDataDBVersions returns the needed DataDB versions
func CurrentStorDBVersions ¶
func CurrentStorDBVersions() Versions
Source Files
¶
- caches.go
- caps.go
- connmanager.go
- datadbmock.go
- datamanager.go
- dispatcherprfl.go
- dynamicdp.go
- filterhelpers.go
- filters.go
- globalvars.go
- kafka_logger.go
- libdynopts.go
- libengine.go
- libindex.go
- libindex_health.go
- libstats.go
- mapevent.go
- model_helpers.go
- models.go
- remoterepl.go
- statmetrics.go
- stats.go
- storage_csv.go
- storage_interface.go
- storage_internal_config.go
- storage_internal_datadb.go
- storage_internal_stordb.go
- storage_mongo_config.go
- storage_mongo_datadb.go
- storage_mongo_stordb.go
- storage_mysql.go
- storage_postgres.go
- storage_redis.go
- storage_redis_config.go
- storage_sql.go
- storage_utils.go
- thresholds.go
- tpreader.go
- version.go