utils

package
v1.0.0-dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2025 License: GPL-3.0 Imports: 45 Imported by: 93

Documentation

Overview

Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments Copyright (C) ITsysCOM GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments Copyright (C) ITsysCOM GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

Index

Constants

View Source
const (
	CGRateS                  = "CGRateS"
	CGRateSorg               = "cgrates.org"
	Version                  = "v1.0~dev"
	DiameterFirmwareRevision = 918
	CGRateSLwr               = "cgrates"
	Postgres                 = "postgres"
	MySQL                    = "mysql"
	DataManager              = "DataManager"
	Localhost                = "127.0.0.1"
	Prepaid                  = "prepaid"
	MetaPrepaid              = "*prepaid"
	Postpaid                 = "postpaid"
	MetaPostpaid             = "*postpaid"
	PseudoPrepaid            = "pseudoprepaid"
	MetaPseudoPrepaid        = "*pseudoprepaid"
	MetaRated                = "*rated"
	MetaNone                 = "*none"
	MetaNow                  = "*now"
	MetaRoundingUp           = "*up"
	MetaRoundingMiddle       = "*middle"
	MetaRoundingDown         = "*down"
	MetaAny                  = "*any"
	MetaAll                  = "*all"
	MetaSingle               = "*single"
	MetaZero                 = "*zero"
	MetaASAP                 = "*asap"
	MetaNil                  = "*nil"
	MetaSpace                = "*space"
	MetaChar                 = "*char"
	CommentChar              = '#'
	CSVSep                   = ','
	FallbackSep              = ';'
	InfieldSep               = ";"
	RSRSep                   = ";"
	MetaPipe                 = "*|"
	FieldsSep                = ","
	InInFieldSep             = ":"
	StaticHDRValSep          = "::"
	FilterValStart           = "("
	FilterValEnd             = ")"
	PlusChar                 = "+"
	DecNaN                   = `"NaN"`
	JSON                     = "json"
	JSONCaps                 = "JSON"
	GOBCaps                  = "GOB"
	MsgPack                  = "msgpack"
	CSVLoad                  = "CSVLOAD"
	MetaCDRID                = "*cdrID"
	MetaOriginID             = "*originID"
	ToR                      = "ToR"
	OrderID                  = "OrderID"
	OriginID                 = "OriginID"
	InitialOriginID          = "InitialOriginID"
	OriginIDPrefix           = "OriginIDPrefix"
	Source                   = "Source"
	OriginHost               = "OriginHost"
	RequestType              = "RequestType"
	Direction                = "Direction"
	Tenant                   = "Tenant"
	Category                 = "Category"
	AccountField             = "Account"
	BalancesFld              = "Balances"
	Subject                  = "Subject"
	Destination              = "Destination"
	SetupTime                = "SetupTime"
	AnswerTime               = "AnswerTime"
	Usage                    = "Usage"
	DurationIndex            = "DurationIndex"
	MaxRateUnit              = "MaxRateUnit"
	DebitInterval            = "DebitInterval"
	TimeStart                = "TimeStart"
	TimeEnd                  = "TimeEnd"
	CallDuration             = "CallDuration"
	FallbackSubject          = "FallbackSubject"
	DryRun                   = "DryRun"

	CustomValue = "CustomValue"
	Value       = "Value"
	Rules       = "Rules"
	Metrics     = "Metrics"
	MetricID    = "MetricID"
	LastUsed    = "LastUsed"
	PDD         = "PDD"
	RouteStr    = "Route"
	RunID       = "RunID"
	MetaRunID   = "*runID"

	AttributeIDs            = "AttributeIDs"
	MetaOptsRunID           = "*opts.*runID"
	MetaReqRunID            = "*req.RunID"
	Cost                    = "Cost"
	CostDetails             = "CostDetails"
	Rated                   = "rated"
	Partial                 = "Partial"
	PreRated                = "PreRated"
	StaticValuePrefix       = "^"
	CSV                     = "csv"
	FWV                     = "fwv"
	MetaMongo               = "*mongo"
	MetaRedis               = "*redis"
	MetaPostgres            = "*postgres"
	MetaInternal            = "*internal"
	MetaLocalHost           = "*localhost"
	MetaBiJSONLocalHost     = "*bijson_localhost"
	MetaRatingSubjectPrefix = "*zero"
	OK                      = "OK"
	MetaFileXML             = "*fileXML"
	MetaFileJSON            = "*fileJSON"
	MaskChar                = "*"
	ConcatenatedKeySep      = ":"
	UnitTest                = "UNIT_TEST"
	HDRValSep               = "/"
	MetaMonetary            = "*monetary"
	MetaSMS                 = "*sms"
	MetaMMS                 = "*mms"
	MetaGeneric             = "*generic"
	MetaData                = "*data"
	MetaMaxCostFree         = "*free"
	MetaMaxCostDisconnect   = "*disconnect"
	MetaOut                 = "*out"
	MetaPause               = "*pause"

	MetaVoice                 = "*voice"
	ACD                       = "ACD"
	ConfigPrefix              = "cfg_"
	ResourcesPrefix           = "res_"
	ResourceProfilesPrefix    = "rsp_"
	IPAllocationsPrefix       = "ips_"
	IPProfilesPrefix          = "ipa_"
	ThresholdPrefix           = "thd_"
	FilterPrefix              = "ftr_"
	CDRsStatsPrefix           = "cst_"
	VersionPrefix             = "ver_"
	StatQueueProfilePrefix    = "sqp_"
	RouteProfilePrefix        = "rpp_"
	AttributeProfilePrefix    = "alp_"
	ChargerProfilePrefix      = "cpp_"
	RateProfilePrefix         = "rtp_"
	ActionProfilePrefix       = "acp_"
	AccountPrefix             = "acn_"
	ThresholdProfilePrefix    = "thp_"
	StatQueuePrefix           = "stq_"
	RankingProfilePrefix      = "rgp_"
	TrendProfilePrefix        = "trp_"
	TrendPrefix               = "trd_"
	LoadIDPrefix              = "lid_"
	LoadInstKey               = "load_history"
	CreateCDRsTablesSQL       = "create_cdrs_tables.sql"
	CreateTariffPlanTablesSQL = "create_tariffplan_tables.sql"
	TestSQL                   = "TEST_SQL"
	MetaAsc                   = "*asc"
	MetaDesc                  = "*desc"
	MetaConstant              = "*constant"
	MetaPositive              = "*positive"
	MetaNegative              = "*negative"
	MetaLast                  = "*last"
	MetaPassword              = "*password"
	MetaFiller                = "*filler"
	MetaHTTPPost              = "*httpPost"
	JanusAdminSubProto        = "janus-admin-protocol"
	MetaHTTPjsonCDR           = "*http_json_cdr"
	MetaHTTPjsonMap           = "*httpJSONMap"
	MetaAMQPjsonCDR           = "*amqp_json_cdr"
	MetaAMQPjsonMap           = "*amqpJSONMap"
	MetaAMQPV1jsonMap         = "*amqpv1JSONMap"
	MetaSQSjsonMap            = "*sqsJSONMap"
	MetaKafkajsonMap          = "*kafkaJSONMap"
	MetaNATSJSONMap           = "*natsJSONMap"
	MetaSQL                   = "*sql"
	MetaMySQL                 = "*mysql"
	MetaS3jsonMap             = "*s3JSONMap"
	ConfigPath                = "/etc/cgrates/"
	DisconnectCause           = "DisconnectCause"
	MetaRating                = "*rating"
	MetaAccounting            = "*accounting"
	NotAvailable              = "N/A"
	Call                      = "call"
	ExtraFields               = "ExtraFields"
	MetaSureTax               = "*sure_tax"
	MetaDynamic               = "*dynamic"
	MetaCounterEvent          = "*event"
	MetaBalance               = "*balance"
	MetaAccount               = "*account"
	EventName                 = "EventName"
	// action trigger threshold types
	TriggerMaxEventCounter = "*max_event_counter"
	TriggerMaxBalance      = "*max_balance"
	HierarchySep           = ">"
	MetaComposed           = "*composed"
	MetaUsageDifference    = "*usageDifference"
	MetaDifference         = "*difference"
	MetaVariable           = "*variable"
	MetaCCUsage            = "*ccUsage"
	MetaSIPCID             = "*sipcid"
	MetaValueExponent      = "*valueExponent"
	//rsrparser consts
	NegativePrefix          = "!"
	MatchStartPrefix        = "^"
	MatchGreaterThanOrEqual = ">="
	MatchLessThanOrEqual    = "<="
	MatchGreaterThan        = ">"
	MatchLessThan           = "<"
	MatchEndPrefix          = "$"
	//
	MetaRaw   = "*raw"
	CreatedAt = "CreatedAt"
	UpdatedAt = "UpdatedAt"
	//ExportLogger
	Message   = "Message"
	Severity  = "Severity"
	Timestamp = "Timestamp"

	XML                      = "xml"
	MetaGOB                  = "*gob"
	MetaJSON                 = "*json"
	MetaDateTime             = "*datetime"
	MetaMaskedDestination    = "*masked_destination"
	MetaUnixTimestamp        = "*unixTimestamp"
	MetaPostCDR              = "*post_cdr"
	MetaDumpToFile           = "*dump_to_file"
	MetaDumpToJSON           = "*dump_to_json"
	NonTransactional         = ""
	DataDB                   = "data_db"
	StorDB                   = "stor_db"
	NotFoundCaps             = "NOT_FOUND"
	ServerErrorCaps          = "SERVER_ERROR"
	MandatoryIEMissingCaps   = "MANDATORY_IE_MISSING"
	UnsupportedCachePrefix   = "unsupported cache prefix"
	UnsupportedServiceIDCaps = "UNSUPPORTED_SERVICE_ID"
	ServiceManager           = "ServiceManager"
	ServiceAlreadyRunning    = "service already running"
	RunningCaps              = "RUNNING"
	StoppedCaps              = "STOPPED"
	MetaAdminS               = "*admins"
	MetaReplicator           = "*replicator"
	MetaRerate               = "*rerate"
	MetaRefund               = "*refund"
	MetaStats                = "*stats"
	MetaTrends               = "*trends"
	MetaRankings             = "*rankings"
	MetaCore                 = "*core"
	MetaServiceManager       = "*servicemanager"
	MetaChargers             = "*chargers"
	MetaConfig               = "*config"
	MetaTpes                 = "*tpes"
	MetaFilters              = "*filters"
	MetaCDRs                 = "*cdrs"
	MetaDC                   = "*dc"
	MetaCaches               = "*caches"
	MetaUCH                  = "*uch"
	MetaGuardian             = "*guardians"
	MetaEEs                  = "*ees"
	MetaEFs                  = "*efs"
	MetaERs                  = "*ers"
	MetaRates                = "*rates"
	MetaRateSOverwrite       = "*rateSOverwrite"
	MetaContinue             = "*continue"
	MetaUp                   = "*up"
	Migrator                 = "migrator"
	UnsupportedMigrationTask = "unsupported migration task"
	UndefinedVersion         = "undefined version"
	JSONSuffix               = ".json"
	GOBSuffix                = ".gob"
	XMLSuffix                = ".xml"
	CSVSuffix                = ".csv"
	FWVSuffix                = ".fwv"
	ContentJSON              = "json"
	ContentForm              = "form"
	FileLockPrefix           = "file_"
	ActionsPoster            = "act"
	MetaFileCSV              = "*fileCSV"
	MetaVirt                 = "*virt"
	MetaElastic              = "*els"
	MetaFileFWV              = "*fileFWV"
	MetaFile                 = "*file"
	AccountsStr              = "Accounts"
	AccountS                 = "AccountS"
	Actions                  = "Actions"
	BalanceMap               = "BalanceMap"
	UnitCounters             = "UnitCounters"
	UpdateTime               = "UpdateTime"
	Rates                    = "Rates"
	RateField                = "Rate"
	Format                   = "Format"
	Conn                     = "Conn"
	Level                    = "Level"
	FailedPostsDir           = "FailedPostsDir"
	//DestinationRates         = "DestinationRates"
	RatingPlans          = "RatingPlans"
	RatingProfiles       = "RatingProfiles"
	AccountActions       = "AccountActions"
	ResourcesStr         = "Resources"
	Stats                = "Stats"
	Rankings             = "Rankings"
	Trends               = "Trends"
	Filters              = "Filters"
	RateProfiles         = "RateProfiles"
	ActionProfiles       = "ActionProfiles"
	AccountsString       = "Accounts"
	MetaEveryMinute      = "*every_minute"
	MetaHourly           = "*hourly"
	ID                   = "ID"
	Address              = "Address"
	Addresses            = "Addresses"
	Transport            = "Transport"
	ClientKey            = "ClientKey"
	ClientCertificate    = "ClientCertificate"
	CaCertificate        = "CaCertificate"
	ConnectAttempts      = "ConnectAttempts"
	Reconnects           = "Reconnects"
	MaxReconnectInterval = "MaxReconnectInterval"
	ConnectTimeout       = "ConnectTimeout"
	ReplyTimeout         = "ReplyTimeout"
	TLS                  = "TLS"
	Strategy             = "Strategy"
	StrategyParameters   = "StrategyParameters"
	ConnID               = "ConnID"
	ConnFilterIDs        = "ConnFilterIDs"
	ConnWeight           = "ConnWeight"
	ConnBlocker          = "ConnBlocker"
	ConnParameters       = "ConnParameters"

	Thresholds   = "Thresholds"
	Routes       = "Routes"
	Attributes   = "Attributes"
	Chargers     = "Chargers"
	StatS        = "StatS"
	LoadIDsVrs   = "LoadIDs"
	GlobalVarS   = "GlobalVarS"
	CostSource   = "CostSource"
	ExtraInfo    = "ExtraInfo"
	Meta         = "*"
	MetaSysLog   = "*syslog"
	MetaStdLog   = "*stdout"
	MetaKafkaLog = "*kafkaLog"
	Kafka        = "Kafka"
	EventSource  = "EventSource"
	AccountID    = "AccountID"
	AccountIDs   = "AccountIDs"
	ResourceID   = "ResourceID"
	TotalUsage   = "TotalUsage"
	StatID       = "StatID"
	BalanceType  = "BalanceType"
	BalanceID    = "BalanceID"
	//BalanceDestinationIds = "BalanceDestinationIds"
	BalanceCostIncrements = "BalanceCostIncrements"
	BalanceAttributeIDs   = "BalanceAttributeIDs"
	BalanceRateProfileIDs = "BalanceRateProfileIDs"
	BalanceWeights        = "BalanceWeights"
	BalanceRatingSubject  = "BalanceRatingSubject"
	BalanceCategories     = "BalanceCategories"
	BalanceBlockers       = "BalanceBlockers"
	BalanceDisabled       = "BalanceDisabled"
	Units                 = "Units"
	AccountUpdate         = "AccountUpdate"
	BalanceUpdate         = "BalanceUpdate"
	StatUpdate            = "StatUpdate"
	TrendUpdate           = "TrendUpdate"
	RankingUpdate         = "RankingUpdate"
	ResourceUpdate        = "ResourceUpdate"
	CDRKey                = "CDR"
	CDRs                  = "CDRs"
	ExpiryTime            = "ExpiryTime"
	AllowNegative         = "AllowNegative"
	Disabled              = "Disabled"
	Action                = "Action"

	SessionSCosts = "SessionSCosts"
	RQF           = "RQF"
	ResourceStr   = "Resource"
	User          = "User"
	Subscribers   = "Subscribers"
	//Destinations             = "Destinations"
	MetaSubscribers          = "*subscribers"
	MetaDataDB               = "*datadb"
	MetaStorDB               = "*stordb"
	MetaWeight               = "*weight"
	MetaLC                   = "*lc"
	MetaHC                   = "*hc"
	MetaQOS                  = "*qos"
	MetaReas                 = "*reas"
	MetaReds                 = "*reds"
	Weight                   = "Weight"
	Limit                    = "Limit"
	UsageTTL                 = "UsageTTL"
	AllocationMessage        = "AllocationMessage"
	AddressPool              = "AddressPool"
	Pools                    = "Pools"
	Allocation               = "Allocation"
	Range                    = "Range"
	Stored                   = "Stored"
	RatingSubject            = "RatingSubject"
	Categories               = "Categories"
	Blocker                  = "Blocker"
	Blockers                 = "Blockers"
	Params                   = "Params"
	StartTime                = "StartTime"
	AccountSummary           = "AccountSummary"
	RatingFilters            = "RatingFilters"
	RatingFilter             = "RatingFilter"
	Charging                 = "Charging"
	Accounting               = "Accounting"
	Rating                   = "Rating"
	Charges                  = "Charges"
	CompressFactor           = "CompressFactor"
	Increments               = "Increments"
	BalanceField             = "Balance"
	BalanceSummaries         = "BalanceSummaries"
	Type                     = "Type"
	Element                  = "Element"
	Values                   = "Values"
	YearsFieldName           = "Years"
	MonthsFieldName          = "Months"
	MonthDaysFieldName       = "MonthDays"
	WeekDaysFieldName        = "WeekDays"
	GroupIntervalStart       = "GroupIntervalStart"
	RateIncrement            = "RateIncrement"
	RateUnit                 = "RateUnit"
	BalanceUUID              = "BalanceUUID"
	ChargingID               = "ChargingID"
	RatingID                 = "RatingID"
	JoinedChargeIDs          = "JoinedChargeIDs"
	UnitFactorID             = "UnitFactorID"
	ExtraChargeID            = "ExtraChargeID"
	BalanceLimit             = "BalanceLimit"
	ConnectFee               = "ConnectFee"
	RoundingMethod           = "RoundingMethod"
	RoundingDecimals         = "RoundingDecimals"
	MaxCostStrategy          = "MaxCostStrategy"
	RateID                   = "RateID"
	RateIDs                  = "RateIDs"
	RateFilterIDs            = "RateFilterIDs"
	RateActivationStart      = "RateActivationStart"
	RateWeights              = "RateWeights"
	RateIntervalStart        = "RateIntervalStart"
	RateFixedFee             = "RateFixedFee"
	RateRecurrentFee         = "RateRecurrentFee"
	RateBlocker              = "RateBlocker"
	RatesID                  = "RatesID"
	RatingFiltersID          = "RatingFiltersID"
	RateProfileID            = "RateProfileID"
	AccountingID             = "AccountingID"
	MetaSessionS             = "*sessions"
	MetaDefault              = "*default"
	Error                    = "Error"
	MetaCgreq                = "*cgreq"
	MetaCgrep                = "*cgrep"
	CgrAcd                   = "cgr_acd"
	ActivationIntervalString = "ActivationInterval"
	MaxHits                  = "MaxHits"
	MinHits                  = "MinHits"
	Async                    = "Async"
	Sorting                  = "Sorting"
	SortingParameters        = "SortingParameters"
	RouteAccountIDs          = "RouteAccountIDs"
	RouteRateProfileIDs      = "RouteRateProfileIDs"
	RouteStatIDs             = "RouteStatIDs"
	StatIDs                  = "StatIDs"
	SortedStatIDs            = "SortedStatIDs"
	LastUpdate               = "LastUpdate"
	TrendID                  = "TrendID"
	RankingID                = "RankingID"
	RouteWeights             = "RouteWeights"
	RouteParameters          = "RouteParameters"
	RouteBlockers            = "RouteBlockers"
	RouteResourceIDs         = "RouteResourceIDs"
	ResourceIDs              = "ResourceIDs"
	RouteFilterIDs           = "RouteFilterIDs"
	AttributeFilterIDs       = "AttributeFilterIDs"
	AttributeBlockers        = "AttributeBlockers"
	QueueLength              = "QueueLength"
	QueryInterval            = "QueryInterval"
	CorrelationType          = "CorrelationType"
	Tolerance                = "Tolerance"
	TTL                      = "TTL"
	PurgeFilterIDs           = "PurgeFilterIDs"
	TrendStr                 = "Trend"
	MinItems                 = "MinItems"
	MetricIDs                = "MetricIDs"
	MetricFilterIDs          = "MetricFilterIDs"
	MetricBlockers           = "MetricBlockers"
	FieldName                = "FieldName"
	Path                     = "Path"
	Hosts                    = "Hosts"
	StrategyParams           = "StrategyParams"
	MetaRound                = "*round"
	Pong                     = "Pong"
	MetaEventCost            = "*event_cost"
	MetaPositiveExports      = "*positive_exports"
	MetaNegativeExports      = "*negative_exports"
	MetaBuffer               = "*buffer"
	MetaRoutesEventCost      = "*routesEventCost"
	Freeswitch               = "freeswitch"
	Kamailio                 = "kamailio"
	Opensips                 = "opensips"
	Asterisk                 = "asterisk"
	SchedulerS               = "SchedulerS"
	MetaMultiply             = "*multiply"
	MetaDivide               = "*divide"
	MetaUrl                  = "*url"
	MetaZip                  = "*zip"
	MetaXml                  = "*xml"
	MetaReq                  = "*req"
	MetaVars                 = "*vars"
	MetaRep                  = "*rep"
	MetaExp                  = "*exp"
	MetaHdr                  = "*hdr"
	MetaTrl                  = "*trl"
	MetaTmp                  = "*tmp"
	MetaOpts                 = "*opts"
	MetaCfg                  = "*cfg"
	MetaDynReq               = "~*req"
	CGROriginHost            = "cgr_originhost"
	MetaInitiate             = "*initiate"
	MetaUpdate               = "*update"
	MetaTerminate            = "*terminate"
	MetaEvent                = "*event"
	MetaMessage              = "*message"
	MetaDryRun               = "*dryRun"
	Event                    = "Event"
	EmptyString              = ""
	DynamicDataPrefix        = "~"
	AttrValueSep             = "="
	ANDSep                   = "&"
	PipeSep                  = "|"
	RSRConstSep              = "`"
	RSRConstChar             = '`'
	RSRDataConverterPrefix   = "{*"
	RSRDataConverterSufix    = "}"
	RSRDynStartChar          = '<'
	RSRDynEndChar            = '>'
	MetaApp                  = "*app"
	MetaAppID                = "*appid"
	MetaCmd                  = "*cmd"
	MetaEnv                  = "*env:" // use in config for describing enviormant variables
	MetaTemplate             = "*template"
	MetaCCA                  = "*cca"
	MetaErr                  = "*err"
	OriginRealm              = "OriginRealm"
	ProductName              = "ProductName"
	IdxStart                 = "["
	IdxEnd                   = "]"
	IdxCombination           = "]["

	MetaMemory              = "*memory"
	RemoteHost              = "RemoteHost"
	Local                   = "local"
	TCP                     = "tcp"
	UDP                     = "udp"
	CGRDebitInterval        = "CGRDebitInterval"
	VersionName             = "Version"
	MetaTenant              = "*tenant"
	ResourceUsageStr        = "ResourceUsage"
	MetaDuration            = "*duration"
	MetaLibPhoneNumber      = "*libphonenumber"
	MetaTimeString          = "*time_string"
	MetaIP2Hex              = "*ip2hex"
	MetaString2Hex          = "*string2hex"
	MetaUnixTime            = "*unixtime"
	MetaLen                 = "*len"
	MetaSlice               = "*slice"
	MetaSIPURIMethod        = "*sipuri_method"
	MetaSIPURIHost          = "*sipuri_host"
	MetaSIPURIUser          = "*sipuri_user"
	E164DomainConverter     = "*e164Domain"
	E164Converter           = "*e164"
	MetaJoin                = "*join"
	MetaSplit               = "*split"
	MetaStrip               = "*strip"
	MetaReload              = "*reload"
	MetaLoad                = "*load"
	MetaFloat64             = "*float64"
	MetaRemove              = "*remove"
	MetaRemoveAll           = "*removeall"
	MetaStore               = "*store"
	MetaParse               = "*parse"
	MetaClear               = "*clear"
	MetaExport              = "*export"
	MetaGigawords           = "*gigawords"
	MetaExportID            = "*export_id"
	LoadIDs                 = "load_ids"
	DNSAgent                = "DNSAgent"
	TLSNoCaps               = "tls"
	UsageID                 = "UsageID"
	AllocationID            = "AllocationID"
	Replacement             = "Replacement"
	Regexp                  = "Regexp"
	Order                   = "Order"
	Preference              = "Preference"
	Flags                   = "Flags"
	Service                 = "Service"
	MetaAnalyzerS           = "*analyzers"
	CGREventString          = "CGREvent"
	MetaTextPlain           = "*text_plain"
	MetaRelease             = "*release"
	MetaAllocate            = "*allocate"
	MetaAuthorize           = "*authorize"
	MetaSTIRAuthenticate    = "*stir_authenticate"
	MetaSTIRInitiate        = "*stir_initiate"
	MetaInit                = "*init"
	ERs                     = "ERs"
	EEs                     = "EEs"
	EFs                     = "EFs"
	Ratio                   = "Ratio"
	Load                    = "Load"
	Slash                   = "/"
	UUID                    = "UUID"
	ActionsID               = "ActionsID"
	MetaAct                 = "*act"
	ExportTemplate          = "ExportTemplate"
	Synchronous             = "Synchronous"
	Attempts                = "Attempts"
	FieldSeparator          = "FieldSeparator"
	ExportPath              = "ExportPath"
	ExporterIDs             = "ExporterIDs"
	TimeNow                 = "TimeNow"
	ExportFileName          = "ExportFileName"
	GroupID                 = "GroupID"
	ThresholdType           = "ThresholdType"
	ThresholdValue          = "ThresholdValue"
	Recurrent               = "Recurrent"
	Executed                = "Executed"
	MinSleep                = "MinSleep"
	ActivationDate          = "ActivationDate"
	ExpirationDate          = "ExpirationDate"
	MinQueuedItems          = "MinQueuedItems"
	OrderIDStart            = "OrderIDStart"
	OrderIDEnd              = "OrderIDEnd"
	MinCost                 = "MinCost"
	MaxCost                 = "MaxCost"
	MetaLoaders             = "*loaders"
	TmpSuffix               = ".tmp"
	MetaDiamreq             = "*diamreq"
	MetaCost                = "*cost"
	MetaRateSCost           = "*rateSCost"
	MetaAccountSCost        = "*accountSCost"
	MetaGroup               = "*group"
	InternalRPCSet          = "InternalRPCSet"
	MetaFileName            = "*fileName"
	MetaFileLineNumber      = "*fileLineNumber"
	MetaReaderID            = "*readerID"
	MetaRadauth             = "*radauth"
	UserPassword            = "UserPassword"
	RadauthFailed           = "RADAUTH_FAILED"
	MetaPAP                 = "*pap"
	MetaCHAP                = "*chap"
	MetaMSCHAPV2            = "*mschapv2"
	MetaDynaprepaid         = "*dynaprepaid"
	MetaFD                  = "*fd"
	SortingData             = "SortingData"
	ProfileID               = "ProfileID"
	SortedRoutes            = "SortedRoutes"
	MetaMonthly             = "*monthly"
	MetaYearly              = "*yearly"
	MetaDaily               = "*daily"
	MetaWeekly              = "*weekly"
	RateS                   = "RateS"
	Underline               = "_"
	MetaBusy                = "*busy"
	MetaQueue               = "*queue"
	MetaMonthEnd            = "*month_end"
	APIKey                  = "ApiKey"
	RouteID                 = "RouteID"
	MetaMonthlyEstimated    = "*monthly_estimated"
	MetaProcessedProfileIDs = "*processedProfileIDs"
	MetaAttrPrfTenantID     = "*apTenantID"
	HashtagSep              = "#"
	MetaRounding            = "*rounding"
	StatsNA                 = -1.0
	InvalidUsage            = -1
	Abstracts               = "Abstracts"
	Concretes               = "Concretes"
	ActionS                 = "ActionS"
	Schedule                = "Schedule"
	ActionFilterIDs         = "ActionFilterIDs"
	ActionTTL               = "ActionTTL"
	ActionOpts              = "ActionOpts"
	ActionPath              = "ActionPath"
	TPid                    = "TPid"
	LoadId                  = "LoadId"
	ActionPlanId            = "ActionPlanId"
	AccountActionsId        = "AccountActionsId"
	Loadid                  = "loadid"
	ActionPlan              = "ActionPlan"
	ActionsId               = "ActionsId"
	Prefixes                = "Prefixes"
	RateSlots               = "RateSlots"
	RatingPlanBindings      = "RatingPlanBindings"
	RatingPlanActivations   = "RatingPlanActivations"
	Time                    = "Time"
	TargetIDs               = "TargetIDs"
	TargetType              = "TargetType"
	MetaRow                 = "*row"
	BalanceFilterIDs        = "BalanceFilterIDs"
	BalanceOpts             = "BalanceOpts"
	MetaConcrete            = "*concrete"
	MetaAbstract            = "*abstract"
	MetaMockAbstract        = "*mockabstract"
	MetaBalanceLimit        = "*balanceLimit"
	MetaBalanceUnlimited    = "*balanceUnlimited"
	MetaTemplateID          = "*templateID"
	MetaCdrLog              = "*cdrLog"
	MetaCDR                 = "*cdr"
	MetaExporterIDs         = "*exporterIDs"
	MetaExporterID          = "*exporterID"
	MetaChargeID            = "*chargeID"
	MetaAsync               = "*async"
	MetaUsage               = "*usage"
	MetaDestination         = "*destination"
	MetaStartTime           = "*startTime"
	Weights                 = "Weights"
	ActivationTimes         = "ActivationTimes"
	IntervalRates           = "IntervalRates"
	IntervalStart           = "IntervalStart"
	Unit                    = "Unit"
	Targets                 = "Targets"
	Balances                = "Balances"
	UnitFactorField         = "UnitFactor"
	UnitFactors             = "UnitFactors"
	JoinedCharge            = "JoinedCharge"
	CostIncrements          = "CostIncrements"
	Factor                  = "Factor"
	Increment               = "Increment"
	FixedFee                = "FixedFee"
	RecurrentFee            = "RecurrentFee"
	IncrementStart          = "IncrementStart"
	RateIntervalIndex       = "RateIntervalIndex"
	Diktats                 = "Diktats"
	BalanceIDs              = "BalanceIDs"
	MetaCostIncrement       = "*costIncrement"
	Length                  = "Length"
	V1Prfx                  = "V1"
	Ping                    = "Ping"

	// dns
	DNSQueryType          = "QueryType"
	DNSQueryName          = "QueryName"
	DNSOption             = "Option"
	DNSRcode              = "Rcode"
	DNSId                 = "Id"
	DNSResponse           = "Response"
	DNSOpcode             = "Opcode"
	DNSAuthoritative      = "Authoritative"
	DNSTruncated          = "Truncated"
	DNSRecursionDesired   = "RecursionDesired"
	DNSRecursionAvailable = "RecursionAvailable"
	DNSZero               = "Zero"
	DNSAuthenticatedData  = "AuthenticatedData"
	DNSCheckingDisabled   = "CheckingDisabled"
	DNSQuestion           = "Question"
	DNSAnswer             = "Answer"
	DNSNs                 = "Ns"
	DNSExtra              = "Extra"
	DNSName               = "Name"
	DNSQtype              = "Qtype"
	DNSQclass             = "Qclass"
	DNSFamily             = "Family"
	DNSSourceNetmask      = "SourceNetmask"
	DNSSourceScope        = "SourceScope"
	DNSLease              = "Lease"
	DNSKeyLease           = "KeyLease"
	DNSLeaseLife          = "LeaseLife"
	DNSTimeout            = "Timeout"
	DNSInfoCode           = "InfoCode"
	DNSExtraText          = "ExtraText"
	DNSNsid               = "Nsid"
	DNSCookie             = "Cookie"
	DNSDAU                = "DAU"
	DNSDHU                = "DHU"
	DNSN3U                = "N3U"
	DNSExpire             = "Expire"
	DNSPadding            = "Padding"
	DNSUri                = "Uri"
	DNSHdr                = "Hdr"
	DNSA                  = "A"
	DNSTarget             = "Target"
	DNSPriority           = "Priority"
	DNSPort               = "Port"
	DNSRrtype             = "Rrtype"
	DNSClass              = "Class"
	DNSTtl                = "Ttl"
	DNSRdlength           = "Rdlength"
	DNSData               = "Data"
	MetaTntID             = "*tntID"
)
View Source
const (

	// condensed result fields
	PID            = "pid"
	NodeID         = "node_id"
	GoVersion      = "go_version"
	OSThreadsInUse = "os_threads_in_use"
	RunningSince   = "running_since"
	OpenFiles      = "open_files"
	ActiveMemory   = "active_memory"
	SystemMemory   = "system_memory"

	FieldVersion         = "version"
	FieldMemStats        = "mem_stats"
	FieldGCDurationStats = "gc_duration_stats"
	FieldProcStats       = "proc_stats"
	FieldCapsStats       = "caps_stats"

	MetricRuntimeGoroutines = "goroutines"
	MetricRuntimeThreads    = "threads"
	MetricRuntimeMaxProcs   = "maxprocs"

	MetricMemAlloc        = "alloc"
	MetricMemTotalAlloc   = "total_alloc"
	MetricMemSys          = "sys"
	MetricMemMallocs      = "mallocs"
	MetricMemFrees        = "frees"
	MetricMemHeapAlloc    = "heap_alloc"
	MetricMemHeapSys      = "heap_sys"
	MetricMemHeapIdle     = "heap_idle"
	MetricMemHeapInuse    = "heap_inuse"
	MetricMemHeapReleased = "heap_released"
	MetricMemHeapObjects  = "heap_objects"
	MetricMemStackInuse   = "stack_inuse"
	MetricMemStackSys     = "stack_sys"
	MetricMemMSpanSys     = "mspan_sys"
	MetricMemMSpanInuse   = "mspan_inuse"
	MetricMemMCacheInuse  = "mcache_inuse"
	MetricMemMCacheSys    = "mcache_sys"
	MetricMemBuckHashSys  = "buckhash_sys"
	MetricMemGCSys        = "gc_sys"
	MetricMemOtherSys     = "other_sys"
	MetricMemNextGC       = "next_gc"
	MetricMemLastGC       = "last_gc"
	MetricMemLimit        = "mem_limit"

	MetricProcCPUTime              = "cpu_time"
	MetricProcMaxFDs               = "max_fds"
	MetricProcOpenFDs              = "open_fds"
	MetricProcResidentMemory       = "resident_memory"
	MetricProcStartTime            = "start_time"
	MetricProcVirtualMemory        = "virtual_memory"
	MetricProcMaxVirtualMemory     = "max_virtual_memory"
	MetricProcNetworkReceiveTotal  = "network_receive_total"
	MetricProcNetworkTransmitTotal = "network_transmit_total"

	MetricGCQuantiles = "quantiles"
	MetricGCQuantile  = "quantile"
	MetricGCValue     = "value"
	MetricGCSum       = "sum"
	MetricGCCount     = "count"
	MetricGCPercent   = "gc_percent"

	MetricCapsAllocated = "caps_allocated"
	MetricCapsPeak      = "caps_peak"
)

CoreS metric constants

View Source
const (
	Move    = "move"
	Migrate = "migrate"
)

Migrator Action

View Source
const (
	MetaAccounts          = "*accounts"
	MetaActions           = "*actions"
	MetaResourceProfiles  = "*resource_profiles"
	MetaIPProfiles        = "*ip_profiles"
	MetaStatQueueProfiles = "*statqueue_profiles"
	MetaStatQueues        = "*statqueues"
	MetaRankingProfiles   = "*ranking_profiles"
	MetaTrendProfiles     = "*trend_profiles"
	MetaThresholdProfiles = "*threshold_profiles"
	MetaRouteProfiles     = "*route_profiles"
	MetaAttributeProfiles = "*attribute_profiles"
	MetaRateProfiles      = "*rate_profiles"
	MetaRateProfileRates  = "*rate_profile_rates"
	MetaChargerProfiles   = "*charger_profiles"
	MetaIPAllocations     = "*ip_allocations"
	MetaThresholds        = "*thresholds"
	MetaRoutes            = "*routes"
	MetaAttributes        = "*attributes"
	MetaActionProfiles    = "*action_profiles"
	MetaLoadIDs           = "*load_ids"
	MetaNodeID            = "*node_id"
)

Meta Items

View Source
const (
	MetaASR      = "*asr"
	MetaACD      = "*acd"
	MetaTCD      = "*tcd"
	MetaACC      = "*acc"
	MetaTCC      = "*tcc"
	MetaPDD      = "*pdd"
	MetaDDC      = "*ddc"
	MetaSum      = "*sum"
	MetaAverage  = "*average"
	MetaDistinct = "*distinct"
	MetaRAR      = "*rar"
)

MetaMetrics

View Source
const (
	SessionS        = "SessionS"
	AttributeS      = "AttributeS"
	RouteS          = "RouteS"
	ResourceS       = "ResourceS"
	IPs             = "IPs"
	StatService     = "StatS"
	FilterS         = "FilterS"
	ThresholdS      = "ThresholdS"
	TrendS          = "TrendS"
	RankingS        = "RankingS"
	RegistrarC      = "RegistrarC"
	LoaderS         = "LoaderS"
	ChargerS        = "ChargerS"
	TPeS            = "TPeS"
	CacheS          = "CacheS"
	AnalyzerS       = "AnalyzerS"
	CDRServer       = "CDRServer"
	GuardianS       = "GuardianS"
	ServiceManagerS = "ServiceManager"
	CommonListenerS = "CommonListenerS"
	ConnManager     = "ConnManager"
	LoggerS         = "LoggerS"
	CapS            = "CapS"
)

Services

View Source
const (
	SessionsLow    = "sessions"
	AttributesLow  = "attributes"
	ChargerSLow    = "chargers"
	RoutesLow      = "routes"
	ResourcesLow   = "resources"
	StatServiceLow = "stats"
	ThresholdsLow  = "thresholds"
	AnalyzerSLow   = "analyzers"
	SchedulerSLow  = "schedulers"
	LoaderSLow     = "loaders"
	ReplicatorLow  = "replicator"
	EEsLow         = "ees"
	RateSLow       = "rates"
	AccountSLow    = "accounts"
	ActionSLow     = "actions"
)

Lower service names

View Source
const (
	MetaLog                = "*log"
	MetaTopUpReset         = "*topup_reset"
	MetaTopUp              = "*topup"
	MetaDebitReset         = "*debit_reset"
	MetaDebit              = "*debit"
	MetaEnableAccount      = "*enable_account"
	MetaDisableAccount     = "*disable_account"
	MetaUnlimited          = "*unlimited"
	CDRLog                 = "*cdrlog"
	MetaCgrRpc             = "*cgr_rpc"
	MetaRpc                = "*rpc"
	MetaRemoveSessionCosts = "*remove_session_costs"
	MetaPostEvent          = "*post_event"
	MetaCDRAccount         = "*reset_account_cdr"
	MetaResetThreshold     = "*reset_threshold"
	MetaResetStatQueue     = "*reset_stat_queue"
	MetaRemoteSetAccount   = "*remote_set_account"
	ActionID               = "ActionID"
	ActionType             = "ActionType"
	ActionValue            = "ActionValue"
	BalanceValue           = "BalanceValue"
	BalanceUnits           = "BalanceUnits"
	BalanceUnitFactors     = "BalanceUnitFactors"
	ExtraParameters        = "ExtraParameters"

	MetaAddBalance            = "*add_balance"
	MetaSetBalance            = "*set_balance"
	MetaRemBalance            = "*rem_balance"
	DynaprepaidActionplansCfg = "dynaprepaid_actionprofile"
)

Actions

View Source
const (
	MetaSetVersions         = "*set_versions"
	MetaEnsureIndexes       = "*ensure_indexes"
	MetaTpFilters           = "*tp_filters"
	MetaTpThresholds        = "*tp_thresholds"
	MetaTpRoutes            = "*tp_Routes"
	MetaTpStats             = "*tp_stats"
	MetaTpActionProfiles    = "*tp_action_profiles"
	MetaTpRateProfiles      = "*tp_rate_profiles"
	MetaTpResources         = "*tp_resources"
	MetaTpChargers          = "*tp_chargers"
	MetaDurationSeconds     = "*duration_seconds"
	MetaDurationNanoseconds = "*duration_nanoseconds"
	CapAttributes           = "Attributes"
	CapResourceAllocation   = "ResourceAllocation"
	CapMaxUsage             = "MaxUsage"
	CapRoutes               = "Routes"
	CapRouteProfiles        = "RouteProfiles"
	CapThresholds           = "Thresholds"
	CapStatQueues           = "StatQueues"
)

Migrator Metas

View Source
const (
	TpFilters        = "TpFilters"
	TpThresholds     = "TpThresholds"
	TpRoutes         = "TpRoutes"
	TpAttributes     = "TpAttributes"
	TpStats          = "TpStats"
	TpResources      = "TpResources"
	TpResource       = "TpResource"
	TpChargers       = "TpChargers"
	TpRateProfiles   = "TpRateProfiles"
	TpActionProfiles = "TpActionProfiles"
	TpAccounts       = "TpAccounts"
)
View Source
const (
	MetaFirst          = "*first"
	MetaRandom         = "*random"
	MetaRoundRobin     = "*round_robin"
	MetaRatio          = "*ratio"
	MetaDefaultRatio   = "*default_ratio"
	ThresholdSv1       = "ThresholdSv1"
	TrendSv1           = "TrendSv1"
	RankingSv1         = "RankingSv1"
	StatSv1            = "StatSv1"
	ResourceSv1        = "ResourceSv1"
	IPsV1              = "IPsV1"
	RouteSv1           = "RouteSv1"
	AttributeSv1       = "AttributeSv1"
	SessionSv1         = "SessionSv1"
	ChargerSv1         = "ChargerSv1"
	MetaAuth           = "*auth"
	APIMethods         = "APIMethods"
	NestingSep         = "."
	ArgDispatcherField = "ArgDispatcher"
)

Dispatcher Const

View Source
const (
	MetaNot                = "*not"
	MetaString             = "*string"
	MetaContains           = "*contains"
	MetaPrefix             = "*prefix"
	MetaSuffix             = "*suffix"
	MetaBoth               = "*both"
	MetaEmpty              = "*empty"
	MetaExists             = "*exists"
	MetaCronExp            = "*cronexp"
	MetaRSR                = "*rsr"
	MetaLessThan           = "*lt"
	MetaLessOrEqual        = "*lte"
	MetaGreaterThan        = "*gt"
	MetaGreaterOrEqual     = "*gte"
	MetaResources          = "*resources"
	MetaIPs                = "*ips"
	MetaEqual              = "*eq"
	MetaIPNet              = "*ipnet"
	MetaAPIBan             = "*apiban"
	MetaSentryPeer         = "*sentrypeer"
	MetaToken              = "*token"
	MetaIP                 = "*ip"
	MetaNumber             = "*number"
	MetaActivationInterval = "*ai"
	MetaRegex              = "*regex"
	MetaNever              = "*never"

	MetaNotString             = "*notstring"
	MetaNotContains           = "*notcontains"
	MetaNotPrefix             = "*notprefix"
	MetaNotSuffix             = "*notsuffix"
	MetaNotEmpty              = "*notempty"
	MetaNotExists             = "*notexists"
	MetaNotCronExp            = "*notcronexp"
	MetaNotRSR                = "*notrsr"
	MetaNotStatS              = "*notstats"
	MetaNotResources          = "*notresources"
	MetaNotEqual              = "*noteq"
	MetaNotIPNet              = "*notipnet"
	MetaNotAPIBan             = "*notapiban"
	MetaNotSentryPeer         = "*notsentrypeer"
	MetaNotActivationInterval = "*notai"
	MetaNotRegex              = "*notregex"
	MetaHTTP                  = "*http"

	MetaEC = "*ec"
)

Filter types

View Source
const (
	ReplicatorS                       = "ReplicatorS"
	ReplicatorSv1                     = "ReplicatorSv1"
	ReplicatorSv1Ping                 = "ReplicatorSv1.Ping"
	ReplicatorSv1GetStatQueue         = "ReplicatorSv1.GetStatQueue"
	ReplicatorSv1GetFilter            = "ReplicatorSv1.GetFilter"
	ReplicatorSv1GetThreshold         = "ReplicatorSv1.GetThreshold"
	ReplicatorSv1GetThresholdProfile  = "ReplicatorSv1.GetThresholdProfile"
	ReplicatorSv1GetStatQueueProfile  = "ReplicatorSv1.GetStatQueueProfile"
	ReplicatorSv1GetRanking           = "ReplicatorSv1.GetRanking"
	ReplicatorSv1GetRankingProfile    = "ReplicatorSv1.GetRankingProfile"
	ReplicatorSv1GetTrendProfile      = "ReplicatorSv1.GetTrendProfile"
	ReplicatorSv1GetTrend             = "ReplicatorSv1.GetTrend"
	ReplicatorSv1GetResource          = "ReplicatorSv1.GetResource"
	ReplicatorSv1GetResourceProfile   = "ReplicatorSv1.GetResourceProfile"
	ReplicatorSv1GetIPAllocations     = "ReplicatorSv1.GetIPAllocations"
	ReplicatorSv1GetIPProfile         = "ReplicatorSv1.GetIPProfile"
	ReplicatorSv1GetRouteProfile      = "ReplicatorSv1.GetRouteProfile"
	ReplicatorSv1GetAttributeProfile  = "ReplicatorSv1.GetAttributeProfile"
	ReplicatorSv1GetChargerProfile    = "ReplicatorSv1.GetChargerProfile"
	ReplicatorSv1GetDispatcherProfile = "ReplicatorSv1.GetDispatcherProfile"
	ReplicatorSv1GetRateProfile       = "ReplicatorSv1.GetRateProfile"
	ReplicatorSv1GetActionProfile     = "ReplicatorSv1.GetActionProfile"
	ReplicatorSv1GetDispatcherHost    = "ReplicatorSv1.GetDispatcherHost"
	ReplicatorSv1GetAccount           = "ReplicatorSv1.GetAccount"
	ReplicatorSv1GetItemLoadIDs       = "ReplicatorSv1.GetItemLoadIDs"
	ReplicatorSv1SetThresholdProfile  = "ReplicatorSv1.SetThresholdProfile"
	ReplicatorSv1SetThreshold         = "ReplicatorSv1.SetThreshold"
	ReplicatorSv1SetStatQueue         = "ReplicatorSv1.SetStatQueue"
	ReplicatorSv1SetFilter            = "ReplicatorSv1.SetFilter"
	ReplicatorSv1SetStatQueueProfile  = "ReplicatorSv1.SetStatQueueProfile"
	ReplicatorSv1SetRankingProfile    = "ReplicatorSv1.SetRankingProfile"
	ReplicatorSv1SetRanking           = "ReplicatorSv1.SetRanking"
	ReplicatorSv1SetTrendProfile      = "ReplicatorSv1.SetTrendProfile"
	ReplicatorSv1SetTrend
	ReplicatorSv1SetResource         = "ReplicatorSv1.SetResource"
	ReplicatorSv1SetResourceProfile  = "ReplicatorSv1.SetResourceProfile"
	ReplicatorSv1SetIPAllocations    = "ReplicatorSv1.SetIPAllocations"
	ReplicatorSv1SetIPProfile        = "ReplicatorSv1.SetIPProfile"
	ReplicatorSv1SetRouteProfile     = "ReplicatorSv1.SetRouteProfile"
	ReplicatorSv1SetAttributeProfile = "ReplicatorSv1.SetAttributeProfile"
	ReplicatorSv1SetChargerProfile   = "ReplicatorSv1.SetChargerProfile"
	ReplicatorSv1SetRateProfile      = "ReplicatorSv1.SetRateProfile"
	ReplicatorSv1SetActionProfile    = "ReplicatorSv1.SetActionProfile"
	ReplicatorSv1SetAccount          = "ReplicatorSv1.SetAccount"
	ReplicatorSv1SetLoadIDs          = "ReplicatorSv1.SetLoadIDs"
	ReplicatorSv1RemoveThreshold     = "ReplicatorSv1.RemoveThreshold"

	ReplicatorSv1RemoveStatQueue        = "ReplicatorSv1.RemoveStatQueue"
	ReplicatorSv1RemoveFilter           = "ReplicatorSv1.RemoveFilter"
	ReplicatorSv1RemoveThresholdProfile = "ReplicatorSv1.RemoveThresholdProfile"
	ReplicatorSv1RemoveStatQueueProfile = "ReplicatorSv1.RemoveStatQueueProfile"
	ReplicatorSv1RemoveRankingProfile   = "ReplicatorSv1.RemoveRankingProfile"
	ReplicatorSv1RemoveRanking          = "ReplicatorSv1.RemoveRanking"
	ReplicatorSv1RemoveTrendProfile     = "ReplicatorSv1.RemoveTrendProfile"
	ReplicatorSv1RemoveTrend            = "ReplicatorSv1.RemoveTrend"
	ReplicatorSv1RemoveResource         = "ReplicatorSv1.RemoveResource"
	ReplicatorSv1RemoveResourceProfile  = "ReplicatorSv1.RemoveResourceProfile"
	ReplicatorSv1RemoveIPAllocations    = "ReplicatorSv1.RemoveIPAllocations"
	ReplicatorSv1RemoveIPProfile        = "ReplicatorSv1.RemoveIPProfile"
	ReplicatorSv1RemoveRouteProfile     = "ReplicatorSv1.RemoveRouteProfile"
	ReplicatorSv1RemoveAttributeProfile = "ReplicatorSv1.RemoveAttributeProfile"
	ReplicatorSv1RemoveChargerProfile   = "ReplicatorSv1.RemoveChargerProfile"
	ReplicatorSv1RemoveRateProfile      = "ReplicatorSv1.RemoveRateProfile"
	ReplicatorSv1RemoveActionProfile    = "ReplicatorSv1.RemoveActionProfile"
	ReplicatorSv1RemoveAccount          = "ReplicatorSv1.RemoveAccount"
	ReplicatorSv1GetIndexes             = "ReplicatorSv1.GetIndexes"
	ReplicatorSv1SetIndexes             = "ReplicatorSv1.SetIndexes"
	ReplicatorSv1RemoveIndexes          = "ReplicatorSv1.RemoveIndexes"
)

ReplicatorSv1 APIs

View Source
const (
	//AdminSv1ReplayFailedPosts                 = "AdminSv1.ReplayFailedPosts"
	AdminSv1GetRateRatesIndexesHealth         = "AdminSv1.GetRateRatesIndexesHealth"
	AdminSv1GetChargerProfilesCount           = "AdminSv1.GetChargerProfilesCount"
	AdminSv1GetAccountsIndexesHealth          = "AdminSv1.GetAccountsIndexesHealth"
	AdminSv1GetDispatcherProfilesCount        = "AdminSv1.GetDispatcherProfilesCount"
	AdminSv1GetRouteProfilesCount             = "AdminSv1.GetRouteProfilesCount"
	AdminSv1GetActionsIndexesHealth           = "AdminSv1.GetActionsIndexesHealth"
	AdminSv1GetDispatcherHostsCount           = "AdminSv1.GetDispatcherHostsCount"
	AdminSv1GetRateProfilesIndexesHealth      = "AdminSv1.GetRateProfilesIndexesHealth"
	AdminSv1ComputeFilterIndexes              = "AdminSv1.ComputeFilterIndexes"
	AdminSv1ComputeFilterIndexIDs             = "AdminSv1.ComputeFilterIndexIDs"
	AdminSv1GetAccountActionPlansIndexHealth  = "AdminSv1.GetAccountActionPlansIndexHealth"
	AdminSv1GetReverseDestinationsIndexHealth = "AdminSv1.GetReverseDestinationsIndexHealth"
	AdminSv1GetReverseFilterHealth            = "AdminSv1.GetReverseFilterHealth"
	AdminSv1GetThresholdsIndexesHealth        = "AdminSv1.GetThresholdsIndexesHealth"
	AdminSv1GetResourcesIndexesHealth         = "AdminSv1.GetResourcesIndexesHealth"
	AdminSv1GetIPsIndexesHealth               = "AdminSv1.GetIPsIndexesHealth"
	AdminSv1GetStatsIndexesHealth             = "AdminSv1.GetStatsIndexesHealth"
	AdminSv1GetRoutesIndexesHealth            = "AdminSv1.GetRoutesIndexesHealth"
	AdminSv1GetChargersIndexesHealth          = "AdminSv1.GetChargersIndexesHealth"
	AdminSv1GetAttributesIndexesHealth        = "AdminSv1.GetAttributesIndexesHealth"
	AdminSv1GetDispatchersIndexesHealth       = "AdminSv1.GetDispatchersIndexesHealth"
	AdminSv1Ping                              = "AdminSv1.Ping"
	AdminSv1SetDispatcherProfile              = "AdminSv1.SetDispatcherProfile"
	AdminSv1GetDispatcherProfile              = "AdminSv1.GetDispatcherProfile"
	AdminSv1GetDispatcherProfiles             = "AdminSv1.GetDispatcherProfiles"
	AdminSv1GetDispatcherProfileIDs           = "AdminSv1.GetDispatcherProfileIDs"
	AdminSv1RemoveDispatcherProfile           = "AdminSv1.RemoveDispatcherProfile"
	// APIerSv1SetBalances                       = "APIerSv1.SetBalances"
	AdminSv1SetDispatcherHost    = "AdminSv1.SetDispatcherHost"
	AdminSv1GetDispatcherHost    = "AdminSv1.GetDispatcherHost"
	AdminSv1GetDispatcherHosts   = "AdminSv1.GetDispatcherHosts"
	AdminSv1GetDispatcherHostIDs = "AdminSv1.GetDispatcherHostIDs"
	AdminSv1RemoveDispatcherHost = "AdminSv1.RemoveDispatcherHost"
	// APIerSv1GetEventCost                      = "APIerSv1.GetEventCost"
	// APIerSv1LoadTariffPlanFromFolder          = "APIerSv1.LoadTariffPlanFromFolder"
	// APIerSv1ExportToFolder                    = "APIerSv1.ExportToFolder"
	// APIerSv1GetCost                           = "APIerSv1.GetCost"
	AdminSv1GetFilter           = "AdminSv1.GetFilter"
	AdminSv1GetFilterIndexes    = "AdminSv1.GetFilterIndexes"
	AdminSv1RemoveFilterIndexes = "AdminSv1.RemoveFilterIndexes"
	AdminSv1RemoveFilter        = "AdminSv1.RemoveFilter"
	AdminSv1SetFilter           = "AdminSv1.SetFilter"
	AdminSv1GetFilterIDs        = "AdminSv1.GetFilterIDs"
	AdminSv1GetFiltersCount     = "AdminSv1.GetFiltersCount"
	AdminSv1GetFilters          = "AdminSv1.GetFilters"
	AdminSv1FiltersMatch        = "AdminSv1.FiltersMatch"

	// APIerSv1GetDataCost              = "APIerSv1.GetDataCost"
	// APIerSv1ReplayFailedPosts        = "APIerSv1.ReplayFailedPosts"
	// APIerSv1GetCacheStats            = "APIerSv1.GetCacheStats"
	// APIerSv1ReloadCache              = "APIerSv1.ReloadCache"
	// APIerSv1RemoveActions            = "APIerSv1.RemoveActions"
	// APIerSv1GetLoadHistory           = "APIerSv1.GetLoadHistory"
	// APIerSv1GetLoadIDs               = "APIerSv1.GetLoadIDs"
	// APIerSv1GetLoadTimes             = "APIerSv1.GetLoadTimes"
	AdminSv1GetAttributeProfilesCount = "AdminSv1.GetAttributeProfilesCount"
	AdminSv1SetAccount                = "AdminSv1.SetAccount"
	AdminSv1GetAccount                = "AdminSv1.GetAccount"
	AdminSv1GetAccounts               = "AdminSv1.GetAccounts"
	AdminSv1GetAccountIDs             = "AdminSv1.GetAccountIDs"
	AdminSv1RemoveAccount             = "AdminSv1.RemoveAccount"
	AdminSv1GetAccountsCount          = "AdminSv1.GetAccountsCount"
	AdminSv1GetCDRs                   = "AdminSv1.GetCDRs"
	AdminSv1RemoveCDRs                = "AdminSv1.RemoveCDRs"
)

AdminSv1 APIs

View Source
const (
	ServiceManagerV1              = "ServiceManagerV1"
	ServiceManagerV1StartService  = "ServiceManagerV1.StartService"
	ServiceManagerV1StopService   = "ServiceManagerV1.StopService"
	ServiceManagerV1ServiceStatus = "ServiceManagerV1.ServiceStatus"
	ServiceManagerV1Ping          = "ServiceManagerV1.Ping"
)
View Source
const (
	TPeSv1                 = "TPeSv1"
	TPeSv1Ping             = "TPeSv1.Ping"
	TPeSv1ExportTariffPlan = "TPeSv1.ExportTariffPlan"
)

TPeSv1 APIs

View Source
const (
	EfSv1             = "EfSv1"
	EfSv1Ping         = "EfSv1.Ping"
	EfSv1ProcessEvent = "EfSv1.ProcessEvent"
	EfSv1ReplayEvents = "EfSv1.ReplayEvents"
)

EfSv1 APIs

View Source
const (
	ErS            = "ErS"
	ErSv1          = "ErSv1"
	ErSv1Ping      = "ErSv1.Ping"
	ErSv1RunReader = "ErSv1.RunReader"
)

ERs

View Source
const (
	ConfigS                    = "ConfigS"
	ConfigSv1                  = "ConfigSv1"
	ConfigSv1ReloadConfig      = "ConfigSv1.ReloadConfig"
	ConfigSv1GetConfig         = "ConfigSv1.GetConfig"
	ConfigSv1SetConfig         = "ConfigSv1.SetConfig"
	ConfigSv1GetConfigAsJSON   = "ConfigSv1.GetConfigAsJSON"
	ConfigSv1SetConfigFromJSON = "ConfigSv1.SetConfigFromJSON"
	ConfigSv1StoreCfgInDB      = "ConfigSv1.StoreCfgInDB"
	ConfigSv1Ping              = "ConfigSv1.Ping"
)

ConfigSv1 APIs

View Source
const (
	RateSv1                         = "RateSv1"
	RateSv1CostForEvent             = "RateSv1.CostForEvent"
	RateSv1RateProfilesForEvent     = "RateSv1.RateProfilesForEvent"
	RateSv1RateProfileRatesForEvent = "RateSv1.RateProfileRatesForEvent"
	RateSv1Ping                     = "RateSv1.Ping"
)
View Source
const (
	AccountSv1                    = "AccountSv1"
	AccountSv1Ping                = "AccountSv1.Ping"
	AccountSv1AccountsForEvent    = "AccountSv1.AccountsForEvent"
	AccountSv1MaxAbstracts        = "AccountSv1.MaxAbstracts"
	AccountSv1DebitAbstracts      = "AccountSv1.DebitAbstracts"
	AccountSv1MaxConcretes        = "AccountSv1.MaxConcretes"
	AccountSv1DebitConcretes      = "AccountSv1.DebitConcretes"
	AccountSv1RefundCharges       = "AccountSv1.RefundCharges"
	AccountSv1ActionSetBalance    = "AccountSv1.ActionSetBalance"
	AccountSv1ActionRemoveBalance = "AccountSv1.ActionRemoveBalance"
	AccountSv1GetAccount          = "AccountSv1.GetAccount"
)
View Source
const (
	CoreS                       = "CoreS"
	CoreSv1                     = "CoreSv1"
	CoreSv1Status               = "CoreSv1.Status"
	CoreSv1Ping                 = "CoreSv1.Ping"
	CoreSv1Panic                = "CoreSv1.Panic"
	CoreSv1Shutdown             = "CoreSv1.Shutdown"
	CoreSv1Sleep                = "CoreSv1.Sleep"
	CoreSv1StartCPUProfiling    = "CoreSv1.StartCPUProfiling"
	CoreSv1StopCPUProfiling     = "CoreSv1.StopCPUProfiling"
	CoreSv1StartMemoryProfiling = "CoreSv1.StartMemoryProfiling"
	CoreSv1StopMemoryProfiling  = "CoreSv1.StopMemoryProfiling"
)
View Source
const (
	RouteSv1GetRoutes                = "RouteSv1.GetRoutes"
	RouteSv1GetRoutesList            = "RouteSv1.GetRoutesList"
	RouteSv1GetRouteProfilesForEvent = "RouteSv1.GetRouteProfilesForEvent"
	RouteSv1Ping                     = "RouteSv1.Ping"
	AdminSv1GetRouteProfile          = "AdminSv1.GetRouteProfile"
	AdminSv1GetRouteProfiles         = "AdminSv1.GetRouteProfiles"
	AdminSv1GetRouteProfileIDs       = "AdminSv1.GetRouteProfileIDs"
	AdminSv1RemoveRouteProfile       = "AdminSv1.RemoveRouteProfile"
	AdminSv1SetRouteProfile          = "AdminSv1.SetRouteProfile"
)

RouteS APIs

View Source
const (
	AdminSv1SetAttributeProfile      = "AdminSv1.SetAttributeProfile"
	AdminSv1GetAttributeProfile      = "AdminSv1.GetAttributeProfile"
	AdminSv1GetAttributeProfiles     = "AdminSv1.GetAttributeProfiles"
	AdminSv1GetAttributeProfileIDs   = "AdminSv1.GetAttributeProfileIDs"
	AdminSv1RemoveAttributeProfile   = "AdminSv1.RemoveAttributeProfile"
	AttributeSv1GetAttributeForEvent = "AttributeSv1.GetAttributeForEvent"
	AttributeSv1ProcessEvent         = "AttributeSv1.ProcessEvent"
	AttributeSv1Ping                 = "AttributeSv1.Ping"
)

AttributeS APIs

View Source
const (
	ChargerSv1Ping                = "ChargerSv1.Ping"
	ChargerSv1GetChargersForEvent = "ChargerSv1.GetChargersForEvent"
	ChargerSv1ProcessEvent        = "ChargerSv1.ProcessEvent"
	AdminSv1GetChargerProfile     = "AdminSv1.GetChargerProfile"
	AdminSv1GetChargerProfiles    = "AdminSv1.GetChargerProfiles"
	AdminSv1RemoveChargerProfile  = "AdminSv1.RemoveChargerProfile"
	AdminSv1SetChargerProfile     = "AdminSv1.SetChargerProfile"
	AdminSv1GetChargerProfileIDs  = "AdminSv1.GetChargerProfileIDs"
)

ChargerS APIs

View Source
const (
	ThresholdSv1ProcessEvent          = "ThresholdSv1.ProcessEvent"
	ThresholdSv1GetThreshold          = "ThresholdSv1.GetThreshold"
	ThresholdSv1ResetThreshold        = "ThresholdSv1.ResetThreshold"
	ThresholdSv1GetThresholdIDs       = "ThresholdSv1.GetThresholdIDs"
	ThresholdSv1Ping                  = "ThresholdSv1.Ping"
	ThresholdSv1GetThresholdsForEvent = "ThresholdSv1.GetThresholdsForEvent"
	AdminSv1GetThresholdProfileIDs    = "AdminSv1.GetThresholdProfileIDs"
	AdminSv1GetThresholdProfilesCount = "AdminSv1.GetThresholdProfilesCount"
	AdminSv1GetThresholdProfile       = "AdminSv1.GetThresholdProfile"
	AdminSv1GetThresholdProfiles      = "AdminSv1.GetThresholdProfiles"
	AdminSv1RemoveThresholdProfile    = "AdminSv1.RemoveThresholdProfile"
	AdminSv1SetThresholdProfile       = "AdminSv1.SetThresholdProfile"
)

ThresholdS APIs

View Source
const (
	StatSv1ProcessEvent               = "StatSv1.ProcessEvent"
	StatSv1GetQueueIDs                = "StatSv1.GetQueueIDs"
	StatSv1GetQueueStringMetrics      = "StatSv1.GetQueueStringMetrics"
	StatSv1GetQueueFloatMetrics       = "StatSv1.GetQueueFloatMetrics"
	StatSv1GetQueueDecimalMetrics     = "StatSv1.GetQueueDecimalMetrics"
	StatSv1Ping                       = "StatSv1.Ping"
	StatSv1GetStatQueuesForEvent      = "StatSv1.GetStatQueuesForEvent"
	StatSv1GetStatQueue               = "StatSv1.GetStatQueue"
	StatSv1ResetStatQueue             = "StatSv1.ResetStatQueue"
	AdminSv1GetStatQueueProfile       = "AdminSv1.GetStatQueueProfile"
	AdminSv1RemoveStatQueueProfile    = "AdminSv1.RemoveStatQueueProfile"
	AdminSv1SetStatQueueProfile       = "AdminSv1.SetStatQueueProfile"
	AdminSv1GetStatQueueProfiles      = "AdminSv1.GetStatQueueProfiles"
	AdminSv1GetStatQueueProfileIDs    = "AdminSv1.GetStatQueueProfileIDs"
	AdminSv1GetStatQueueProfilesCount = "AdminSv1.GetStatQueueProfilesCount"
)

StatS APIs

View Source
const (
	AdminSv1GetRankingProfile       = "AdminSv1.GetRankingProfile"
	AdminSv1RemoveRankingProfile    = "AdminSv1.RemoveRankingProfile"
	AdminSv1SetRankingProfile       = "AdminSv1.SetRankingProfile"
	AdminSv1GetRankingProfiles      = "AdminSv1.GetRankingProfiles"
	AdminSv1GetRankingProfileIDs    = "AdminSv1.GetRankingProfileIDs"
	AdminSv1GetRankingProfilesCount = "AdminSv1.GetRankingProfilesCount"
	RankingSv1Ping                  = "RankingSv1.Ping"
	RankingSv1GetRanking            = "RankingSv1.GetRanking"
	RankingSv1GetSchedule           = "RankingSv1.GetSchedule"
	RankingSv1ScheduleQueries       = "RankingSv1.ScheduleQueries"
	RankingSv1GetRankingSummary     = "RankingSv1.GetRankingSummary"
)

RankingS APIs

View Source
const (
	AdminSv1GetTrendProfile       = "AdminSv1.GetTrendProfile"
	AdminSv1RemoveTrendProfile    = "AdminSv1.RemoveTrendProfile"
	AdminSv1SetTrendProfile       = "AdminSv1.SetTrendProfile"
	AdminSv1GetTrendProfiles      = "AdminSv1.GetTrendProfiles"
	AdminSv1GetTrendProfileIDs    = "AdminSv1.GetTrendProfileIDs"
	AdminSv1GetTrendProfilesCount = "AdminSv1.GetTrendProfilesCount"
	TrendSv1Ping                  = "TrendSv1.Ping"
	TrendSv1ScheduleQueries       = "TrendSv1.ScheduleQueries"
	TrendSv1GetTrend              = "TrendSv1.GetTrend"
	TrendSv1GetScheduledTrends    = "TrendSv1.GetScheduledTrends"
	TrendSv1GetTrendSummary       = "TrendSv1.GetTrendSummary"
)

TrendS APIs

View Source
const (
	ResourceSv1Ping                  = "ResourceSv1.Ping"
	ResourceSv1GetResource           = "ResourceSv1.GetResource"
	ResourceSv1GetResourceWithConfig = "ResourceSv1.GetResourceWithConfig"
	ResourceSv1GetResourcesForEvent  = "ResourceSv1.GetResourcesForEvent"
	ResourceSv1AuthorizeResources    = "ResourceSv1.AuthorizeResources"
	ResourceSv1AllocateResources     = "ResourceSv1.AllocateResources"
	ResourceSv1ReleaseResources      = "ResourceSv1.ReleaseResources"
	AdminSv1SetResourceProfile       = "AdminSv1.SetResourceProfile"
	AdminSv1GetResourceProfiles      = "AdminSv1.GetResourceProfiles"
	AdminSv1RemoveResourceProfile    = "AdminSv1.RemoveResourceProfile"
	AdminSv1GetResourceProfile       = "AdminSv1.GetResourceProfile"
	AdminSv1GetResourceProfileIDs    = "AdminSv1.GetResourceProfileIDs"
	AdminSv1GetResourceProfilesCount = "AdminSv1.GetResourceProfilesCount"
)

ResourceS APIs

View Source
const (
	IPsV1Ping                     = "IPsV1.Ping"
	IPsV1GetIPAllocations         = "IPsV1.GetIPAllocations"
	IPsV1GetIPAllocationsForEvent = "IPsV1.GetIPAllocationsForEvent"
	IPsV1AuthorizeIP              = "IPsV1.AuthorizeIP"
	IPsV1AllocateIP               = "IPsV1.AllocateIP"
	IPsV1ReleaseIP                = "IPsV1.ReleaseIP"
	AdminSv1SetIPProfile          = "AdminSv1.SetIPProfile"
	AdminSv1GetIPProfiles         = "AdminSv1.GetIPProfiles"
	AdminSv1RemoveIPProfile       = "AdminSv1.RemoveIPProfile"
	AdminSv1GetIPProfile          = "AdminSv1.GetIPProfile"
	AdminSv1GetIPProfileIDs       = "AdminSv1.GetIPProfileIDs"
	AdminSv1GetIPProfilesCount    = "AdminSv1.GetIPProfilesCount"
)

IPs APIs

View Source
const (
	SessionSv1AuthorizeEvent             = "SessionSv1.AuthorizeEvent"
	SessionSv1AuthorizeEventWithDigest   = "SessionSv1.AuthorizeEventWithDigest"
	SessionSv1InitiateSession            = "SessionSv1.InitiateSession"
	SessionSv1InitiateSessionWithDigest  = "SessionSv1.InitiateSessionWithDigest"
	SessionSv1UpdateSession              = "SessionSv1.UpdateSession"
	SessionSv1SyncSessions               = "SessionSv1.SyncSessions"
	SessionSv1TerminateSession           = "SessionSv1.TerminateSession"
	SessionSv1ProcessCDR                 = "SessionSv1.ProcessCDR"
	SessionSv1ProcessMessage             = "SessionSv1.ProcessMessage"
	SessionSv1ProcessEvent               = "SessionSv1.ProcessEvent"
	SessionSv1GetCost                    = "SessionSv1.GetCost"
	SessionSv1DisconnectSession          = "SessionSv1.DisconnectSession"
	SessionSv1GetActiveSessions          = "SessionSv1.GetActiveSessions"
	SessionSv1GetActiveSessionsCount     = "SessionSv1.GetActiveSessionsCount"
	SessionSv1ForceDisconnect            = "SessionSv1.ForceDisconnect"
	SessionSv1GetPassiveSessions         = "SessionSv1.GetPassiveSessions"
	SessionSv1GetPassiveSessionsCount    = "SessionSv1.GetPassiveSessionsCount"
	SessionSv1SetPassiveSession          = "SessionSv1.SetPassiveSession"
	SessionSv1Ping                       = "SessionSv1.Ping"
	SessionSv1GetActiveSessionIDs        = "SessionSv1.GetActiveSessionIDs"
	SessionSv1RegisterInternalBiJSONConn = "SessionSv1.RegisterInternalBiJSONConn"
	SessionSv1ReplicateSessions          = "SessionSv1.ReplicateSessions"
	SessionSv1ActivateSessions           = "SessionSv1.ActivateSessions"
	SessionSv1DeactivateSessions         = "SessionSv1.DeactivateSessions"
	SessionSv1ReAuthorize                = "SessionSv1.ReAuthorize"
	SessionSv1DisconnectPeer             = "SessionSv1.DisconnectPeer"
	SessionSv1WarnDisconnect             = "SessionSv1.WarnDisconnect"
	SessionSv1STIRAuthenticate           = "SessionSv1.STIRAuthenticate"
	SessionSv1STIRIdentity               = "SessionSv1.STIRIdentity"
	SessionSv1Sleep                      = "SessionSv1.Sleep"
)

SessionS APIs

View Source
const (
	DispatcherSv1                    = "DispatcherSv1"
	DispatcherSv1Ping                = "DispatcherSv1.Ping"
	DispatcherSv1GetProfilesForEvent = "DispatcherSv1.GetProfilesForEvent"
	DispatcherServicePing            = "DispatcherService.Ping"
	DispatcherSv1RemoteStatus        = "DispatcherSv1.RemoteStatus"
	DispatcherSv1RemoteSleep         = "DispatcherSv1.RemoteSleep"
	DispatcherSv1RemotePing          = "DispatcherSv1.RemotePing"
)

DispatcherS APIs

View Source
const (
	RegistrarSv1RegisterDispatcherHosts   = "RegistrarSv1.RegisterDispatcherHosts"
	RegistrarSv1UnregisterDispatcherHosts = "RegistrarSv1.UnregisterDispatcherHosts"

	RegistrarSv1RegisterRPCHosts   = "RegistrarSv1.RegisterRPCHosts"
	RegistrarSv1UnregisterRPCHosts = "RegistrarSv1.UnregisterRPCHosts"
)

RegistrarS APIs

View Source
const (
	AdminSv1SetRateProfile           = "AdminSv1.SetRateProfile"
	AdminSv1GetRateProfile           = "AdminSv1.GetRateProfile"
	AdminSv1GetRateProfiles          = "AdminSv1.GetRateProfiles"
	AdminSv1GetRateProfileRates      = "AdminSv1.GetRateProfileRates"
	AdminSv1GetRateProfileIDs        = "AdminSv1.GetRateProfileIDs"
	AdminSv1GetRateProfilesCount     = "AdminSv1.GetRateProfilesCount"
	AdminSv1GetRateProfileRatesCount = "AdminSv1.GetRateProfileRatesCount"
	AdminSv1GetRateProfileRateIDs    = "AdminSv1.GetRateProfileRateIDs"
	AdminSv1SetRateProfileRates      = "AdminSv1.SetRateProfileRates"
	AdminSv1RemoveRateProfile        = "AdminSv1.RemoveRateProfile"
	AdminSv1RemoveRateProfileRates   = "AdminSv1.RemoveRateProfileRates"
)

RateProfile APIs

View Source
const (
	AnalyzerSv1            = "AnalyzerSv1"
	AnalyzerSv1Ping        = "AnalyzerSv1.Ping"
	AnalyzerSv1StringQuery = "AnalyzerSv1.StringQuery"
)

AnalyzerS APIs

View Source
const (
	LoaderSv1          = "LoaderSv1"
	LoaderSv1Run       = "LoaderSv1.Run"
	LoaderSv1Ping      = "LoaderSv1.Ping"
	LoaderSv1ImportZip = "LoaderSv1.ImportZip"
)

LoaderS APIs

View Source
const (
	CacheSv1                  = "CacheSv1"
	CacheSv1GetCacheStats     = "CacheSv1.GetCacheStats"
	CacheSv1GetItemIDs        = "CacheSv1.GetItemIDs"
	CacheSv1HasItem           = "CacheSv1.HasItem"
	CacheSv1GetItem           = "CacheSv1.GetItem"
	CacheSv1GetItemWithRemote = "CacheSv1.GetItemWithRemote"
	CacheSv1GetItemExpiryTime = "CacheSv1.GetItemExpiryTime"
	CacheSv1RemoveItem        = "CacheSv1.RemoveItem"
	CacheSv1RemoveItems       = "CacheSv1.RemoveItems"
	CacheSv1PrecacheStatus    = "CacheSv1.PrecacheStatus"
	CacheSv1HasGroup          = "CacheSv1.HasGroup"
	CacheSv1GetGroupItemIDs   = "CacheSv1.GetGroupItemIDs"
	CacheSv1RemoveGroup       = "CacheSv1.RemoveGroup"
	CacheSv1Clear             = "CacheSv1.Clear"
	CacheSv1ReloadCache       = "CacheSv1.ReloadCache"
	CacheSv1LoadCache         = "CacheSv1.LoadCache"
	CacheSv1Ping              = "CacheSv1.Ping"
	CacheSv1ReplicateSet      = "CacheSv1.ReplicateSet"
	CacheSv1ReplicateRemove   = "CacheSv1.ReplicateRemove"
)

CacheS APIs

View Source
const (
	GuardianSv1             = "GuardianSv1"
	GuardianSv1RemoteLock   = "GuardianSv1.RemoteLock"
	GuardianSv1RemoteUnlock = "GuardianSv1.RemoteUnlock"
	GuardianSv1Ping         = "GuardianSv1.Ping"
)

GuardianS APIs

View Source
const (
	CDRsV1                    = "CDRsV1"
	CDRsV1GetCDRsCount        = "CDRsV1.GetCDRsCount"
	CDRsV1RateCDRs            = "CDRsV1.RateCDRs"
	CDRsV1GetCDRs             = "CDRsV1.GetCDRs"
	CDRsV1ProcessCDR          = "CDRsV1.ProcessCDR"
	CDRsV1ProcessExternalCDR  = "CDRsV1.ProcessExternalCDR"
	CDRsV1StoreSessionCost    = "CDRsV1.StoreSessionCost"
	CDRsV1ProcessEvent        = "CDRsV1.ProcessEvent"
	CDRsV1ProcessEventWithGet = "CDRsV1.ProcessEventWithGet"
	CDRsV1ProcessStoredEvents = "CDRsV1.ProcessStoredEvents"
	CDRsV1Ping                = "CDRsV1.Ping"
	CDRsV2                    = "CDRsV2"
	CDRsV2StoreSessionCost    = "CDRsV2.StoreSessionCost"
	CDRsV2ProcessEvent        = "CDRsV2.ProcessEvent"
)

Cdrs APIs

View Source
const (
	EeS                       = "EeS"
	EeSv1                     = "EeSv1"
	EeSv1Ping                 = "EeSv1.Ping"
	EeSv1ProcessEvent         = "EeSv1.ProcessEvent"
	EeSv1ArchiveEventsInReply = "EeSv1.ArchiveEventsInReply"
)

EEs

View Source
const (
	AdminSv1SetActionProfile       = "AdminSv1.SetActionProfile"
	AdminSv1GetActionProfile       = "AdminSv1.GetActionProfile"
	AdminSv1GetActionProfiles      = "AdminSv1.GetActionProfiles"
	AdminSv1GetActionProfileIDs    = "AdminSv1.GetActionProfileIDs"
	AdminSv1GetActionProfilesCount = "AdminSv1.GetActionProfilesCount"
	AdminSv1RemoveActionProfile    = "AdminSv1.RemoveActionProfile"
)

ActionProfile APIs

View Source
const (
	AdminS   = "AdminS"
	AdminSv1 = "AdminSv1"
)

AdminSv1

View Source
const (
	CGRAccount         = "cgr_account"
	CGRRoute           = "cgr_route"
	CGRDestination     = "cgr_destination"
	CGRSubject         = "cgr_subject"
	CGRCategory        = "cgr_category"
	CGRReqType         = "cgr_reqtype"
	CGRTenant          = "cgr_tenant"
	CGRPdd             = "cgr_pdd"
	CGRDisconnectCause = "cgr_disconnectcause"
	CGRComputeLCR      = "cgr_computelcr"
	CGRRoutes          = "cgr_routes"
	CGRFlags           = "cgr_flags"
	CGROpts            = "cgr_opts"
)

cgr_ variables

View Source
const (
	ResourcesCsv  = "Resources.csv"
	IPsCsv        = "IPs.csv"
	StatsCsv      = "Stats.csv"
	RankingsCsv   = "Rankings.csv"
	TrendsCsv     = "Trends.csv"
	ThresholdsCsv = "Thresholds.csv"
	FiltersCsv    = "Filters.csv"
	RoutesCsv     = "Routes.csv"
	AttributesCsv = "Attributes.csv"
	ChargersCsv   = "Chargers.csv"
	RatesCsv      = "Rates.csv"
	ActionsCsv    = "Actions.csv"
	AccountsCsv   = "Accounts.csv"
)

CSV file name

View Source
const (
	TBLTPResources       = "tp_resources"
	TBLTPStats           = "tp_stats"
	TBLTPRankings        = "tp_rankings"
	TBLTPTrends          = "tp_trends"
	TBLTPThresholds      = "tp_thresholds"
	TBLTPFilters         = "tp_filters"
	SessionCostsTBL      = "session_costs"
	CDRsTBL              = "cdrs"
	TBLTPRoutes          = "tp_routes"
	TBLTPAttributes      = "tp_attributes"
	TBLTPChargers        = "tp_chargers"
	TBLVersions          = "versions"
	OldSMCosts           = "sm_costs"
	TBLTPDispatchers     = "tp_dispatcher_profiles"
	TBLTPDispatcherHosts = "tp_dispatcher_hosts"
	TBLTPRateProfiles    = "tp_rate_profiles"
	TBLTPActionProfiles  = "tp_action_profiles"
	TBLTPAccounts        = "tp_accounts"
)

Table Name

View Source
const (
	CacheConfig                      = "*config"
	CacheResources                   = "*resources"
	CacheResourceProfiles            = "*resource_profiles"
	CacheEventResources              = "*event_resources"
	CacheIPAllocations               = "*ip_allocations"
	CacheIPProfiles                  = "*ip_profiles"
	CacheEventIPs                    = "*event_ips"
	CacheStatQueueProfiles           = "*statqueue_profiles"
	CacheStatQueues                  = "*statqueues"
	CacheRankingProfiles             = "*ranking_profiles"
	CacheRankings                    = "*rankings"
	CacheTrendProfiles               = "*trend_profiles"
	CacheTrends                      = "*trends"
	CacheThresholdProfiles           = "*threshold_profiles"
	CacheThresholds                  = "*thresholds"
	CacheFilters                     = "*filters"
	CacheRouteProfiles               = "*route_profiles"
	CacheAttributeProfiles           = "*attribute_profiles"
	CacheChargerProfiles             = "*charger_profiles"
	CacheRateProfiles                = "*rate_profiles"
	CacheActionProfiles              = "*action_profiles"
	CacheAccounts                    = "*accounts"
	CacheResourceFilterIndexes       = "*resource_filter_indexes"
	CacheIPFilterIndexes             = "*ip_filter_indexes"
	CacheStatFilterIndexes           = "*stat_filter_indexes"
	CacheThresholdFilterIndexes      = "*threshold_filter_indexes"
	CacheRouteFilterIndexes          = "*route_filter_indexes"
	CacheAttributeFilterIndexes      = "*attribute_filter_indexes"
	CacheChargerFilterIndexes        = "*charger_filter_indexes"
	CacheDiameterMessages            = "*diameter_messages"
	CacheRPCResponses                = "*rpc_responses"
	CacheClosedSessions              = "*closed_sessions"
	CacheRateProfilesFilterIndexes   = "*rate_profile_filter_indexes"
	CacheActionProfilesFilterIndexes = "*action_profile_filter_indexes"
	CacheAccountsFilterIndexes       = "*account_filter_indexes"
	CacheRateFilterIndexes           = "*rate_filter_indexes"
	MetaPrecaching                   = "*precaching"
	MetaReady                        = "*ready"
	CacheLoadIDs                     = "*load_ids"
	CacheRPCConnections              = "*rpc_connections"
	CacheCDRIDs                      = "*cdr_ids"
	CacheUCH                         = "*uch"
	CacheSTIR                        = "*stir"
	CacheEventCharges                = "*event_charges"
	CacheReverseFilterIndexes        = "*reverse_filter_indexes"
	CacheVersions                    = "*versions"
	CacheCapsEvents                  = "*caps_events"
	CacheReplicationHosts            = "*replication_hosts"
	// storDB
	CacheCDRsTBL = "*cdrs"
)

Cache Name

View Source
const (
	ResourceFilterIndexes         = "rfi_"
	IPFilterIndexes               = "ifi_"
	StatFilterIndexes             = "sfi_"
	ThresholdFilterIndexes        = "tfi_"
	AttributeFilterIndexes        = "afi_"
	ChargerFilterIndexes          = "cfi_"
	DispatcherFilterIndexes       = "dfi_"
	ActionPlanIndexes             = "api_"
	RouteFilterIndexes            = "rti_"
	RateProfilesFilterIndexPrfx   = "rpi_"
	RateFilterIndexPrfx           = "rri_"
	RankingPrefix                 = "rnk_"
	ActionProfilesFilterIndexPrfx = "aci_"
	AccountFilterIndexPrfx        = "ani_"
	FilterIndexPrfx               = "fii_"
)

Prefix for indexing

View Source
const (
	KamailioAgent   = "KamailioAgent"
	RadiusAgent     = "RadiusAgent"
	DiameterAgent   = "DiameterAgent"
	FreeSWITCHAgent = "FreeSWITCHAgent"
	AsteriskAgent   = "AsteriskAgent"
	HTTPAgent       = "HTTPAgent"
	SIPAgent        = "SIPAgent"
	JanusAgent      = "JanusAgent"
	PrometheusAgent = "PrometheusAgent"
)

Agents

View Source
const (
	MetaGoogleAPI             = "*gapi"
	GoogleCredentialsFileName = "credentials.json"
)

Google_API

View Source
const (
	NodeIDCfg               = "node_id"
	LoggerCfg               = "logger"
	LogLevelCfg             = "log_level"
	RoundingDecimalsCfg     = "rounding_decimals"
	DBDataEncodingCfg       = "dbdata_encoding"
	TpExportPathCfg         = "tpexport_dir"
	PosterAttemptsCfg       = "poster_attempts"
	FailedPostsDirCfg       = "failed_posts_dir"
	FailedPostsTTLCfg       = "failed_posts_ttl"
	DefaultReqTypeCfg       = "default_request_type"
	DefaultCategoryCfg      = "default_category"
	DefaultTenantCfg        = "default_tenant"
	DefaultTimezoneCfg      = "default_timezone"
	DefaultCachingCfg       = "default_caching"
	CachingDlayCfg          = "caching_delay"
	ConnectAttemptsCfg      = "connect_attempts"
	ReconnectsCfg           = "reconnects"
	MaxReconnectIntervalCfg = "max_reconnect_interval"
	ConnectTimeoutCfg       = "connect_timeout"
	ReplyTimeoutCfg         = "reply_timeout"
	LockingTimeoutCfg       = "locking_timeout"
	DigestSeparatorCfg      = "digest_separator"
	DigestEqualCfg          = "digest_equal"
	MaxParallelConnsCfg     = "max_parallel_conns"
	EEsConnsCfg             = "ees_conns"
	DecimalMaxScaleCfg      = "decimal_max_scale"
	DecimalMinScaleCfg      = "decimal_min_scale"
	DecimalPrecisionCfg     = "decimal_precision"
	DecimalRoundingModeCfg  = "decimal_rounding_mode"
)

GeneralCfg

View Source
const (
	LevelCfg         = "level"
	KafkaConnCfg     = "kafka_conn"
	KafkaTopicCfg    = "kafka_topic"
	KafkaAttemptsCfg = "kafka_attempts"
)
View Source
const (
	TypeCfg                   = "type"
	SQLMaxOpenConnsCfg        = "sqlMaxOpenConns"
	SQLMaxIdleConnsCfg        = "sqlMaxIdleConns"
	SQLLogLevelCfg            = "sqlLogLevel"
	SQLConnMaxLifetimeCfg     = "sqlConnMaxLifetime"
	StringIndexedFieldsCfg    = "string_indexed_fields"
	PrefixIndexedFieldsCfg    = "prefix_indexed_fields"
	SuffixIndexedFieldsCfg    = "suffix_indexed_fields"
	ExistsIndexedFieldsCfg    = "exists_indexed_fields"
	NotExistsIndexedFieldsCfg = "notexists_indexed_fields"
	MongoQueryTimeoutCfg      = "mongoQueryTimeout"
	MongoConnSchemeCfg        = "mongoConnScheme"
	PgSSLModeCfg              = "pgSSLMode"
	PgSSLCertCfg              = "pgSSLCert"
	PgSSLKeyCfg               = "pgSSLKey"
	PgSSLPasswordCfg          = "pgSSLPassword"
	PgSSLCertModeCfg          = "pgSSLCertMode"
	PgSSLRootCertCfg          = "pgSSLRootCert"
	ItemsCfg                  = "items"
	OptsCfg                   = "opts"
	Tenants                   = "tenants"
	MysqlLocation             = "mysqlLocation"
)
View Source
const (
	DataDbTypeCfg                = "db_type"
	DataDbHostCfg                = "db_host"
	DataDbPortCfg                = "db_port"
	DataDbNameCfg                = "db_name"
	DataDbUserCfg                = "db_user"
	DataDbPassCfg                = "db_password"
	InternalDBDumpPathCfg        = "internalDBDumpPath"
	InternalDBBackupPathCfg      = "internalDBBackupPath"
	InternalDBStartTimeoutCfg    = "internalDBStartTimeout"
	InternalDBDumpIntervalCfg    = "internalDBDumpInterval"
	InternalDBRewriteIntervalCfg = "internalDBRewriteInterval"
	InternalDBFileSizeLimitCfg   = "internalDBFileSizeLimit"
	RedisMaxConnsCfg             = "redisMaxConns"
	RedisConnectAttemptsCfg      = "redisConnectAttempts"
	RedisSentinelNameCfg         = "redisSentinel"
	RedisClusterCfg              = "redisCluster"
	RedisClusterSyncCfg          = "redisClusterSync"
	RedisClusterOnDownDelayCfg   = "redisClusterOndownDelay"
	RedisConnectTimeoutCfg       = "redisConnectTimeout"
	RedisReadTimeoutCfg          = "redisReadTimeout"
	RedisWriteTimeoutCfg         = "redisWriteTimeout"
	RedisPoolPipelineWindowCfg   = "redisPoolPipelineWindow"
	RedisPoolPipelineLimitCfg    = "redisPoolPipelineLimit"
	RedisTLSCfg                  = "redisTLS"
	RedisClientCertificateCfg    = "redisClientCertificate"
	RedisClientKeyCfg            = "redisClientKey"
	RedisCACertificateCfg        = "redisCACertificate"
	ReplicationFilteredCfg       = "replication_filtered"
	ReplicationCache             = "replication_cache"
	RemoteConnIDCfg              = "remote_conn_id"
)

DataDbCfg

View Source
const (
	APIKeyCfg    = "api_key"
	RouteIDCfg   = "route_id"
	RemoteCfg    = "remote"
	ReplicateCfg = "replicate"
	TTLCfg       = "ttl"
	LimitCfg     = "limit"
	StaticTTLCfg = "static_ttl"
)

ItemOpt

View Source
const (
	ServerCerificateCfg = "server_certificate"
	ServerKeyCfg        = "server_key"
	ServerPolicyCfg     = "server_policy"
	ServerNameCfg       = "server_name"
	ClientCerificateCfg = "client_certificate"
	ClientKeyCfg        = "client_key"
	CaCertificateCfg    = "ca_certificate"
)

Tls

View Source
const (
	RPCJSONListenCfg    = "rpc_json"
	RPCGOBListenCfg     = "rpc_gob"
	HTTPListenCfg       = "http"
	RPCJSONTLSListenCfg = "rpc_json_tls"
	RPCGOBTLSListenCfg  = "rpc_gob_tls"
	HTTPTLSListenCfg    = "http_tls"
)

ListenCfg

View Source
const (
	HTTPJsonRPCURLCfg        = "json_rpc_url"
	RegistrarSURLCfg         = "registrars_url"
	HTTPWSURLCfg             = "ws_url"
	HTTPFreeswitchCDRsURLCfg = "freeswitch_cdrs_url"
	HTTPCDRsURLCfg           = "http_cdrs"
	PprofPathCfg             = "pprof_path"
	HTTPUseBasicAuthCfg      = "use_basic_auth"
	HTTPAuthUsersCfg         = "auth_users"
	HTTPClientOptsCfg        = "client_opts"

	HTTPClientSkipTLSVerificationCfg   = "skipTLSVerification"
	HTTPClientTLSHandshakeTimeoutCfg   = "tlsHandshakeTimeout"
	HTTPClientDisableKeepAlivesCfg     = "disableKeepAlives"
	HTTPClientDisableCompressionCfg    = "disableCompression"
	HTTPClientMaxIdleConnsCfg          = "maxIdleConns"
	HTTPClientMaxIdleConnsPerHostCfg   = "maxIdleConnsPerHost"
	HTTPClientMaxConnsPerHostCfg       = "maxConnsPerHost"
	HTTPClientIdleConnTimeoutCfg       = "idleConnTimeout"
	HTTPClientResponseHeaderTimeoutCfg = "responseHeaderTimeout"
	HTTPClientExpectContinueTimeoutCfg = "expectContinueTimeout"
	HTTPClientForceAttemptHTTP2Cfg     = "forceAttemptHttp2"
	HTTPClientDialTimeoutCfg           = "dialTimeout"
	HTTPClientDialFallbackDelayCfg     = "dialFallbackDelay"
	HTTPClientDialKeepAliveCfg         = "dialKeepAlive"
)

HTTPCfg

View Source
const (
	StatSConnsCfg     = "stats_conns"
	ResourceSConnsCfg = "resources_conns"
	TrendSConnsCfg    = "trends_conns"
	RankingSConnsCfg  = "rankings_conns"
)

FilterSCfg

View Source
const (
	EnabledCfg         = "enabled"
	ThresholdSConnsCfg = "thresholds_conns"
	CacheSConnsCfg     = "caches_conns"
	ScheduledIDsCfg    = "scheduled_ids"
)
View Source
const (
	CDRsConnsCfg           = "cdrs_conns"
	FiltersCfg             = "filters"
	ExtraFieldsCfg         = "extra_fields"
	SMCostRetriesCfg       = "session_cost_retries"
	ChargerSConnsCfg       = "chargers_conns"
	AttributeSConnsCfg     = "attributes_conns"
	RetransmissionTimerCfg = "retransmission_timer"
	OnlineCDRExportsCfg    = "online_cdr_exports"
	SessionCostRetires     = "session_cost_retries"
	RateSConnsCfg          = "rates_conns"
)

CdrsCfg

View Source
const (
	ListenBijsonCfg        = "listen_bijson"
	ListenBigobCfg         = "listen_bigob"
	RouteSConnsCfg         = "routes_conns"
	IPsConnsCfg            = "ips_conns"
	ReplicationConnsCfg    = "replication_conns"
	RemoteConnsCfg         = "remote_conns"
	DebitIntervalCfg       = "debit_interval"
	StoreSCostsCfg         = "store_session_costs"
	SessionTTLCfg          = "session_ttl"
	SessionTTLMaxDelayCfg  = "session_ttl_max_delay"
	SessionTTLLastUsedCfg  = "session_ttl_last_used"
	SessionTTLLastUsageCfg = "session_ttl_last_usage"
	SessionTTLUsageCfg     = "session_ttl_usage"
	SessionIndexesCfg      = "session_indexes"
	ClientProtocolCfg      = "client_protocol"
	ChannelSyncIntervalCfg = "channel_sync_interval"
	TerminateAttemptsCfg   = "terminate_attempts"
	AlterableFieldsCfg     = "alterable_fields"
	MinDurLowBalanceCfg    = "min_dur_low_balance"
	DefaultUsageCfg        = "default_usage"
	STIRCfg                = "stir"

	AllowedAtestCfg       = "allowed_attest"
	PayloadMaxdurationCfg = "payload_maxduration"
	DefaultAttestCfg      = "default_attest"
	PublicKeyPathCfg      = "publickey_path"
	PrivateKeyPathCfg     = "privatekey_path"
)

SessionSCfg

View Source
const (
	SessionSConnsCfg          = "sessions_conns"
	SubscribeParkCfg          = "subscribe_park"
	CreateCdrCfg              = "create_cdr"
	LowBalanceAnnFileCfg      = "low_balance_ann_file"
	EmptyBalanceContextCfg    = "empty_balance_context"
	EmptyBalanceAnnFileCfg    = "empty_balance_ann_file"
	MaxWaitConnectionCfg      = "max_wait_connection"
	ActiveSessionDelimiterCfg = "active_session_delimiter"
	EventSocketConnsCfg       = "event_socket_conns"
	EmptyBalanceContext       = "empty_balance_context"
)

FsAgentCfg

View Source
const (
	AddressCfg       = "address"
	Password         = "password"
	AliasCfg         = "alias"
	AccountSConnsCfg = "accounts_conns"

	// KamAgentCfg
	EvapiConnsCfg = "evapi_conns"
	TimezoneCfg   = "timezone"

	// AsteriskConnCfg
	UserCf = "user"

	// AsteriskAgentCfg
	CreateCDRCfg     = "create_cdr"
	AsteriskConnsCfg = "asterisk_conns"

	// DiameterAgentCfg
	ListenNetCfg         = "listen_net"
	NetworkCfg           = "network"
	ListenersCfg         = "listeners"
	ListenCfg            = "listen"
	DictionariesPathCfg  = "dictionaries_path"
	OriginHostCfg        = "origin_host"
	OriginRealmCfg       = "origin_realm"
	VendorIDCfg          = "vendor_id"
	ProductNameCfg       = "product_name"
	SyncedConnReqsCfg    = "synced_conn_requests"
	ASRTemplateCfg       = "asr_template"
	RARTemplateCfg       = "rar_template"
	ForcedDisconnectCfg  = "forced_disconnect"
	TemplatesCfg         = "templates"
	RequestProcessorsCfg = "request_processors"

	// PrometheusAgentCfg
	CoreSConnsCfg            = "cores_conns"
	CollectGoMetricsCfg      = "collect_go_metrics"
	CollectProcessMetricsCfg = "collect_process_metrics"
	StatQueueIDsCfg          = "stat_queue_ids"

	// RequestProcessor
	RequestFieldsCfg = "request_fields"
	ReplyFieldsCfg   = "reply_fields"

	// RadiusAgentCfg
	ListenAuthCfg         = "listen_auth"
	ListenAcctCfg         = "listen_acct"
	ClientSecretsCfg      = "client_secrets"
	ClientDictionariesCfg = "client_dictionaries"

	// JanusAgentCfg
	JanusConnsCfg    = "janus_conns"
	AdminAddressCfg  = "admin_address"
	AdminPasswordCfg = "admin_password"

	// AttributeSCfg
	IndexedSelectsCfg  = "indexed_selects"
	ProfileRunsCfg     = "profile_runs"
	NestedFieldsCfg    = "nested_fields"
	MetaProcessRunsCfg = "*processRuns"
	MetaProfileRunsCfg = "*profileRuns"

	// ChargerSCfg
	StoreIntervalCfg = "store_interval"

	// StatSCfg
	StoreUncompressedLimitCfg = "store_uncompressed_limit"
	EEsExporterIDsCfg         = "ees_exporter_ids"

	// Cache
	PartitionsCfg = "partitions"
	PrecacheCfg   = "precache"

	// CdrsCfg
	ExportPathCfg         = "export_path"
	SynchronousCfg        = "synchronous"
	AttemptsCfg           = "attempts"
	AttributeContextCfg   = "attribute_context"
	AttributeIDsCfg       = "attribute_ids"
	ConcurrentRequestsCfg = "concurrent_requests"

	//LoaderSCfg
	DryRunCfg       = "dry_run"
	LockFilePathCfg = "lockfile_path"
	TpInDirCfg      = "tp_in_dir"
	TpOutDirCfg     = "tp_out_dir"
	DataCfg         = "data"

	DefaultRatioCfg   = "default_ratio"
	ReadersCfg        = "readers"
	ExportersCfg      = "exporters"
	PoolSize          = "poolSize"
	Conns             = "conns"
	FilenameCfg       = "file_name"
	RequestPayloadCfg = "request_payload"
	ReplyPayloadCfg   = "reply_payload"
	TransportCfg      = "transport"
	StrategyCfg       = "strategy"

	// RouteSCfg
	MetaProfileCountCfg = "*profileCount"
	MetaIgnoreErrorsCfg = "*ignoreErrors"
	MetaMaxCostCfg      = "*maxCost"
	MetaLimitCfg        = "*limit"
	MetaOffsetCfg       = "*offset"
	MetaMaxItemsCfg     = "*maxItems"

	// RateSCfg
	MetaIntervalStartCfg          = "*intervalStart"
	RateIndexedSelectsCfg         = "rate_indexed_selects"
	RateNestedFieldsCfg           = "rate_nested_fields"
	RateStringIndexedFieldsCfg    = "rate_string_indexed_fields"
	RatePrefixIndexedFieldsCfg    = "rate_prefix_indexed_fields"
	RateSuffixIndexedFieldsCfg    = "rate_suffix_indexed_fields"
	RateExistsIndexedFieldsCfg    = "rate_exists_indexed_fields"
	RateNotExistsIndexedFieldsCfg = "rate_notexists_indexed_fields"
	Verbosity                     = "verbosity"

	// ResourceSCfg
	MetaUsageIDCfg  = "*usageID"
	MetaUsageTTLCfg = "*usageTTL"
	MetaUnitsCfg    = "*units"

	// SessionsCfg
	MetaAttributesDerivedReplyCfg = "*attributesDerivedReply"
	MetaBlockerErrorCfg           = "*blockerError"
	MetaCDRsDerivedReplyCfg       = "*cdrsDerivedReply"
	MetaResourcesAuthorizeCfg     = "*resourcesAuthorize"
	MetaResourcesAllocateCfg      = "*resourcesAllocate"
	MetaResourcesReleaseCfg       = "*resourcesRelease"
	MetaResourcesDerivedReplyCfg  = "*resourcesDerivedReply"
	MetaIPsAuthorizeCfg           = "*ipsAuthorize"
	MetaIPsAllocateCfg            = "*ipsAllocate"
	MetaIPsReleaseCfg             = "*ipsRelease"
	MetaRoutesDerivedReplyCfg     = "*routesDerivedReply"
	MetaStatsDerivedReplyCfg      = "*statsDerivedReply"
	MetaThresholdsDerivedReplyCfg = "*thresholdsDerivedReply"
	MetaMaxUsageCfg               = "*maxUsage"
	MetaForceUsageCfg             = "*forceUsage"
	MetaTTLCfg                    = "*ttl"
	MetaChargeableCfg             = "*chargeable"
	MetaDebitIntervalCfg          = "*debitInterval"
	MetaTTLLastUsageCfg           = "*ttlLastUsage"
	MetaTTLLastUsedCfg            = "*ttlLastUsed"
	MetaTTLMaxDelayCfg            = "*ttlMaxDelay"
	MetaTTLUsageCfg               = "*ttlUsage"
	MetaAccountsForceUsage        = "*accountsForceUsage"

	// AnalyzerSCfg
	CleanupIntervalCfg = "cleanup_interval"
	IndexTypeCfg       = "index_type"
	DBPathCfg          = "db_path"

	// CoreSCfg
	CapsCfg              = "caps"
	CapsStrategyCfg      = "caps_strategy"
	CapsStatsIntervalCfg = "caps_stats_interval"
	ShutdownTimeoutCfg   = "shutdown_timeout"

	// AccountSCfg
	MaxIterations = "max_iterations"
	MaxUsage      = "max_usage"
)

From Config

View Source
const (
	TagCfg             = "tag"
	TypeCf             = "type"
	PathCfg            = "path"
	ValueCfg           = "value"
	WidthCfg           = "width"
	StripCfg           = "strip"
	PaddingCfg         = "padding"
	MandatoryCfg       = "mandatory"
	AttributeIDCfg     = "attribute_id"
	NewBranchCfg       = "new_branch"
	BlockerCfg         = "blocker"
	LayoutCfg          = "layout"
	CostShiftDigitsCfg = "cost_shift_digits"
	MaskDestIDCfg      = "mask_destinationd_id"
	MaskLenCfg         = "mask_length"
)

FC Template

View Source
const (
	RootDirCfg              = "root_dir"
	URLCfg                  = "url"
	ClientNumberCfg         = "client_number"
	ValidationKeyCfg        = "validation_key"
	BusinessUnitCfg         = "business_unit"
	IncludeLocalCostCfg     = "include_local_cost"
	ReturnFileCodeCfg       = "return_file_code"
	ResponseGroupCfg        = "response_group"
	ResponseTypeCfg         = "response_type"
	RegulatoryCodeCfg       = "regulatory_code"
	ClientTrackingCfg       = "client_tracking"
	CustomerNumberCfg       = "customer_number"
	OrigNumberCfg           = "orig_number"
	TermNumberCfg           = "term_number"
	BillToNumberCfg         = "bill_to_number"
	ZipcodeCfg              = "zipcode"
	Plus4Cfg                = "plus4"
	P2PZipcodeCfg           = "p2pzipcode"
	P2PPlus4Cfg             = "p2pplus4"
	UnitsCfg                = "units"
	UnitTypeCfg             = "unit_type"
	TaxIncludedCfg          = "tax_included"
	TaxSitusRuleCfg         = "tax_situs_rule"
	TransTypeCodeCfg        = "trans_type_code"
	SalesTypeCodeCfg        = "sales_type_code"
	TaxExemptionCodeListCfg = "tax_exemption_code_list"
)

SureTax

View Source
const (
	TpIDCfg            = "tpid"
	DataPathCfg        = "data_path"
	DisableReverseCfg  = "disable_reverse"
	CachesConnsCfg     = "caches_conns"
	ActionSConnsCfg    = "actions_conns"
	GapiCredentialsCfg = "gapi_credentials"
	GapiTokenCfg       = "gapi_token"
)

LoaderCgrCfg

View Source
const (
	OutDataDBTypeCfg       = "out_datadb_type"
	OutDataDBHostCfg       = "out_datadb_host"
	OutDataDBPortCfg       = "out_datadb_port"
	OutDataDBNameCfg       = "out_datadb_name"
	OutDataDBUserCfg       = "out_datadb_user"
	OutDataDBPasswordCfg   = "out_datadb_password"
	OutDataDBEncodingCfg   = "out_datadb_encoding"
	OutDataDBRedisSentinel = "out_redis_sentinel"
	OutDataDBOptsCfg       = "out_datadb_opts"
	UsersFiltersCfg        = "users_filters"
)

MigratorCgrCfg

View Source
const (
	MailerServerCfg   = "server"
	MailerAuthUserCfg = "auth_user"
	MailerAuthPassCfg = "auth_password"
	MailerFromAddrCfg = "from_address"
)

MailerCfg

View Source
const (
	IDCfg                  = "id"
	CacheCfg               = "cache"
	FieldSepCfg            = "field_separator"
	RunDelayCfg            = "run_delay"
	StartDelayCfg          = "start_delay"
	SourcePathCfg          = "source_path"
	ProcessedPathCfg       = "processed_path"
	TenantCfg              = "tenant"
	EEsSuccessIDsCfg       = "ees_success_ids"
	EEsFailedIDsCfg        = "ees_failed_ids"
	FlagsCfg               = "flags"
	FieldsCfg              = "fields"
	CacheDumpFieldsCfg     = "cache_dump_fields"
	PartialCommitFieldsCfg = "partial_commit_fields"
	PartialCacheTTLCfg     = "partial_cache_ttl"
	ActionCfg              = "action"
)

EventReaderCfg

View Source
const (
	RPCCfg             = "rpc"
	DispatcherCfg      = "dispatchers"
	RegistrarsConnsCfg = "registrars_conns"
	HostsCfg           = "hosts"
	RefreshIntervalCfg = "refresh_interval"
)

RegistrarCCfg

View Source
const (
	ClientIDCfg     = "client_id"
	ClientSecretCfg = "client_secret"
	TokenUrlCfg     = "token_url"
	IpsUrlCfg       = "ips_url"
	NumbersUrlCfg   = "numbers_url"
	AudienceCfg     = "audience"
	GrantTypeCfg    = "grant_type"
)
View Source
const (
	STIRAlg = "ES256"
	STIRPpt = "shaken"
	STIRTyp = "passport"

	STIRAlgField  = "alg"
	STIRPptField  = "ppt"
	STIRInfoField = "info"

	STIRExtraInfoPrefix = ";info=<"
	STIRExtraInfoSuffix = ">;alg=ES256;ppt=shaken"
)

STIR/SHAKEN

View Source
const (

	// SessionS
	OptsSesTTL           = "*sesTTL"
	OptsSesChargeable    = "*sesChargeable"
	OptsSesDebitInterval = "*sesDebitInterval"
	OptsSesTTLLastUsage  = "*sesTTLLastUsage"
	OptsSesTTLLastUsed   = "*sesTTLLastUsed"
	OptsSesTTLMaxDelay   = "*sesTTLMaxDelay"
	OptsSesTTLUsage      = "*sesTTLUsage"
	OptsSesForceUsage    = "*sesForceUsage"

	OptsSesAttributeSDerivedReply = "*sesAttributeSDerivedReply"
	OptsSesBlockerError           = "*sesBlockerError"
	OptsSesCDRsDerivedReply       = "*sesCDRsDerivedReply"
	OptsSesResourceSAuthorize     = "*sesResourceSAuthorize"
	OptsSesResourceSAllocate      = "*sesResourceSAllocate"
	OptsSesResourceSRelease       = "*sesResourceSRelease"
	OptsSesResourceSDerivedReply  = "*sesResourceSDerivedReply"
	OptsSesRouteSDerivedReply     = "*sesRouteSDerivedReply"
	OptsSesStatSDerivedReply      = "*sesStatSDerivedReply"
	OptsSesSTIRAuthenticate       = "*sesSTIRAuthenticate"
	OptsSesSTIRDerivedReply       = "*sesSTIRDerivedReply"
	OptsSesSTIRInitiate           = "*sesSTIRInitiate"
	OptsSesThresholdSDerivedReply = "*sesThresholdSDerivedReply"
	OptsSesMaxUsage               = "*sesMaxUsage"
	OptsSesInitiate               = "*sesInitiate"
	OptsSesUpdate                 = "*sesUpdate"
	OptsSesTerminate              = "*sesTerminate"
	OptsSesMessage                = "*sesMessage"

	// Accounts
	OptsAccountsUsage      = "*acntUsage"
	OptsAccountsForceUsage = "*accountSForceUsage"
	OptsAccountsProfileIDs = "*acntProfileIDs"

	// Actions
	OptsActionsProfileIDs = "*actProfileIDs"

	// Attributes
	OptsAttributesProfileIDs  = "*attrProfileIDs"
	OptsAttributesProfileRuns = "*attrProfileRuns"
	OptsAttributesProcessRuns = "*attrProcessRuns"

	// CDRs
	OptsCDRsExport = "*cdrsExport"
	OptsCDRsRefund = "*cdrsRefund"
	OptsCDRsRerate = "*cdrsRerate"
	OptsCDRsStore  = "*cdrsStore"

	// DispatcherS
	OptsAPIKey                   = "*apiKey"
	OptsRouteID                  = "*routeID"
	OptsDispatchersProfilesCount = "*dispatchersProfilesCount"

	// EEs
	OptsEEsVerbose = "*eesVerbose"

	// Rates
	OptsRatesProfileIDs    = "*rtsProfileIDs"
	OptsRatesStartTime     = "*rtsStartTime"
	OptsRatesUsage         = "*rtsUsage"
	OptsRatesIntervalStart = "*rtsIntervalStart"

	// Resources
	OptsResourcesUnits    = "*rsUnits"
	OptsResourcesUsageID  = "*rsUsageID"
	OptsResourcesUsageTTL = "*rsUsageTTL"

	// IPs
	OptsIPsAllocationID = "*ipAllocationID"
	OptsIPsTTL          = "*ipTTL"
	MetaAllocationID    = "*allocationID"

	// Routes
	OptsRoutesProfilesCount = "*rouProfilesCount"
	OptsRoutesLimit         = "*rouLimit"
	OptsRoutesOffset        = "*rouOffset"
	OptsRoutesMaxItems      = "*rouMaxItems"
	OptsRoutesIgnoreErrors  = "*rouIgnoreErrors"
	OptsRoutesMaxCost       = "*rouMaxCost"
	OptsRoutesUsage         = "*rouUsage"

	// Stats
	OptsStatsProfileIDs  = "*statsProfileIDs"
	OptsRoundingDecimals = "*roundingDecimals"

	// Thresholds
	OptsThresholdsProfileIDs = "*thdProfileIDs"

	// STIR
	OptsStirATest              = "*stirATest"
	OptsStirPayloadMaxDuration = "*stirPayloadMaxDuration"
	OptsStirIdentity           = "*stirIdentity"
	OptsStirOriginatorTn       = "*stirOriginatorTn"
	OptsStirOriginatorURI      = "*stirOriginatorURI"
	OptsStirDestinationTn      = "*stirDestinationTn"
	OptsStirDestinationURI     = "*stirDestinationURI"
	OptsStirPublicKeyPath      = "*stirPublicKeyPath"
	OptsStirPrivateKeyPath     = "*stirPrivateKeyPath"

	// Others
	OptsContext              = "*context"
	MetaSubsys               = "*subsys"
	MetaMethod               = "*reqMethod"
	MetaEventType            = "*eventType"
	EventType                = "EventType"
	SchedulerInit            = "SchedulerInit"
	MetaProfileIgnoreFilters = "*profileIgnoreFilters"
	MetaPosterAttempts       = "*posterAttempts"

	RemoteHostOpt = "*rmtHost"
	MetaCache     = "*cache"

	MetaWithIndex   = "*withIndex"
	MetaForceLock   = "*forceLock"
	MetaStopOnError = "*stopOnError"
)

Event Opts

View Source
const (
	MetaDerivedReply = "*derived_reply"

	MetaIDs        = "*IDs"
	MetaProfileIDs = "*profileIDs"

	TrueStr  = "true"
	FalseStr = "false"
)

Event Flags

View Source
const (
	ThresholdIDs     = "ThresholdIDs"
	FilterIDs        = "FilterIDs"
	RateProfileIDs   = "RateProfileIDs"
	ActionProfileIDs = "ActionProfileIDs"
)

ArgCache constats

View Source
const (
	NumberOfEvents    = "NumberOfEvents"
	TotalCost         = "TotalCost"
	PositiveExports   = "PositiveExports"
	NegativeExports   = "NegativeExports"
	FirstExpOrderID   = "FirstExpOrderID"
	LastExpOrderID    = "LastExpOrderID"
	FirstEventATime   = "FirstEventATime"
	LastEventATime    = "LastEventATime"
	TotalDuration     = "TotalDuration"
	TotalDataUsage    = "TotalDataUsage"
	TotalSMSUsage     = "TotalSMSUsage"
	TotalMMSUsage     = "TotalMMSUsage"
	TotalGenericUsage = "TotalGenericUsage"
	FilePath          = "FilePath"
)

EventExporter metrics

View Source
const (
	SQSPoster = "SQSPoster"
	S3Poster  = "S3Poster"

	// General constants for posters and readers
	DefaultQueueID = "cgrates_cdrs"

	// sqs and s3
	AWSRegion = "awsRegion"
	AWSKey    = "awsKey"
	AWSSecret = "awsSecret"
	AWSToken  = "awsToken"

	// sqs
	SQSQueueID = "sqsQueueID"

	// s3
	S3Bucket     = "s3BucketID"
	S3FolderPath = "s3FolderPath"

	// sql
	SQLDefaultDBName    = "cgrates"
	SQLDefaultPgSSLMode = "disable"

	SQLDBNameOpt    = "sqlDBName"
	SQLTableNameOpt = "sqlTableName"

	SQLMaxOpenConns    = "sqlMaxOpenConns"
	SQLConnMaxLifetime = "sqlConnMaxLifetime"
	MYSQLDSNParams     = "mysqlDSNParams"

	// fileCSV
	CSVRowLengthOpt     = "csvRowLength"
	CSVFieldSepOpt      = "csvFieldSeparator"
	CSVLazyQuotes       = "csvLazyQuotes"
	HeaderDefineCharOpt = "csvHeaderDefineChar"

	// fileXML
	XMLRootPathOpt = "xmlRootPath"

	// amqp
	AMQPDefaultConsumerTag = "cgrates"
	DefaultExchangeType    = "direct"

	AMQPQueueID      = "amqpQueueID"
	AMQPConsumerTag  = "amqpConsumerTag"
	AMQPExchange     = "amqpExchange"
	AMQPExchangeType = "amqpExchangeType"
	AMQPRoutingKey   = "amqpRoutingKey"
	AMQPUsername     = "amqpUsername"
	AMQPPassword     = "amqpPassword"

	// kafka
	KafkaDefaultTopic   = "cgrates"
	KafkaDefaultGroupID = "cgrates"
	KafkaDefaultMaxWait = time.Millisecond

	KafkaTopic         = "kafkaTopic"
	KafkaBatchSize     = "kafkaBatchSize"
	KafkaTLS           = "kafkaTLS"
	KafkaCAPath        = "kafkaCAPath"
	KafkaSkipTLSVerify = "kafkaSkipTLSVerify"
	KafkaGroupID       = "kafkaGroupID"
	KafkaMaxWait       = "kafkaMaxWait"

	// partial
	PartialOpt      = "*partial"
	PartialRatesOpt = "*partial_rates"

	PartialOrderFieldOpt       = "partialOrderField"
	PartialCacheActionOpt      = "partialCacheAction"
	PartialPathOpt             = "partialPath"
	PartialCSVFieldSepartorOpt = "partialcsvFieldSeparator"

	// EEs Elasticsearch options
	ElsIndex                    = "elsIndex"
	ElsRefresh                  = "elsRefresh"
	ElsOpType                   = "elsOpType"
	ElsPipeline                 = "elsPipeline"
	ElsRouting                  = "elsRouting"
	ElsTimeout                  = "elsTimeout"
	ElsWaitForActiveShards      = "elsWaitForActiveShards"
	ElsCAPath                   = "elsCAPath"
	ElsDiscoverNodesOnStart     = "elsDiscoverNodesOnStart"
	ElsDiscoverNodeInterval     = "elsDiscoverNodeInterval"
	ElsCloud                    = "elsCloud"
	ElsAPIKey                   = "elsAPIKey"
	ElsCertificateFingerprint   = "elsCertificateFingerprint"
	ElsServiceToken             = "elsServiceToken"
	ElsUsername                 = "elsUsername"
	ElsPassword                 = "elsPassword"
	ElsEnableDebugLogger        = "elsEnableDebugLogger"
	ElsLogger                   = "elsLogger"
	ElsCompressRequestBody      = "elsCompressRequestBody"
	ElsCompressRequestBodyLevel = "elsCompressRequestBodyLevel"
	ElsRetryOnStatus            = "elsRetryOnStatus"
	ElsMaxRetries               = "elsMaxRetries"
	ElsDisableRetry             = "elsDisableRetry"

	//EES ElasticSearch Logger Options
	ElsJson  = "elsJson"
	ElsColor = "elsColor"
	ElsText  = "elsText"
	// nats
	NatsSubject              = "natsSubject"
	NatsQueueID              = "natsQueueID"
	NatsConsumerName         = "natsConsumerName"
	NatsStreamName           = "natsStreamName"
	NatsJWTFile              = "natsJWTFile"
	NatsSeedFile             = "natsSeedFile"
	NatsClientCertificate    = "natsClientCertificate"
	NatsClientKey            = "natsClientKey"
	NatsCertificateAuthority = "natsCertificateAuthority"
	NatsJetStream            = "natsJetStream"
	NatsJetStreamMaxWait     = "natsJetStreamMaxWait"

	// rpc
	RpcCodec        = "rpcCodec"
	ServiceMethod   = "serviceMethod"
	KeyPath         = "keyPath"
	CertPath        = "certPath"
	CaPath          = "caPath"
	Tls             = "tls"
	ConnIDs         = "connIDs"
	RpcConnTimeout  = "rpcConnTimeout"
	RpcReplyTimeout = "rpcReplyTimeout"
	RPCAPIOpts      = "rpcAPIOpts"
)

Poster and Event reader constants

View Source
const (
	PageLimitOpt    = "*pageLimit"
	PageOffsetOpt   = "*pageOffset"
	PageMaxItemsOpt = "*pageMaxItems"
	ItemsPrefixOpt  = "*itemsPrefix"
)

Paginator options

View Source
const (
	MetaScorch  = "*scorch"
	MetaBoltdb  = "*boltdb"
	MetaLeveldb = "*leveldb"
	MetaMoss    = "*mossdb"

	RequestStartTime = "RequestStartTime"
	RequestDuration  = "RequestDuration"
	RequestParams    = "RequestParams"
	Reply            = "Reply"
	ReplyError       = "ReplyError"
	AnzDBDir         = "db"
	Opts             = "Opts"
)

Analyzers constants

View Source
const (
	//Common
	VerboseCgr      = "verbose"
	VersionCgr      = "version"
	QuitCgr         = "quit"
	ExitCgr         = "exit"
	ByeCgr          = "bye"
	CloseCgr        = "close"
	CfgPathCgr      = "config_path"
	DataDBTypeCgr   = "datadb_type"
	DataDBHostCgr   = "datadb_host"
	DataDBPortCgr   = "datadb_port"
	DataDBNameCgr   = "datadb_name"
	DataDBUserCgr   = "datadb_user"
	DataDBPasswdCgr = "datadb_passwd"
	//Cgr console
	CgrConsole     = "cgr-console"
	HomeCgr        = "HOME"
	HistoryCgr     = "/.cgr_history"
	RpcEncodingCgr = "rpc_encoding"
	CertPathCgr    = "crt_path"
	KeyPathCgr     = "key_path"
	CAPathCgr      = "ca_path"
	HelpCgr        = "help"
	SepCgr         = " "
	//Cgr engine
	CgrEngine            = "cgr-engine"
	PrintCfgCgr          = "print_config"
	CheckCfgCgr          = "check_config"
	PidCgr               = "pid"
	CpuProfDirCgr        = "cpuprof_dir"
	MemProfDirCgr        = "memprof_dir"
	MemProfIntervalCgr   = "memprof_interval"
	MemProfMaxFilesCgr   = "memprof_maxfiles"
	MemProfTimestampCgr  = "memprof_timestamp"
	ScheduledShutdownCgr = "scheduled_shutdown"
	SingleCpuCgr         = "single_cpu"
	PreloadCgr           = "preload"
	SetVersionsCgr       = "set_versions"
	MemProfFinalFile     = "mem_final.prof"
	CpuPathCgr           = "cpu.prof"
	//Cgr loader
	CgrLoader         = "cgr-loader"
	CachingArgCgr     = "caching"
	FieldSepCgr       = "field_sep"
	ImportIDCgr       = "import_id"
	DisableReverseCgr = "disable_reverse_mappings"
	RemoveCgr         = "remove"
	CacheSAddress     = "caches_address"
	SchedulerAddress  = "scheduler_address"
	//Cgr migrator
	CgrMigrator = "cgr-migrator"
	ExecCgr     = "exec"
)

CMD constants

View Source
const (
	ActionSv1                = "ActionSv1"
	ActionSv1Ping            = "ActionSv1.Ping"
	ActionSv1ScheduleActions = "ActionSv1.ScheduleActions"
	ActionSv1ExecuteActions  = "ActionSv1.ExecuteActions"
)

ActionSv1

View Source
const (
	NsSuffix = "ns"
	UsSuffix = "us"

	MsSuffix = "ms"
	SSuffix  = "s"
	MSuffix  = "m"
	HSuffix  = "h"
)

Time duration suffix

View Source
const (
	ToNearestEven       = "*toNearestEven"
	ToNearestAway       = "*toNearestAway"
	ToZero              = "*toZero"
	AwayFromZero        = "*awayFromZero"
	ToNegativeInf       = "*toNegativeInf"
	ToPositiveInf       = "*toPositiveInf"
	ToNearestTowardZero = "*toNearestTowardZero"
)

rounding strings

View Source
const (
	StateServiceUP   = "SERVICE_UP"
	StateServiceDOWN = "SERVICE_DOWN"
)
View Source
const (
	LOGLEVEL_EMERGENCY = iota
	LOGLEVEL_ALERT
	LOGLEVEL_CRITICAL
	LOGLEVEL_ERROR
	LOGLEVEL_WARNING
	LOGLEVEL_NOTICE
	LOGLEVEL_INFO
	LOGLEVEL_DEBUG
)

log severities following rfc3164

View Source
const (
	EFsConnsCfg = "efs_conns"
)

Efs

View Source
const (
	KeysCfg = "keys"
)

APIBanCfg

Variables

View Source
var (
	MainCDRFields = NewStringSet([]string{Source, OriginHost, OriginID, ToR, RequestType, Tenant, Category,
		AccountField, Subject, Destination, SetupTime, AnswerTime, Usage, Cost, Rated, Partial, RunID,
		PreRated, CostSource, CostDetails, ExtraInfo, OrderID})
	PostPaidRatedSlice = []string{MetaPostpaid, MetaRated}

	GitCommitDate string // If set, it will be processed as part of versioning
	GitCommitHash string // If set, it will be processed as part of versioning

	DataDBPartitions = NewStringSet([]string{
		CacheResourceProfiles, CacheResources, CacheEventResources, CacheIPProfiles, CacheIPAllocations,
		CacheEventIPs, CacheStatQueueProfiles, CacheStatQueues, CacheThresholdProfiles,
		CacheThresholds, CacheFilters, CacheRouteProfiles, CacheAttributeProfiles,
		CacheTrendProfiles, CacheChargerProfiles, CacheActionProfiles, CacheRankingProfiles,
		CacheRankings, CacheTrends, CacheResourceFilterIndexes, CacheIPFilterIndexes, CacheStatFilterIndexes,
		CacheThresholdFilterIndexes, CacheRouteFilterIndexes, CacheAttributeFilterIndexes,
		CacheChargerFilterIndexes, CacheLoadIDs, CacheRateProfiles, CacheRateProfilesFilterIndexes,
		CacheRateFilterIndexes, CacheActionProfilesFilterIndexes, CacheAccountsFilterIndexes,
		CacheReverseFilterIndexes, CacheAccounts,
	})

	// CachePartitions enables creation of cache partitions
	CachePartitions = JoinStringSet(extraDBPartition, DataDBPartitions)

	CacheInstanceToPrefix = map[string]string{
		CacheResourceProfiles:            ResourceProfilesPrefix,
		CacheResources:                   ResourcesPrefix,
		CacheIPProfiles:                  IPProfilesPrefix,
		CacheIPAllocations:               IPAllocationsPrefix,
		CacheStatQueueProfiles:           StatQueueProfilePrefix,
		CacheStatQueues:                  StatQueuePrefix,
		CacheTrendProfiles:               TrendProfilePrefix,
		CacheTrends:                      TrendPrefix,
		CacheThresholdProfiles:           ThresholdProfilePrefix,
		CacheThresholds:                  ThresholdPrefix,
		CacheFilters:                     FilterPrefix,
		CacheRouteProfiles:               RouteProfilePrefix,
		CacheRankingProfiles:             RankingPrefix,
		CacheRankings:                    RankingProfilePrefix,
		CacheAttributeProfiles:           AttributeProfilePrefix,
		CacheChargerProfiles:             ChargerProfilePrefix,
		CacheRateProfiles:                RateProfilePrefix,
		CacheActionProfiles:              ActionProfilePrefix,
		CacheAccounts:                    AccountPrefix,
		CacheResourceFilterIndexes:       ResourceFilterIndexes,
		CacheIPFilterIndexes:             IPFilterIndexes,
		CacheStatFilterIndexes:           StatFilterIndexes,
		CacheThresholdFilterIndexes:      ThresholdFilterIndexes,
		CacheRouteFilterIndexes:          RouteFilterIndexes,
		CacheAttributeFilterIndexes:      AttributeFilterIndexes,
		CacheChargerFilterIndexes:        ChargerFilterIndexes,
		CacheRateProfilesFilterIndexes:   RateProfilesFilterIndexPrfx,
		CacheActionProfilesFilterIndexes: ActionProfilesFilterIndexPrfx,
		CacheAccountsFilterIndexes:       AccountFilterIndexPrfx,

		CacheLoadIDs:              LoadIDPrefix,
		CacheRateFilterIndexes:    RateFilterIndexPrfx,
		CacheReverseFilterIndexes: FilterIndexPrfx,
		MetaAPIBan:                MetaAPIBan,
	}
	CachePrefixToInstance map[string]string // will be built on init
	CacheIndexesToPrefix  = map[string]string{
		CacheThresholdFilterIndexes:      ThresholdProfilePrefix,
		CacheResourceFilterIndexes:       ResourceProfilesPrefix,
		CacheIPFilterIndexes:             IPProfilesPrefix,
		CacheStatFilterIndexes:           StatQueueProfilePrefix,
		CacheRouteFilterIndexes:          RouteProfilePrefix,
		CacheAttributeFilterIndexes:      AttributeProfilePrefix,
		CacheChargerFilterIndexes:        ChargerProfilePrefix,
		CacheRateProfilesFilterIndexes:   RateProfilePrefix,
		CacheActionProfilesFilterIndexes: ActionProfilePrefix,
		CacheAccountsFilterIndexes:       AccountPrefix,
		CacheReverseFilterIndexes:        FilterPrefix,
	}

	CacheInstanceToCacheIndex = map[string]string{
		CacheThresholdProfiles: CacheThresholdFilterIndexes,
		CacheResourceProfiles:  CacheResourceFilterIndexes,
		CacheIPProfiles:        CacheIPFilterIndexes,
		CacheStatQueueProfiles: CacheStatFilterIndexes,
		CacheRouteProfiles:     CacheRouteFilterIndexes,
		CacheAttributeProfiles: CacheAttributeFilterIndexes,
		CacheChargerProfiles:   CacheChargerFilterIndexes,
		CacheRateProfiles:      CacheRateProfilesFilterIndexes,
		CacheActionProfiles:    CacheActionProfilesFilterIndexes,
		CacheFilters:           CacheReverseFilterIndexes,
		CacheAccounts:          CacheAccountsFilterIndexes,
	}

	// ProtectedSFlds are the fields that sessions should not alter
	ProtectedSFlds = NewStringSet([]string{OriginHost, OriginID, Usage})

	ConcurrentReqsLimit    int
	ConcurrentReqsStrategy string
)
View Source
var (
	PgSSLModeDisable    = "disable"
	PgSSLModeAllow      = "allow"
	PgSSLModePrefer     = "prefer"
	PgSSLModeRequire    = "require"
	PgSSLModeVerifyCA   = "verify-ca"
	PgSSLModeVerifyFull = "verify-full"
)

StorDB

View Source
var (
	// common
	MetaRight = "*right"
	MetaLeft  = "*left"
	// only for strip
	MetaXRight = "*xright"
	MetaXLeft  = "*xleft"
	// only for padding
	MetaZeroLeft = "*zeroleft"
)

Strip/Padding strategy

View Source
var (
	DecimalNaN     = &Decimal{}
	DecimalContext decimal.Context
)
View Source
var (
	ErrNoMoreData                    = errors.New("NO_MORE_DATA")
	ErrNotImplemented                = errors.New("NOT_IMPLEMENTED")
	ErrDSPHostNotFound               = errors.New("DSP_HOST_NOT_FOUND")
	ErrDSPProfileNotFound            = errors.New("DSP_PROFILE_NOT_FOUND")
	ErrNotFound                      = errors.New("NOT_FOUND")
	ErrTimedOut                      = errors.New("TIMED_OUT")
	ErrServerError                   = errors.New("SERVER_ERROR")
	ErrMaxRecursionDepth             = errors.New("MAX_RECURSION_DEPTH")
	ErrMandatoryIeMissing            = errors.New("MANDATORY_IE_MISSING")
	ErrExists                        = errors.New("EXISTS")
	ErrBrokenReference               = errors.New("BROKEN_REFERENCE")
	ErrParserError                   = errors.New("PARSER_ERROR")
	ErrInvalidPath                   = errors.New("INVALID_PATH")
	ErrInvalidKey                    = errors.New("INVALID_KEY")
	ErrUnauthorizedDestination       = errors.New("UNAUTHORIZED_DESTINATION")
	ErrRatingPlanNotFound            = errors.New("RATING_PLAN_NOT_FOUND")
	ErrAccountNotFound               = errors.New("ACCOUNT_NOT_FOUND")
	ErrAccountDisabled               = errors.New("ACCOUNT_DISABLED")
	ErrInsufficientCredit            = errors.New("INSUFFICIENT_CREDIT")
	ErrNotConvertible                = errors.New("NOT_CONVERTIBLE")
	ErrResourceUnavailable           = errors.New("RESOURCE_UNAVAILABLE")
	ErrResourceUnauthorized          = errors.New("RESOURCE_UNAUTHORIZED")
	ErrNoActiveSession               = errors.New("NO_ACTIVE_SESSION")
	ErrPartiallyExecuted             = errors.New("PARTIALLY_EXECUTED")
	ErrMaxUsageExceeded              = errors.New("MAX_USAGE_EXCEEDED")
	ErrMaxCostExceeded               = errors.New("MAX_COST_EXCEEDED")
	ErrFilterNotPassingNoCaps        = errors.New("filter not passing")
	ErrNotConvertibleNoCaps          = errors.New("not convertible")
	ErrMandatoryIeMissingNoCaps      = errors.New("mandatory information missing")
	ErrUnauthorizedApi               = errors.New("UNAUTHORIZED_API")
	ErrUnknownApiKey                 = errors.New("UNKNOWN_API_KEY")
	ErrReqUnsynchronized             = errors.New("REQ_UNSYNCHRONIZED")
	ErrUnsupporteServiceMethod       = errors.New("UNSUPPORTED_SERVICE_METHOD")
	ErrDisconnected                  = errors.New("DISCONNECTED")
	ErrReplyTimeout                  = errors.New("REPLY_TIMEOUT")
	ErrSessionNotFound               = errors.New("SESSION_NOT_FOUND")
	ErrJsonIncompleteComment         = errors.New("JSON_INCOMPLETE_COMMENT")
	ErrNotEnoughParameters           = errors.New("NotEnoughParameters")
	ErrNotConnected                  = errors.New("NOT_CONNECTED")
	DispatcherErrorPrefix            = "DISPATCHER_ERROR"
	RateSErrPrfx                     = "RATES_ERROR"
	ErrNotAuthorized                 = errors.New("NOT_AUTHORIZED")
	AccountSErrPrfx                  = "ACCOUNTS_ERROR"
	ErrLoggerChanged                 = errors.New("LOGGER_CHANGED")
	ErrUnsupportedFormat             = errors.New("UNSUPPORTED_FORMAT")
	ErrNoDatabaseConn                = errors.New("NO_DATABASE_CONNECTION")
	ErrMaxIncrementsExceeded         = errors.New("MAX_INCREMENTS_EXCEEDED")
	ErrIndexOutOfBounds              = errors.New("INDEX_OUT_OF_BOUNDS")
	ErrWrongPath                     = errors.New("WRONG_PATH")
	ErrServiceAlreadyRunning         = fmt.Errorf("service already running")
	ErrMaxConcurentRPCExceededNoCaps = errors.New("max concurent rpc exceeded") // on internal we return this error for concureq
	ErrMaxConcurentRPCExceeded       = errors.New("MAX_CONCURENT_RPC_EXCEEDED") // but the codec will rewrite it with this one to be sure that we corectly dealocate the request
	ErrMaxIterationsReached          = errors.New("maximum iterations reached")
	ErrNegative                      = errors.New("NEGATIVE")
	ErrUnsupportedTPExporterType     = errors.New("UNSUPPORTED_TPEXPORTER_TYPE")
	ErrCastFailed                    = errors.New("CAST_FAILED")
	ErrCorrelationUndefined          = errors.New("CORRELATION_UNDEFINED")
	ErrUnsupportedServiceID          = errors.New(UnsupportedServiceIDCaps)

	ErrMap = map[string]error{
		ErrNoMoreData.Error():              ErrNoMoreData,
		ErrNotImplemented.Error():          ErrNotImplemented,
		ErrDSPHostNotFound.Error():         ErrDSPHostNotFound,
		ErrDSPProfileNotFound.Error():      ErrDSPProfileNotFound,
		ErrNotFound.Error():                ErrNotFound,
		ErrTimedOut.Error():                ErrTimedOut,
		ErrServerError.Error():             ErrServerError,
		ErrMaxRecursionDepth.Error():       ErrMaxRecursionDepth,
		ErrExists.Error():                  ErrExists,
		ErrBrokenReference.Error():         ErrBrokenReference,
		ErrParserError.Error():             ErrParserError,
		ErrInvalidPath.Error():             ErrInvalidPath,
		ErrInvalidKey.Error():              ErrInvalidKey,
		ErrUnauthorizedDestination.Error(): ErrUnauthorizedDestination,
		ErrRatingPlanNotFound.Error():      ErrRatingPlanNotFound,
		ErrInsufficientCredit.Error():      ErrInsufficientCredit,
		ErrNotConvertible.Error():          ErrNotConvertible,
		ErrResourceUnavailable.Error():     ErrResourceUnavailable,
		ErrResourceUnauthorized.Error():    ErrResourceUnauthorized,
		ErrNoActiveSession.Error():         ErrNoActiveSession,
		ErrPartiallyExecuted.Error():       ErrPartiallyExecuted,
		ErrMaxUsageExceeded.Error():        ErrMaxUsageExceeded,
		ErrFilterNotPassingNoCaps.Error():  ErrFilterNotPassingNoCaps,
		ErrNotConvertibleNoCaps.Error():    ErrNotConvertibleNoCaps,
		ErrUnauthorizedApi.Error():         ErrUnauthorizedApi,
		ErrUnknownApiKey.Error():           ErrUnknownApiKey,
		ErrReqUnsynchronized.Error():       ErrReqUnsynchronized,
		ErrUnsupporteServiceMethod.Error(): ErrUnsupporteServiceMethod,
		ErrDisconnected.Error():            ErrDisconnected,
		ErrReplyTimeout.Error():            ErrReplyTimeout,
		ErrSessionNotFound.Error():         ErrSessionNotFound,
		ErrJsonIncompleteComment.Error():   ErrJsonIncompleteComment,
		ErrNotEnoughParameters.Error():     ErrNotEnoughParameters,
		ErrUnsupportedFormat.Error():       ErrUnsupportedFormat,
		ErrNoDatabaseConn.Error():          ErrNoDatabaseConn,
		ErrMaxIncrementsExceeded.Error():   ErrMaxIncrementsExceeded,
		ErrIndexOutOfBounds.Error():        ErrIndexOutOfBounds,
		ErrWrongPath.Error():               ErrWrongPath,
	}
)
View Source
var AnzIndexType = StringSet{
	MetaScorch:   {},
	MetaBoltdb:   {},
	MetaLeveldb:  {},
	MetaMoss:     {},
	MetaInternal: {},
}

CGROptionsSet the possible cgr options

View Source
var RoutesDefaultRatio = 1

RoutesDefaultRatio is the default ratio value for routes when none is explicitly specified in the profile. Defined here to avoid circular dependencies with the config package.

View Source
var StringTmplType = StringSet{
	MetaConstant:        struct{}{},
	MetaVariable:        struct{}{},
	MetaComposed:        struct{}{},
	MetaUsageDifference: struct{}{},
	MetaPrefix:          struct{}{},
	MetaSuffix:          struct{}{},
	MetaSIPCID:          struct{}{},
}

StringTmplType a string set used, by agentRequest and eventRequest to determine if the returned template type is string

Functions

func AESDecrypt

func AESDecrypt(encrypted string, encKey string) (txt string, err error)

AESDecrypt will decrypt the provided encrypted txt using the encKey and AES algorithm

func AESEncrypt

func AESEncrypt(txt, encKey string) (encrypted string, err error)

AESEncrypt will encrypt the provided txt using the encKey and AES algorithm

func APIErrorHandler

func APIErrorHandler(errIn error) (err error)

Centralized returns for APIs

func BoolGenerator

func BoolGenerator() *boolGen

BoolGenerator return the boolean generator

func BoolPointer

func BoolPointer(b bool) *bool

func CastRPCErr

func CastRPCErr(err error) error

func CheckInLineFilter

func CheckInLineFilter(fltrs []string) (err error)

func CloneDecimalBig

func CloneDecimalBig(in *decimal.Big) *decimal.Big

func CompilePath

func CompilePath(spath string) (path []string)

CompilePath returns the path as a slice

func CompilePathSlice

func CompilePathSlice(spath []string) (path []string)

CompilePathSlice returns the path as a slice accepted by DataNode structure field1[field2][index], field3 will become: field1 field2 index field3

func ComputeHash

func ComputeHash(dataKeys ...string) (lns string, err error)

Hash generates the hash text

func ConcatenatedKey

func ConcatenatedKey(keyVals ...string) string

func DPDynamicInterface added in v0.10.1

func DPDynamicInterface(dnVal string, dP DataProvider) (any, error)

DPDynamicInterface returns the value of the field if the path is dynamic

func DPDynamicString added in v0.10.1

func DPDynamicString(dnVal string, dP DataProvider) (string, error)

DPDynamicString returns the string value of the field if the path is dynamic

func DecodeBase64JSON

func DecodeBase64JSON(data string, val any) (err error)

DecodeBase64JSON decodes the base64 json string in the given interface

func DecodeServerRequest

func DecodeServerRequest(r io.Reader) (req *serverRequest, err error)

func Difference

func Difference(tm string, items ...any) (diff any, err error)

Difference attempts to sum multiple items returns the result or error if not comparable

func Divide

func Divide(items ...any) (div any, err error)

Divide attempts to divide multiple items returns the result or error if not comparable

func DivideBig

func DivideBig(x, y *decimal.Big) *decimal.Big

func DivideBigWithReminder

func DivideBigWithReminder(x, y *decimal.Big) (q *decimal.Big, r *decimal.Big)

func DurationPointer

func DurationPointer(d time.Duration) *time.Duration

func EncodeBase64JSON

func EncodeBase64JSON(val any) (enc string, err error)

EncodeBase64JSON encodes the structure in json and then the string in base64

func EqualTo

func EqualTo(item, oItem any) (eq bool, err error)

func ErrEnvNotFound

func ErrEnvNotFound(key string) error

func ErrPathNotReachable

func ErrPathNotReachable(path string) error

func ErrPrefix

func ErrPrefix(err error, reason string) error

func ErrPrefixNotErrNotImplemented

func ErrPrefixNotErrNotImplemented(reason string) error

func ErrPrefixNotFound

func ErrPrefixNotFound(reason string) error

func Fib

func Fib() func() int

Fib returns successive Fibonacci numbers.

func FibDuration added in v0.10.3

func FibDuration(durationUnit, maxDuration time.Duration) func() time.Duration

FibDuration returns successive Fibonacci numbers as time.Duration with the unit specified by durationUnit or maxDuration if it is exceeded

func FirstDurationNonEmpty

func FirstDurationNonEmpty(vals ...time.Duration) time.Duration

func FirstIntNonEmpty

func FirstIntNonEmpty(vals ...int) int

func FirstNonEmpty

func FirstNonEmpty(vals ...string) string

Returns first non empty string out of vals. Useful to extract defaults

func Float64Pointer

func Float64Pointer(f float64) *float64

func FmtFieldWidth

func FmtFieldWidth(fieldID, source string, width int, strip, padding string, mandatory bool) (string, error)

Attributes

source - the base source
width - the field width
strip - if present it will specify the strip strategy, when missing strip will not be allowed
padding - if present it will specify the padding strategy to use, left, right, zeroleft, zeroright

func GenUUID

func GenUUID() string

helper function for uuid generation

func GenerateDBItemOpts

func GenerateDBItemOpts(apiKey, routeID, cache, rmtHost string) (mp map[string]any)

GenerateDBItemOpts will create the options for DB replication if they are empty they should be omitted

func GetBasicType

func GetBasicType(item any) any

func GetCGRVersion

func GetCGRVersion() (vers string, err error)

func GetEndOfMonth

func GetEndOfMonth(ref time.Time) time.Time

func GetPaginateOpts

func GetPaginateOpts(opts map[string]any) (limit, offset, maxItems int, err error)

GetPaginateOpts retrieves paginate options from the APIOpts map

func GetPathIndex

func GetPathIndex(spath string) (opath string, idx *int)

GetPathIndex returns the path and index if index present path[index]=>path,index path=>path,nil

func GetPathIndexString

func GetPathIndexString(spath string) (opath string, idx *string)

GetPathIndexString returns the path and index as string if index present path[index]=>path,index path=>path,nil

func GetReaderFromPath

func GetReaderFromPath(path string, timeout time.Duration) (r io.ReadCloser, err error)

GetReaderFromPath returns the reader at the given path

func GetRemoteIP

func GetRemoteIP(r *http.Request) (ip string, err error)

GetRemoteIP returns the IP from http request

func GetTrendLabel

func GetTrendLabel(tGrowth float64, tolerance float64) (lbl string)

GetTrendLabel determines trend direction based on growth percentage and tolerance. Returns "*positive", "*negative", "*constant", or "N/A" based on the growth value.

func GetUniformType

func GetUniformType(item any) (any, error)

func GetUniqueCDRID

func GetUniqueCDRID(cgrEv *CGREvent) string

func GetUrlRawArguments

func GetUrlRawArguments(dialURL string) (out map[string]string)

func GreaterThan

func GreaterThan(item, oItem any, orEqual bool) (gte bool, err error)

GreaterThan attempts to compare two items returns the result or error if not comparable

func HasPrefixSlice added in v0.10.2

func HasPrefixSlice(prfxs []string, el string) bool

HasPrefixSlice iterates over slice members and returns true if one the element has that prefix

func IPAllocationsLockKey

func IPAllocationsLockKey(tnt, id string) string

IPAllocationsLockKey returns the ID used to lock IP allocations with guardian

func IPProfileLockKey

func IPProfileLockKey(tnt, id string) string

IPProfileLockKey returns the ID used to lock an IPProfile with guardian

func IfaceAsBig

func IfaceAsBig(itm any) (b *decimal.Big, err error)

func IfaceAsBool

func IfaceAsBool(itm any) (b bool, err error)

func IfaceAsDuration

func IfaceAsDuration(itm any) (d time.Duration, err error)

func IfaceAsFloat64

func IfaceAsFloat64(itm any) (f float64, err error)

func IfaceAsInt

func IfaceAsInt(itm any) (i int, err error)

IfaceAsTInt converts interface to type int

func IfaceAsInt64

func IfaceAsInt64(itm any) (i int64, err error)

func IfaceAsString

func IfaceAsString(fld any) (out string)

func IfaceAsStringSlice

func IfaceAsStringSlice(fld any) (ss []string, err error)

func IfaceAsTInt64

func IfaceAsTInt64(itm any) (i int64, err error)

same function as IfaceAsInt64 but if the value is float round it to int64 instead of returning error

func IfaceAsTime

func IfaceAsTime(itm any, timezone string) (t time.Time, err error)

func InfieldSplit

func InfieldSplit(val string) []string

func Int64Pointer

func Int64Pointer(i int64) *int64

func IntPointer

func IntPointer(i int) *int

func IsPathValid

func IsPathValid(path string) (err error)

func IsPathValidForExporters

func IsPathValidForExporters(path string) (err error)

func IsURL

func IsURL(path string) bool

IsURL returns if the path is an URL

func MapStringStringEqual

func MapStringStringEqual(v1, v2 map[string]string) bool

func MapStringStringPointer

func MapStringStringPointer(mp map[string]string) *map[string]string

func MapStringToInt64

func MapStringToInt64(in map[string]string) (mapout map[string]int64, err error)

func MaskSuffix

func MaskSuffix(dest string, maskLen int) string

Mask a number of characters in the suffix of the destination

func MissingStructFields

func MissingStructFields(s any, mandatories []string) []string

Detects missing field values based on mandatory field names, s should be a pointer to a struct

func Multiply

func Multiply(items ...any) (mlt any, err error)

Multiply attempts to multiply multiple items returns the result or error if not comparable

func MultiplyBig

func MultiplyBig(x, y *decimal.Big) *decimal.Big

func NewBiJSONrpcClient

func NewBiJSONrpcClient(addr string, obj birpc.ClientConnector) (*birpc.BirpcClient, error)

NewBiJSONrpcClient will create a bidirectional JSON client connection

func NewECDSAPrvKey

func NewECDSAPrvKey(prvKeyPath string, timeout time.Duration) (prvKey *ecdsa.PrivateKey, err error)

NewECDSAPrvKey creates a private key from the path

func NewECDSAPrvKeyFromReader

func NewECDSAPrvKeyFromReader(reader io.Reader) (prvKey *ecdsa.PrivateKey, err error)

NewECDSAPrvKeyFromReader creates a private key from io.Reader

func NewECDSAPubKey

func NewECDSAPubKey(pubKeyPath string, timeout time.Duration) (pubKey *ecdsa.PublicKey, err error)

NewECDSAPubKey returns a public key from the path

func NewECDSAPubKeyFromReader

func NewECDSAPubKeyFromReader(reader io.Reader) (pubKey *ecdsa.PublicKey, err error)

NewECDSAPubKeyFromReader returns a public key from io.Reader

func NewErrAccountS

func NewErrAccountS(err error) error

func NewErrAttributeS

func NewErrAttributeS(err error) error

func NewErrCDRS

func NewErrCDRS(err error) error

func NewErrChargerS added in v0.10.1

func NewErrChargerS(err error) error

func NewErrDispatcherS

func NewErrDispatcherS(err error) error

func NewErrIPs

func NewErrIPs(err error) error

func NewErrMandatoryIeMissing

func NewErrMandatoryIeMissing(fields ...string) error

func NewErrNotConnected

func NewErrNotConnected(serv string) error

func NewErrRateS

func NewErrRateS(err error) error

func NewErrResourceS

func NewErrResourceS(err error) error

func NewErrRouteS

func NewErrRouteS(err error) error

func NewErrServerError

func NewErrServerError(err error) error

func NewErrStatS

func NewErrStatS(err error) error

func NewErrThresholdS

func NewErrThresholdS(err error) error

func NewRoundingMode

func NewRoundingMode(rnd string) (decimal.RoundingMode, error)

func NewSTIRError

func NewSTIRError(reason string) error

NewSTIRError returns a error with a *stir_authorize prefix

func NewServerRequest

func NewServerRequest(method string, params, id json.RawMessage) *serverRequest

NewServerRequest used in registrarc tests

func NewServiceStateTimeoutError

func NewServiceStateTimeoutError(sourceID, srvID, stateID string) error

NewServiceTimeoutError is called when waiting

func OptAsBool

func OptAsBool(opts map[string]any, name string) (b bool)

func OptAsBoolOrDef

func OptAsBoolOrDef(opts map[string]any, name string, def bool) (b bool)

func OptAsStringSlice

func OptAsStringSlice(opts map[string]any, name string) (b []string, err error)

func Paginate

func Paginate[E any](in []E, limit, offset, maxItems int) (out []E, err error)

Paginate returns a modified input sting based on the paginate options provided

func ParseBinarySize

func ParseBinarySize(size string) (int64, error)

ParseBinarySize converts string byte sizes (b, kb, mb, gb) to byte int64

func ParseDurationWithNanosecs

func ParseDurationWithNanosecs(durStr string) (d time.Duration, err error)

Parses duration, considers s as time unit if not provided, seconds as float to specify subunits

func ParseDurationWithSecs

func ParseDurationWithSecs(durStr string) (d time.Duration, err error)

Parses duration, considers s as time unit if not provided, seconds as float to specify subunits

func ParseTimeDetectLayout

func ParseTimeDetectLayout(tmStr string, timezone string) (time.Time, error)

ParseTimeDetectLayout returns the time from string

func PrefixSliceItems

func PrefixSliceItems(prfx string, slc []string) (out []string)

PrefixSliceItems iterates through slice and add a prefix before every element

func RandomInteger

func RandomInteger(min, max int64) int64

func RankingProfileLockKey

func RankingProfileLockKey(tnt, id string) string

RankingProfileLockKey returns the ID used to lock a RankingProfile with guardian.

func RankingSortStats

func RankingSortStats(sortingType string, sortingParams []string,
	Metrics map[string]map[string]float64) (sortedStatIDs []string, err error)

RankingSortStats sorts stat IDs based on their metrics according to the specified sorting strategy.

func ReflectFieldMethodInterface

func ReflectFieldMethodInterface(obj any, fldName string) (retIf any, err error)

ReflectFieldMethodInterface parses intf attepting to return the field value or error otherwise Supports "ExtraFields" where additional fields are dynamically inserted in map with field name: extraFieldsLabel

func RemoveWhiteSpaces

func RemoveWhiteSpaces(str string) string

RemoveWhiteSpaces removes white spaces from string

func ResourceLockKey

func ResourceLockKey(tnt, id string) string

ResourceLockKey returns the ID used to lock a resource with guardian

func ResourceProfileLockKey

func ResourceProfileLockKey(tnt, id string) string

ResourceProfileLockKey returns the ID used to lock a resourceProfile with guardian

func ReverseString

func ReverseString(s string) string

func Round

func Round(x float64, prec int, method string) float64

Round return rounded version of x with prec precision.

Special cases are:

Round(±0) = ±0
Round(±Inf) = ±Inf
Round(NaN) = NaN

func RoundStatDuration

func RoundStatDuration(x time.Duration, prec int) time.Duration

RoundStatDuration is used in engine package for stat metrics that has duration (e.g acd metric, tcd metric, etc...)

func RoundingModeToString

func RoundingModeToString(rnd decimal.RoundingMode) string

func Sha1

func Sha1(attrs ...string) string

Sha1 generate the SHA1 hash from any string the order of string matters

func SizeFmt

func SizeFmt(num float64, suffix string) string

formats number in K,M,G, etc.

func SliceStringPointer

func SliceStringPointer(d []string) *[]string

func SliceStringToIface

func SliceStringToIface(slc []string) (ifc []any)

SliceStringToIface converts slice of strings into a slice of interfaces

func SplitConcatenatedKey

func SplitConcatenatedKey(key string) []string

func SplitPath

func SplitPath(rule string, sep byte, n int) []string

SplitPath splits filter rules based on the specified separator

func SplitPrefix

func SplitPrefix(prefix string, minLength int) []string

func SplitSuffix

func SplitSuffix(suffix string) []string

func StringAsBig

func StringAsBig(itm string) (b *decimal.Big, err error)

func StringPointer

func StringPointer(str string) *string

Utilities to provide pointers where we need to define ad-hoc

func StringToInterface

func StringToInterface(s string) any

StringToInterface will parse string into supported types if no other conversion possible, original string will be returned

func StructChanTimeout

func StructChanTimeout(chn chan struct{}, timeout time.Duration) bool

StructChanTimeout will return true if timeout occurs before struct is received

func SubstractBig

func SubstractBig(x, y *decimal.Big) *decimal.Big

func Sum

func Sum(items ...any) (sum any, err error)

Sum attempts to sum multiple items returns the result or error if not comparable

func SumBig

func SumBig(x, y *decimal.Big) *decimal.Big

func TimePointer

func TimePointer(t time.Time) *time.Time

func ToIJSON

func ToIJSON(v any) string

func ToJSON

func ToJSON(v any) string

func ToUnescapedJSON

func ToUnescapedJSON(value any) (bts []byte, err error)

func UUIDSha1Prefix

func UUIDSha1Prefix() string

UUIDSha1Prefix generates a prefix of the sha1 applied to an UUID prefix 8 is chosen since the probability of colision starts being minimal after 7 characters (see git commits)

func Unzip

func Unzip(src, dest string) error

Splited Unzip in small functions to have better coverage

func UpdateStructWithIfaceMap

func UpdateStructWithIfaceMap(s any, mp map[string]any) (err error)

UpdateStructWithIfaceMap will update struct fields with values coming from map if map values are not matching the ones in struct convertion is being attempted ToDo: add here more fields

func VerifyHash

func VerifyHash(hash string, dataKeys ...string) bool

VerifyHash matches the data hash with the dataKeys ha

func WatchDir

func WatchDir(dirPath string, f func(itmID string) error, sysID string, stopWatching chan struct{}) (err error)

WatchDir sets up a watcher via inotify to be triggered on new files sysID is the subsystem ID, f will be triggered on match

func WriteServerResponse

func WriteServerResponse(w io.Writer, id *json.RawMessage, result, err any) error

Types

type APAction

type APAction struct {
	ID        string         // Action ID
	FilterIDs []string       // Action FilterIDs
	TTL       time.Duration  // Cancel Action if not executed within TTL
	Type      string         // Type of Action
	Opts      map[string]any // Extra options to pass depending on action type
	Diktats   []*APDiktat
}

APAction defines action related information used within an ActionProfile.

func (*APAction) Clone

func (a *APAction) Clone() *APAction

Clone clones APAction

func (*APAction) FieldAsInterface

func (a *APAction) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*APAction) FieldAsString

func (a *APAction) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*APAction) Merge

func (a *APAction) Merge(v2 *APAction)

Merge combines the values from another APAction into this one.

func (*APAction) Set

func (a *APAction) Set(path []string, val any, newBranch bool) (err error)

Set implements the profile interface, setting values in APAction based on path.

func (*APAction) String

func (a *APAction) String() string

String implements the DataProvider interface, returning the APAction in JSON format.

type APDiktat

type APDiktat struct {
	Path  string // Path to execute
	Value string // Value to execute on Path
	// contains filtered or unexported fields
}

APDiktat defines a path and value operation to be executed by an action.

func (*APDiktat) Clone

func (d *APDiktat) Clone() *APDiktat

Clone clones APAction

func (*APDiktat) FieldAsInterface

func (dk *APDiktat) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*APDiktat) FieldAsString

func (dk *APDiktat) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*APDiktat) RSRValues

func (dk *APDiktat) RSRValues() (RSRParsers, error)

RSRValues returns the Value as RSRParsers or creates new ones if not initialized.

func (*APDiktat) String

func (dk *APDiktat) String() string

String implements the DataProvider interface, returning the APDiktat in JSON format.

type APIAttributeProfile

type APIAttributeProfile struct {
	Tenant    string
	ID        string
	FilterIDs []string
	Blockers  DynamicBlockers
	//Blocker    bool // blocker flag to stop processing on multiple runs
	Weights    DynamicWeights
	Attributes []*ExternalAttribute
}

APIAttributeProfile represents the external representation used by APIs.

func NewAPIAttributeProfile

func NewAPIAttributeProfile(attr *AttributeProfile) (ext *APIAttributeProfile)

NewAPIAttributeProfile creates an external representation from an AttributeProfile.

func (*APIAttributeProfile) AsAttributeProfile

func (ext *APIAttributeProfile) AsAttributeProfile() (attr *AttributeProfile, err error)

AsAttributeProfile converts the external attribute format to the actual AttributeProfile.

type APIAttributeProfileWithAPIOpts

type APIAttributeProfileWithAPIOpts struct {
	*APIAttributeProfile
	APIOpts map[string]any
}

APIAttributeProfileWithAPIOpts wraps APIAttributeProfile with APIOpts.

type APIEventCharges

type APIEventCharges struct {
	Tenant  string
	APIOpts map[string]any
	*EventCharges
}

APIEventCharges is used in APIs, ie: refundCharges

type APIIntervalRate

type APIIntervalRate struct {
	IntervalStart string
	FixedFee      *float64
	RecurrentFee  *float64
	Unit          *float64 // RateUnit
	Increment     *float64 // RateIncrement
}

func (*APIIntervalRate) AsIntervalRate

func (ext *APIIntervalRate) AsIntervalRate() (iRate *IntervalRate, err error)

AsIntervalRate converts APIIntervalRate to IntervalRate

type APIRate

type APIRate struct {
	ID              string   // RateID
	FilterIDs       []string // RateFilterIDs
	ActivationTimes string   // ActivationTimes is a cron formatted time interval
	Weights         string   // RateWeights will decide the winner per interval start
	Blocker         bool     // RateBlocker will make this rate recurrent, deactivating further intervals
	IntervalRates   []*APIIntervalRate
}

func (*APIRate) AsRate

func (ext *APIRate) AsRate() (rate *Rate, err error)

AsRate converts APIRate to Rate

type APIRateProfile

type APIRateProfile struct {
	*RateProfile
	APIOpts map[string]any
}

type Account

type Account struct {
	Tenant       string
	ID           string // Account identificator, unique within the tenant
	FilterIDs    []string
	Weights      DynamicWeights
	Blockers     DynamicBlockers
	Opts         map[string]any
	Balances     map[string]*Balance
	ThresholdIDs []string
}

Account represents one Account on a Tenant

func (*Account) AccountBalancesBackup

func (ap *Account) AccountBalancesBackup() (abb AccountBalancesBackup)

AccountBalancesBackup returns a backup of all balance values

func (*Account) BalancesAltered

func (ap *Account) BalancesAltered(abb AccountBalancesBackup) (altred bool)

BalancesAltered detects altering of the Balances by comparing the Balance values with the ones from backup

func (*Account) CacheClone

func (acc *Account) CacheClone() any

CacheClone returns a clone of Account used by ltcache CacheCloner

func (*Account) Clone

func (acc *Account) Clone() (cln *Account)

Clone returns a clone of the Account

func (*Account) Equals

func (aC *Account) Equals(acnt *Account) (eq bool)

Equals return the equality between two Accounts

func (*Account) FieldAsInterface

func (ap *Account) FieldAsInterface(fldPath []string) (_ any, err error)

func (*Account) FieldAsString

func (ap *Account) FieldAsString(fldPath []string) (_ string, err error)

func (*Account) Merge

func (ap *Account) Merge(v2 any)

func (*Account) RestoreFromBackup

func (ap *Account) RestoreFromBackup(abb AccountBalancesBackup)

func (*Account) Set

func (ap *Account) Set(path []string, val any, newBranch bool) (err error)

func (*Account) String

func (ap *Account) String() string

func (*Account) TenantID

func (aP *Account) TenantID() string

TenantID returns the combined Tenant:ID

type AccountBalancesBackup

type AccountBalancesBackup map[string]*decimal.Big

AccountBalanceBackups is used to create balance snapshots as backups

type AccountCharge

type AccountCharge struct {
	AccountID       string
	BalanceID       string
	Units           *Decimal
	BalanceLimit    *Decimal // the minimum balance value accepted
	UnitFactorID    string   // identificator in ChargingUnitFactors
	AttributeIDs    []string // list of attribute profiles matched
	RatingID        string   // identificator in cost increments
	JoinedChargeIDs []string // identificator of extra account charges
}

AccountCharge represents one Account charge

func (*AccountCharge) Clone

func (ac *AccountCharge) Clone() *AccountCharge

Clone returns a copy of ac

func (*AccountCharge) FieldAsInterface

func (ac *AccountCharge) FieldAsInterface(fldPath []string) (any, error)

type AccountWithAPIOpts

type AccountWithAPIOpts struct {
	*Account
	APIOpts map[string]any
}

type AccountWithLock

type AccountWithLock struct {
	*Account
	LockID string
}

AccountWithLock wraps Account with LockID.

type Accounts

type Accounts []*AccountWithLock

Accounts is a collection of AccountWithLock objects

func (Accounts) Account

func (apWws Accounts) Account(acntID string) (acnt *Account)

Account returns the Account object with ID

func (Accounts) Accounts

func (apWws Accounts) Accounts() (aps []*Account)

Accounts returns the list of Account

func (Accounts) LockIDs

func (apWws Accounts) LockIDs() (lkIDs []string)

LockIDs returns the list of LockIDs

type ActionProfile

type ActionProfile struct {
	Tenant    string
	ID        string
	FilterIDs []string
	Weights   DynamicWeights
	Blockers  DynamicBlockers
	Schedule  string
	Targets   map[string]StringSet

	Actions []*APAction
}

ActionProfile represents the configuration of an Action profile.

func (*ActionProfile) CacheClone

func (ap *ActionProfile) CacheClone() any

CacheClone returns a clone of ActionProfile used by ltcache CacheCloner

func (*ActionProfile) Clone

func (ap *ActionProfile) Clone() *ActionProfile

Clone clones ActionProfile

func (*ActionProfile) FieldAsInterface

func (ap *ActionProfile) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*ActionProfile) FieldAsString

func (ap *ActionProfile) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*ActionProfile) Merge

func (ap *ActionProfile) Merge(v2 any)

Merge implements the profile interface, merging values from another ActionProfile.

func (*ActionProfile) Set

func (ap *ActionProfile) Set(path []string, val any, newBranch bool) (err error)

Set implements the profile interface, setting values in ActionProfile based on path.

func (*ActionProfile) String

func (ap *ActionProfile) String() string

String implements the DataProvider interface, returning the ActionProfile in JSON format.

func (*ActionProfile) TenantID

func (ap *ActionProfile) TenantID() string

TenantID returns the concatenated tenant and ID.

type ActionProfileWithAPIOpts

type ActionProfileWithAPIOpts struct {
	*ActionProfile
	APIOpts map[string]any
}

ActionProfileWithAPIOpts wraps ActionProfile with APIOpts.

type ActivationInterval

type ActivationInterval struct {
	ActivationTime time.Time
	ExpiryTime     time.Time
}

func (*ActivationInterval) Clone

Clone returns a clone of the ActivationInterval

func (*ActivationInterval) Equals

func (aI *ActivationInterval) Equals(actInt *ActivationInterval) (eq bool)

func (*ActivationInterval) IsActiveAtTime

func (ai *ActivationInterval) IsActiveAtTime(atTime time.Time) bool

type ArgCacheReplicateRemove

type ArgCacheReplicateRemove struct {
	CacheID string
	ItemID  string
	APIOpts map[string]any
	Tenant  string
}

type ArgCacheReplicateSet

type ArgCacheReplicateSet struct {
	Tenant   string
	APIOpts  map[string]any
	CacheID  string
	ItemID   string
	Value    any
	GroupIDs []string
}

type ArgExportCDRs

type ArgExportCDRs struct {
	ExporterIDs []string // exporterIDs is used to said which exporter are using to export the cdrs
	Verbose     bool     // verbose is used to inform the user about the positive and negative exported cdrs
	RPCCDRsFilter
}

type ArgExportToFolder

type ArgExportToFolder struct {
	Path  string
	Items []string
}

type ArgGetTrend

type ArgGetTrend struct {
	TenantWithAPIOpts
	ID            string
	RunIndexStart int
	RunIndexEnd   int
	RunTimeStart  string
	RunTimeEnd    string
}

type ArgScheduleRankingQueries

type ArgScheduleRankingQueries struct {
	TenantIDWithAPIOpts
	RankingIDs []string
}

type ArgScheduleTrendQueries

type ArgScheduleTrendQueries struct {
	TenantIDWithAPIOpts
	TrendIDs []string
}

type ArgScheduledRankings

type ArgScheduledRankings struct {
	TenantIDWithAPIOpts
	RankingIDPrefixes []string
}

type ArgScheduledTrends

type ArgScheduledTrends struct {
	TenantIDWithAPIOpts
	TrendIDPrefixes []string
}

type ArgsActRemoveBalances

type ArgsActRemoveBalances struct {
	Tenant     string
	AccountID  string
	BalanceIDs []string
	APIOpts    map[string]any
}

type ArgsActSetBalance

type ArgsActSetBalance struct {
	Tenant    string
	AccountID string
	Diktats   []*BalDiktat
	Reset     bool
	APIOpts   map[string]any
}

type ArgsComputeFilterIndexIDs

type ArgsComputeFilterIndexIDs struct {
	Tenant           string
	APIOpts          map[string]any
	AttributeIDs     []string
	ResourceIDs      []string
	IPIDs            []string
	StatIDs          []string
	RouteIDs         []string
	ThresholdIDs     []string
	ChargerIDs       []string
	RateProfileIDs   []string
	AccountIDs       []string
	ActionProfileIDs []string
}

type ArgsComputeFilterIndexes

type ArgsComputeFilterIndexes struct {
	Tenant     string
	APIOpts    map[string]any
	AttributeS bool
	ResourceS  bool
	IPs        bool
	StatS      bool
	RouteS     bool
	ThresholdS bool
	ChargerS   bool
	RateS      bool
	AccountS   bool
	ActionS    bool
}

type ArgsFailedPosts

type ArgsFailedPosts struct {
	Tenant    string
	Path      string         // Path of the exported type
	Event     any            // Event that must be written in file
	FailedDir string         // Directory that contains the file with Failed post
	Module    string         // Type of efs <*ees|*kafkaLogger>
	APIOpts   map[string]any // Specially for the meta
}

type ArgsGetCacheItem

type ArgsGetCacheItem struct {
	CacheID string
	ItemID  string
}

type ArgsGetCacheItemIDs

type ArgsGetCacheItemIDs struct {
	CacheID      string
	ItemIDPrefix string
}

type ArgsGetCacheItemIDsWithAPIOpts

type ArgsGetCacheItemIDsWithAPIOpts struct {
	APIOpts map[string]any
	Tenant  string
	ArgsGetCacheItemIDs
}

type ArgsGetCacheItemWithAPIOpts

type ArgsGetCacheItemWithAPIOpts struct {
	APIOpts map[string]any
	Tenant  string
	ArgsGetCacheItem
}

type ArgsGetGroup

type ArgsGetGroup struct {
	CacheID string
	GroupID string
}

type ArgsGetGroupWithAPIOpts

type ArgsGetGroupWithAPIOpts struct {
	APIOpts map[string]any
	Tenant  string
	ArgsGetGroup
}

type ArgsItemIDs

type ArgsItemIDs struct {
	Tenant      string
	APIOpts     map[string]any
	ItemsPrefix string
}

type ArgsSubItemIDs

type ArgsSubItemIDs struct {
	Tenant      string
	ProfileID   string
	APIOpts     map[string]any
	ItemsPrefix string
}

type AttrCacheIDsWithAPIOpts

type AttrCacheIDsWithAPIOpts struct {
	APIOpts  map[string]any
	Tenant   string
	CacheIDs []string
}

type AttrDirExportTP

type AttrDirExportTP struct {
	TPid           *string
	FileFormat     *string // Format of the exported file <csv>
	FieldSeparator *string // Separator used between fields
	ExportPath     *string // If provided it overwrites the configured export path
	Compress       *bool   // If true the folder will be compressed after export performed
}

type AttrDisconnectSession

type AttrDisconnectSession struct {
	EventStart map[string]any
	Reason     string
}

Attributes to send on SessionDisconnect by SMG

type AttrGetCdrs

type AttrGetCdrs struct {
	//CgrIds          []string // If provided, it will filter based on the cgrids present in list
	MediationRunIds []string // If provided, it will filter on mediation runid

	TORs                []string // If provided, filter on TypeOfRecord
	CdrHosts            []string // If provided, it will filter cdrhost
	CdrSources          []string // If provided, it will filter cdrsource
	ReqTypes            []string // If provided, it will fiter reqtype
	Tenants             []string // If provided, it will filter tenant
	Categories          []string // If provided, it will filter çategory
	Accounts            []string // If provided, it will filter account
	Subjects            []string // If provided, it will filter the rating subject
	DestinationPrefixes []string // If provided, it will filter on destination prefix
	RatedAccounts       []string // If provided, it will filter ratedaccount
	RatedSubjects       []string // If provided, it will filter the ratedsubject
	OrderIdStart        *int64   // Export from this order identifier
	OrderIdEnd          *int64   // Export smaller than this order identifier
	TimeStart           string   // If provided, it will represent the starting of the CDRs interval (>=)
	TimeEnd             string   // If provided, it will represent the end of the CDRs interval (<)
	SkipErrors          bool     // Do not export errored CDRs
	SkipRated           bool     // Do not export rated CDRs
	OrderBy             string   // Ascendent/Descendent
	Paginator
}

type AttrImportTPFromFolder

type AttrImportTPFromFolder struct {
	TPid         string
	FolderPath   string
	RunId        string
	CsvSeparator string
	APIOpts      map[string]any
}

type AttrLoadTpFromFolder

type AttrLoadTpFromFolder struct {
	FolderPath string // Take files from folder absolute path
	DryRun     bool   // Do not write to database but parse only
	APIOpts    map[string]any
	Caching    *string
}

type AttrReloadCacheWithAPIOpts

type AttrReloadCacheWithAPIOpts struct {
	APIOpts map[string]any `json:",omitempty"`
	Tenant  string         `json:",omitempty"`

	ResourceProfileIDs   []string `json:",omitempty"`
	ResourceIDs          []string `json:",omitempty"`
	IPProfileIDs         []string `json:",omitempty"`
	IPIDs                []string `json:",omitempty"`
	StatsQueueIDs        []string `json:",omitempty"`
	StatsQueueProfileIDs []string `json:",omitempty"`
	ThresholdIDs         []string `json:",omitempty"`
	ThresholdProfileIDs  []string `json:",omitempty"`
	TrendIDs             []string `json:",omitempty"`
	TrendProfileIDs      []string `json:",omitempty"`
	RankingProfileIDs    []string `json:",omitempty"`
	RankingIDs           []string `json:",omitempty"`
	FilterIDs            []string `json:",omitempty"`
	RouteProfileIDs      []string `json:",omitempty"`
	AttributeProfileIDs  []string `json:",omitempty"`
	ChargerProfileIDs    []string `json:",omitempty"`
	RateProfileIDs       []string `json:",omitempty"`
	ActionProfileIDs     []string `json:",omitempty"`
	AccountIDs           []string `json:",omitempty"`

	AttributeFilterIndexIDs      []string `json:",omitempty"`
	ResourceFilterIndexIDs       []string `json:",omitempty"`
	IPFilterIndexIDs             []string `json:",omitempty"`
	StatFilterIndexIDs           []string `json:",omitempty"`
	ThresholdFilterIndexIDs      []string `json:",omitempty"`
	RouteFilterIndexIDs          []string `json:",omitempty"`
	ChargerFilterIndexIDs        []string `json:",omitempty"`
	RateProfilesFilterIndexIDs   []string `json:",omitempty"`
	RateFilterIndexIDs           []string `json:",omitempty"`
	FilterIndexIDs               []string `json:",omitempty"`
	ActionProfilesFilterIndexIDs []string `json:",omitempty"`
	AccountsFilterIndexIDs       []string `json:",omitempty"`
}

func NewAttrReloadCacheWithOpts

func NewAttrReloadCacheWithOpts() *AttrReloadCacheWithAPIOpts

NewAttrReloadCacheWithOpts returns the ArgCache populated with nil

func NewAttrReloadCacheWithOptsFromMap

func NewAttrReloadCacheWithOptsFromMap(arg map[string][]string, tnt string, opts map[string]any) *AttrReloadCacheWithAPIOpts

func (*AttrReloadCacheWithAPIOpts) Map

func (a *AttrReloadCacheWithAPIOpts) Map() map[string][]string

type AttrRemoteLock

type AttrRemoteLock struct {
	ReferenceID string        // reference ID for this lock if available
	LockIDs     []string      // List of IDs to obtain lock for
	Timeout     time.Duration // Automatically unlock on timeout
}

type Attribute

type Attribute struct {
	FilterIDs []string
	Blockers  DynamicBlockers // Blockers flag to stop processing on multiple attributes from a profile
	Path      string
	Type      string
	Value     RSRParsers
}

Attribute defines a single attribute.

func (*Attribute) Clone

func (a *Attribute) Clone() *Attribute

Clone method for Attribute

func (*Attribute) FieldAsInterface

func (a *Attribute) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface retrieves field value as interface from Attribute.

func (*Attribute) FieldAsString

func (a *Attribute) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString retrieves field value as string from Attribute.

func (*Attribute) String

func (a *Attribute) String() string

String returns the Attribute in JSON format.

type AttributeProfile

type AttributeProfile struct {
	Tenant     string
	ID         string
	FilterIDs  []string
	Weights    DynamicWeights
	Blockers   DynamicBlockers // Blockers flag to stop processing on multiple runs
	Attributes []*Attribute
}

AttributeProfile defines the configuration of attributes for processing.

func NewAttributeFromInline

func NewAttributeFromInline(tenant, inlnRule string) (attr *AttributeProfile, err error)

NewAttributeFromInline parses an inline rule into a compiled AttributeProfile.

func (*AttributeProfile) CacheClone

func (ap *AttributeProfile) CacheClone() any

CacheClone returns a clone of AttributeProfile used by ltcache CacheCloner

func (*AttributeProfile) Clone

func (ap *AttributeProfile) Clone() *AttributeProfile

Clone method for AttributeProfile struct

func (*AttributeProfile) Compile

func (ap *AttributeProfile) Compile() error

Compile is a wrapper for convenience setting up the AttributeProfile.

func (*AttributeProfile) FieldAsInterface

func (ap *AttributeProfile) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*AttributeProfile) FieldAsString

func (ap *AttributeProfile) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*AttributeProfile) Merge

func (ap *AttributeProfile) Merge(v2 any)

Merge implements the profile interface, merging values from another AttributeProfile.

func (*AttributeProfile) Set

func (ap *AttributeProfile) Set(path []string, val any, newBranch bool) (err error)

Set implements the profile interface, setting values in AttributeProfile based on path.

func (*AttributeProfile) String

func (ap *AttributeProfile) String() string

String implements the DataProvider interface, returning the AttributeProfile in JSON format.

func (*AttributeProfile) TenantID

func (ap *AttributeProfile) TenantID() string

TenantID returns the concatenated tenant and ID.

func (*AttributeProfile) TenantIDInline

func (ap *AttributeProfile) TenantIDInline() string

TenantIDInline returns the ID for inline processing, keeping meta prefixes intact.

type AttributeProfileWithAPIOpts

type AttributeProfileWithAPIOpts struct {
	*AttributeProfile
	APIOpts map[string]any
}

AttributeProfileWithAPIOpts wraps AttributeProfile with APIOpts.

type BSONMarshaler

type BSONMarshaler struct{}

func (BSONMarshaler) Marshal

func (BSONMarshaler) Marshal(v any) ([]byte, error)

func (BSONMarshaler) Unmarshal

func (BSONMarshaler) Unmarshal(data []byte, v any) error

type BalDiktat

type BalDiktat struct {
	Path  string
	Value string
}

type Balance

type Balance struct {
	ID             string // Balance identificator, unique within an Account
	FilterIDs      []string
	Weights        DynamicWeights
	Blockers       DynamicBlockers
	Type           string
	Units          *Decimal
	UnitFactors    []*UnitFactor
	Opts           map[string]any
	CostIncrements []*CostIncrement
	AttributeIDs   []string
	RateProfileIDs []string
}

Balance represents one Balance inside an Account

func NewDefaultBalance

func NewDefaultBalance(id string) *Balance

NewDefaultBalance returns a balance with default costIncrements

func (*Balance) Clone

func (blnc *Balance) Clone() (cln *Balance)

Clone return a clone of the Balance

func (*Balance) Equals

func (bL *Balance) Equals(bal *Balance) (eq bool)

Equals returns the equality between two Balance

func (*Balance) FieldAsInterface

func (bL *Balance) FieldAsInterface(fldPath []string) (_ any, err error)

func (*Balance) FieldAsString

func (bL *Balance) FieldAsString(fldPath []string) (_ string, err error)

func (*Balance) Merge

func (bL *Balance) Merge(vi *Balance)

func (*Balance) Set

func (bL *Balance) Set(path []string, val any, newBranch bool) (err error)

func (*Balance) String

func (bL *Balance) String() string

type BalanceWithWeight

type BalanceWithWeight struct {
	*Balance
	Weight float64
}

BalanceWithWeight attaches static Weight to Balance

type BalancesWithWeight

type BalancesWithWeight []*BalanceWithWeight

BalancesWithWeight is a sortable list of BalanceWithWeight

func (BalancesWithWeight) Balances

func (bWws BalancesWithWeight) Balances() (blncs []*Balance)

Balances returns the list of Balances

func (BalancesWithWeight) Sort

func (blcs BalancesWithWeight) Sort()

Sort is part of sort interface, sort based on Weight

type BincMarshaler

type BincMarshaler struct {
	// contains filtered or unexported fields
}

func NewBincMarshaler

func NewBincMarshaler() *BincMarshaler

func (*BincMarshaler) Marshal

func (bm *BincMarshaler) Marshal(v any) (b []byte, err error)

func (*BincMarshaler) Unmarshal

func (bm *BincMarshaler) Unmarshal(data []byte, v any) error

type CDR

type CDR struct {
	Tenant    string
	Opts      map[string]any
	Event     map[string]any
	CreatedAt time.Time  `json:",omitempty"`
	UpdatedAt time.Time  `json:",omitempty"`
	DeletedAt *time.Time `json:",omitempty"`
}

func (*CDR) CGREvent

func (cdr *CDR) CGREvent() *CGREvent

type CDRFilters

type CDRFilters struct {
	Tenant    string
	ID        string
	FilterIDs []string
	APIOpts   map[string]any
}

type CDRSQLTable

type CDRSQLTable struct {
	ID        int64 // this is used for incrementing while seting
	Tenant    string
	Opts      JSONB      `gorm:"type:jsonb"` //string
	Event     JSONB      `gorm:"type:jsonb"` //string
	CreatedAt time.Time  `json:",omitempty"`
	UpdatedAt time.Time  `json:",omitempty"`
	DeletedAt *time.Time `json:",omitempty"`
}

func (CDRSQLTable) TableName

func (CDRSQLTable) TableName() string

type CGRError

type CGRError struct {
	// contains filtered or unexported fields
}

CGRError is a context based error returns always errorMessage but this can be switched based on methods called on it

func NewCGRError

func NewCGRError(context, apiErr, shortErr, longErr string) *CGRError

NewCGRError initialises a new CGRError

func (*CGRError) ActivateAPIError

func (err *CGRError) ActivateAPIError()

func (*CGRError) ActivateLongError

func (err *CGRError) ActivateLongError()

func (*CGRError) ActivateShortError

func (err *CGRError) ActivateShortError()

func (*CGRError) Context

func (err *CGRError) Context() string

func (*CGRError) Error

func (err *CGRError) Error() string

type CGREvent

type CGREvent struct {
	Tenant  string
	ID      string
	Event   map[string]any
	APIOpts map[string]any
	// contains filtered or unexported fields
}

CGREvent is a generic event processed by CGR services

func CDRsToCGREvents

func CDRsToCGREvents(cdrs []*CDR) []*CGREvent

CDRsToCGREvents converts a slice of *CDR to a slice of *utils.CGREvent.

func NMAsCGREvent

func NMAsCGREvent(nM *OrderedNavigableMap, tnt string, pathSep string, opts MapStorage) (cgrEv *CGREvent)

NMAsCGREvent builds a CGREvent considering Time as time.Now() and Event as linear map[string]any with joined paths treats particular case when the value of map is []*NMItem - used in agents/AgentRequest

func (*CGREvent) AsDataProvider

func (cgrEv *CGREvent) AsDataProvider() (ev MapStorage)

AsDataProvider returns the CGREvent as MapStorage with *opts and *req paths set

func (*CGREvent) CacheClone

func (ev *CGREvent) CacheClone() any

CacheClone returns a clone of CGREvent used by ltcache CacheCloner

func (*CGREvent) CheckMandatoryFields

func (ev *CGREvent) CheckMandatoryFields(fldNames []string) error

func (*CGREvent) Clone

func (ev *CGREvent) Clone() (clned *CGREvent)

func (*CGREvent) FieldAsDuration

func (ev *CGREvent) FieldAsDuration(fldName string) (d time.Duration, err error)

FieldAsDuration returns a field as Duration instance

func (*CGREvent) FieldAsString

func (ev *CGREvent) FieldAsString(fldName string) (val string, err error)

FieldAsString returns a field as string instance

func (*CGREvent) FieldAsTime

func (ev *CGREvent) FieldAsTime(fldName string, timezone string) (t time.Time, err error)

FieldAsTime returns a field as Time instance

func (*CGREvent) HasField

func (ev *CGREvent) HasField(fldName string) (has bool)

func (*CGREvent) OptAsInt64

func (ev *CGREvent) OptAsInt64(optName string) (int64, error)

OptAsInt64 returns an option as int64

func (*CGREvent) RPCClone

func (attr *CGREvent) RPCClone() (any, error)

RPCClone implements rpcclient.RPCCloner interface

func (*CGREvent) SetCloneable

func (attr *CGREvent) SetCloneable(rpcCloneable bool)

SetCloneable sets if the args should be clonned on internal connections

type CGREventWithEeIDs

type CGREventWithEeIDs struct {
	EeIDs []string
	*CGREvent
}

CGREventWithEeIDs is the CGREventWithOpts with EventExporterIDs

func (CGREventWithEeIDs) RPCClone

func (CGREventWithEeIDs) RPCClone()

type CGREventWithRateProfile

type CGREventWithRateProfile struct {
	RateProfileID string
	*CGREvent
}

CGREventWithRateProfile is used to get the rates prom a specific RatePRofileID that is matching our Event

type CachedRPCResponse

type CachedRPCResponse struct {
	Result any
	Error  error
}

CachedRPCResponse is used to cache a RPC response

type CgrIORecordWriter

type CgrIORecordWriter struct {
	// contains filtered or unexported fields
}

CgrIORecordWriter implements CgrRecordWriter

func NewNopFlushWriter

func NewNopFlushWriter(w io.Writer) *CgrIORecordWriter

NewNopFlushWriter return CgrRecordWriter that will replace csv.Writer

func (*CgrIORecordWriter) Flush

func (*CgrIORecordWriter) Flush()

Flush only to implement CgrRecordWriter ToDo: make sure we properly handle this method

func (*CgrIORecordWriter) Write

func (rw *CgrIORecordWriter) Write(record []string) error

Write into the Writer the record

type ChargeEntry

type ChargeEntry struct {
	ChargingID     string
	CompressFactor int
}

ChargeEntry is a reference towards Accounting or Rating ID (depending on request type)

func (*ChargeEntry) Clone

func (ce *ChargeEntry) Clone() *ChargeEntry

Clone returns a copy of ce

func (*ChargeEntry) CompressEquals

func (cE *ChargeEntry) CompressEquals(chEn *ChargeEntry) bool

Equals return the equality between two ChargeEntry ignoring CompressFactor

func (*ChargeEntry) FieldAsInterface

func (ce *ChargeEntry) FieldAsInterface(fldPath []string) (_ any, err error)

type ChargerProfile

type ChargerProfile struct {
	Tenant       string
	ID           string
	FilterIDs    []string
	Weights      DynamicWeights
	Blockers     DynamicBlockers
	RunID        string
	AttributeIDs []string // perform data aliasing based on these Attributes
}

ChargerProfile defines the configuration of a Charger.

func (*ChargerProfile) CacheClone

func (cp *ChargerProfile) CacheClone() any

CacheClone returns a clone of ChargerProfile used by ltcache CacheCloner

func (*ChargerProfile) Clone

func (cp *ChargerProfile) Clone() *ChargerProfile

Clone method for ChargerProfile

func (*ChargerProfile) FieldAsInterface

func (cp *ChargerProfile) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*ChargerProfile) FieldAsString

func (cp *ChargerProfile) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*ChargerProfile) Merge

func (cp *ChargerProfile) Merge(v2 any)

Merge implements the profile interface, merging values from another ChargerProfile.

func (*ChargerProfile) Set

func (cp *ChargerProfile) Set(path []string, val any, newBranch bool) (err error)

Set implements the profile interface, setting values in ChargerProfile based on path.

func (*ChargerProfile) String

func (cp *ChargerProfile) String() string

String implements the DataProvider interface, returning the ChargerProfile in JSON format.

func (*ChargerProfile) TenantID

func (cp *ChargerProfile) TenantID() string

TenantID returns the concatenated tenant and ID.

type ChargerProfileWithAPIOpts

type ChargerProfileWithAPIOpts struct {
	*ChargerProfile
	APIOpts map[string]any
}

ChargerProfileWithAPIOpts wraps ChargerProfile with APIOpts.

type CodecMsgpackMarshaler

type CodecMsgpackMarshaler struct {
	// contains filtered or unexported fields
}

func NewCodecMsgpackMarshaler

func NewCodecMsgpackMarshaler() *CodecMsgpackMarshaler

func (*CodecMsgpackMarshaler) Marshal

func (cmm *CodecMsgpackMarshaler) Marshal(v any) (b []byte, err error)

func (*CodecMsgpackMarshaler) Unmarshal

func (cmm *CodecMsgpackMarshaler) Unmarshal(data []byte, v any) error

type Compiler

type Compiler interface {
	Compile() error
}

Compiler are objects that need post compiling

type CostIncrement

type CostIncrement struct {
	FilterIDs    []string
	Increment    *Decimal
	FixedFee     *Decimal
	RecurrentFee *Decimal
}

CostIncrement enforces cost calculation to specific balance increments

func (*CostIncrement) Clone

func (cI *CostIncrement) Clone() (cIcln *CostIncrement)

Clone returns a copy of the CostIncrement

func (*CostIncrement) Equals

func (cI *CostIncrement) Equals(ctIn *CostIncrement) (eq bool)

Equals returns the equality between two CostIncrement

func (*CostIncrement) FieldAsInterface

func (cI *CostIncrement) FieldAsInterface(fldPath []string) (_ any, err error)

func (*CostIncrement) FieldAsString

func (cI *CostIncrement) FieldAsString(fldPath []string) (_ string, err error)

func (*CostIncrement) String

func (cI *CostIncrement) String() string

type Counter

type Counter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter(start, limit int64) *Counter

func (*Counter) Next

func (c *Counter) Next() int64

func (*Counter) Value

func (c *Counter) Value() int64

type DPRArgs

type DPRArgs struct {
	OriginHost      string
	OriginRealm     string
	DisconnectCause int
}

DPRArgs are the arguments used by dispatcher to send a Disconnect-Peer-Request

type DataConverter

type DataConverter interface {
	Convert(any) (any, error)
}

DataConverter represents functions which should convert input into output

func NewDataConverter

func NewDataConverter(params string) (conv DataConverter, err error)

NewDataConverter is a factory of converters

func NewDataConverterMustCompile

func NewDataConverterMustCompile(params string) (conv DataConverter)

func NewDivideConverter

func NewDivideConverter(constructParams string) (hdlr DataConverter, err error)

func NewDurationConverter

func NewDurationConverter(params string) (hdlr DataConverter, err error)

func NewDurationNanosecondsConverter

func NewDurationNanosecondsConverter(params string) (
	hdlr DataConverter, err error)

func NewDurationSecondsConverter

func NewDurationSecondsConverter(params string) (hdlr DataConverter, err error)

func NewMultiplyConverter

func NewMultiplyConverter(constructParams string) (hdlr DataConverter, err error)

func NewPhoneNumberConverter

func NewPhoneNumberConverter(params string) (
	pbDC DataConverter, err error)

NewPhoneNumberConverter create a new phoneNumber converter If the format isn't specify by default we use NATIONAL Possible fromats are : E164(0) , INTERNATIONAL(1) , NATIONAL(2) ,RFC3966(3) Also ContryCode needs to be specified

func NewRandomConverter

func NewRandomConverter(params string) (dflr DataConverter, err error)

func NewRoundConverter

func NewRoundConverter(params string) (hdlr DataConverter, err error)

func NewStripConverter

func NewStripConverter(params string) (DataConverter, error)

NewStripConverter initializes and returns a new StripConverter with configurations based on the provided parameters in the input string. Each parameter in the input string should be separated by ':'.

The input string must follow one of the following formats:

  1. "*strip:<side>:<amount>"
  2. "*strip:<side>:<substring>[:<amount>]"
  3. "*strip:<side>:*char:<substring>[:<amount>]"

Explanation of placeholders:

  • <side>: Specifies which part of the string to strip. Must be one of "*prefix", "*suffix", or "*both".
  • <substring>: Identifies the substring to remove. It can be a specific string, "*nil" for null characters, "*space" for spaces, or any other character.
  • <amount> (optional): Determines the number of characters to remove. If omitted, all instances of <substring> are removed.

Examples:

  • "*strip:*prefix:5": Removes the first 5 characters from the string's prefix.
  • "*strip:*suffix:*nil": Eliminates all trailing null characters in the string.
  • "*strip:*both:*space:2": Clears 2 spaces from both the prefix and suffix of the string.
  • "*strip:*suffix:*char:abc": Removes the substring "abc" from the suffix of the string.
  • "*strip:*prefix:*char:abc:2": Strips the substring "abc" from the prefix of the string, repeated 2 times.

func NewTimeStringConverter

func NewTimeStringConverter(params string) (hdlr DataConverter)

type DataConverters

type DataConverters []DataConverter

DataConverters groups together multiple converters, executing optimized conversions

func (DataConverters) ConvertInterface

func (dcs DataConverters) ConvertInterface(in any) (out any, err error)

ConvertString converts from and to string

func (DataConverters) ConvertString

func (dcs DataConverters) ConvertString(in string) (out string, err error)

ConvertString converts from and to string

type DataLeaf

type DataLeaf struct {
	Data any // value of the element
	// the config of the leaf
	NewBranch   bool   `json:",omitempty"`
	AttributeID string `json:",omitempty"`
}

DataLeaf is an item in the DataNode

func (*DataLeaf) String

func (dl *DataLeaf) String() string

String returs the value of the leaf as string

type DataNode

type DataNode struct {
	Type  NMType               `json:"-"`
	Map   map[string]*DataNode `json:",omitempty"`
	Slice []*DataNode          `json:",omitempty"`
	Value *DataLeaf            `json:",omitempty"`
}

DataNode a structure for storing data

func NewDataNode

func NewDataNode(path []string) (n *DataNode)

NewDataNode using the compiled path creates a node

func NewLeafNode

func NewLeafNode(val any) *DataNode

NewLeafNode creates a leaf node with given value

func (*DataNode) Append

func (n *DataNode) Append(path []string, val *DataLeaf) (idx int, err error)

Append will append the value at de specified path the path should be in the same format as the path given to Field

func (*DataNode) Compose

func (n *DataNode) Compose(path []string, val *DataLeaf) (err error)

Compose will string compose the value at de specified path with the given value the path should be in the same format as the path given to Field

func (*DataNode) Field

func (n *DataNode) Field(path []string) (*DataLeaf, error)

Field returns the DataLeaf found at path if at the end of the path is not a DataLeaf return an error

func (*DataNode) FieldAsInterface

func (n *DataNode) FieldAsInterface(path []string) (any, error)

FieldAsInterface will compile the given path and return the node value at the end of the path this function is used most probably by filters so expect the path to not be compiled

func (DataNode) IsEmpty

func (n DataNode) IsEmpty() bool

IsEmpty return if the node is empty/ has no data

func (*DataNode) Remove

func (n *DataNode) Remove(path []string) error

Remove will remove the value at given path the path should be in the same format as the path given to Field also removes the empty nodes found in path

func (*DataNode) Set

func (n *DataNode) Set(path []string, val any) (addedNew bool, err error)

Set will set the value at de specified path the path should be in the same format as the path given to Field

type DataProvider added in v0.10.1

type DataProvider interface {
	String() string // printable version of data
	FieldAsInterface(fldPath []string) (any, error)
	FieldAsString(fldPath []string) (string, error) // remove this
}

DataProvider is a data source from multiple formats

func NewObjectDP

func NewObjectDP(obj any) DataProvider

NewObjectDP constructs a DataProvider

type DataStorage

type DataStorage interface {
	DataProvider

	Set(fldPath []string, val any) error
	Remove(fldPath []string) error
	GetKeys(nested bool, nesteedLimit int, prefix string) []string
}

DataStorage is the DataProvider that can be updated

type Decimal

type Decimal struct {
	*decimal.Big
}

func DivideDecimal

func DivideDecimal(x, y *Decimal) *Decimal

DivideDecimal divides two Decimals and returns the result

func MultiplyDecimal

func MultiplyDecimal(x, y *Decimal) *Decimal

MultiplyDecimal multiples two Decimals and returns the result

func NewDecimal

func NewDecimal(value int64, scale int) *Decimal

NewDecimal is a constructor for Decimal, following the one of decimal.Big

func NewDecimalFromFloat64

func NewDecimalFromFloat64(f float64) *Decimal

NewDecimalFromFloat64 is a constructor for Decimal out of float64 passing through string is necessary due to differences between decimal and binary representation of float64

func NewDecimalFromString

func NewDecimalFromString(value string) (*Decimal, error)

NewDecimalFromString converts a string to decimal

func NewDecimalFromStringIgnoreError

func NewDecimalFromStringIgnoreError(v string) (d *Decimal)

NewDecimalFromStringIgnoreError same as above but ignore error( for test only)

func NewDecimalFromUsage

func NewDecimalFromUsage(u string) (d *Decimal, err error)

NewDecimalFromUsage is a constructor for Decimal out of unit represents as string

func NewDecimalFromUsageIgnoreErr

func NewDecimalFromUsageIgnoreErr(u string) (d *Decimal)

NewDecimalFromUsage is a constructor for Decimal out of unit represents as string

func SubstractDecimal

func SubstractDecimal(x, y *Decimal) *Decimal

func SumDecimal

func SumDecimal(x, y *Decimal) *Decimal

sumDecimal adds two Decimals and returns the result

func (*Decimal) Clone

func (d *Decimal) Clone() *Decimal

Clone returns a copy of the Decimal

func (*Decimal) Compare

func (d *Decimal) Compare(d2 *Decimal) int

Compare wraps the decimal.Big.Cmp function. It does not handle nil d2

func (*Decimal) Duration

func (d *Decimal) Duration() (dur time.Duration, ok bool)

Duration returns the decimal as duration or !ok otherwise

func (*Decimal) MarshalBinary

func (d *Decimal) MarshalBinary() ([]byte, error)

MarshalBinary implements the method for binaryMarshal interface for Msgpack encoding

func (*Decimal) MarshalJSON

func (d *Decimal) MarshalJSON() ([]byte, error)

MarshalJSON implements the method for jsonMarshal for JSON encoding

func (*Decimal) Round

func (d *Decimal) Round(rndDec int) *Decimal

Round rounds d down to the Context's precision and returns Decimal. The result is undefined if d is not finite. The result of Round will always be within the interval [⌊10**x⌋, d] where x = the precision of d.

func (*Decimal) UnmarshalBinary

func (d *Decimal) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary implements the method for binaryUnmarshal interface for Msgpack encoding

func (*Decimal) UnmarshalJSON

func (d *Decimal) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the method for jsonUnmarshal for JSON encoding

type DirectoryArgs

type DirectoryArgs struct {
	DirPath string
	APIOpts map[string]any
	Tenant  string
}

type DivideConverter

type DivideConverter struct {
	Value float64
}

DivideConverter divides input with value in params encapsulates the output as float64 value

func (*DivideConverter) Convert

func (m *DivideConverter) Convert(in any) (out any, err error)

type DurationArgs added in v0.10.3

type DurationArgs struct {
	Duration time.Duration
	APIOpts  map[string]any
	Tenant   string
}

type DurationConverter

type DurationConverter struct{}

DurationConverter converts duration into seconds encapsulated in float64

func (*DurationConverter) Convert

func (mS *DurationConverter) Convert(in any) (
	out any, err error)

type DurationNanosecondsConverter

type DurationNanosecondsConverter struct{}

DurationNanosecondsConverter converts duration into nanoseconds encapsulated in int64

func (*DurationNanosecondsConverter) Convert

func (mS *DurationNanosecondsConverter) Convert(in any) (
	out any, err error)

type DurationSecondsConverter

type DurationSecondsConverter struct{}

DurationSecondsConverter converts duration into seconds encapsulated in float64

func (*DurationSecondsConverter) Convert

func (mS *DurationSecondsConverter) Convert(in any) (
	out any, err error)

type DynamicBlocker

type DynamicBlocker struct {
	FilterIDs []string
	Blocker   bool
}

func (*DynamicBlocker) Clone

func (blckr *DynamicBlocker) Clone() (cln *DynamicBlocker)

Clone will clone the a DynamicBlocker

func (*DynamicBlocker) FieldAsInterface

func (dB *DynamicBlocker) FieldAsInterface(fldPath []string) (any, error)

func (DynamicBlocker) String

func (blckr DynamicBlocker) String(blkSep, fltrSep string) (out string)

String will set the DynamicBlocker as a string pattern

type DynamicBlockers

type DynamicBlockers []*DynamicBlocker

func NewDynamicBlockersFromString

func NewDynamicBlockersFromString(value, blkSep, fltrSep string) (blkrs DynamicBlockers, err error)

NewDynamicBlockersFromString will build the Blockers that contains slices of FilterIDs and Blocker from a single value. This process is helped by separators

func (DynamicBlockers) Clone

func (blckrs DynamicBlockers) Clone() (clBlkrs DynamicBlockers)

Clone will clone the Blockers

func (DynamicBlockers) String

func (blkrs DynamicBlockers) String(blkSep, fltrSep string) (value string)

String will set the Blockers as a string pattern

type DynamicWeight

type DynamicWeight struct {
	FilterIDs []string
	Weight    float64
}

DynamicWeight returns Weight based on Filters

func (*DynamicWeight) Clone

func (dW *DynamicWeight) Clone() (cln *DynamicWeight)

func (*DynamicWeight) Equals

func (dW *DynamicWeight) Equals(dnWg *DynamicWeight) (eq bool)

func (*DynamicWeight) FieldAsInterface

func (dW *DynamicWeight) FieldAsInterface(fldPath []string) (any, error)

func (DynamicWeight) String

func (dW DynamicWeight) String(dWSep, fltrsep string) (out string)

type DynamicWeights

type DynamicWeights []*DynamicWeight

func NewDynamicWeightsFromString

func NewDynamicWeightsFromString(s, dWSep, fltrSep string) (dWs DynamicWeights, err error)

NewDynamicWeightsFromString creates a DynamicWeight list based on the string received from .csv

func (DynamicWeights) Clone

func (dW DynamicWeights) Clone() (dinWeight DynamicWeights)

func (DynamicWeights) String

func (dWS DynamicWeights) String(dWSep, fltrsep string) (out string)

type EventCharges

type EventCharges struct {
	Abstracts *Decimal // total abstract units charged
	Concretes *Decimal // total concrete units charged

	Charges []*ChargeEntry

	Accounting  map[string]*AccountCharge
	UnitFactors map[string]*UnitFactor
	Rating      map[string]*RateSInterval
	Rates       map[string]*IntervalRate
	Accounts    map[string]*Account
}

EventCharges records the charges applied to an Event

func NewEventCharges

func NewEventCharges() (ec *EventCharges)

NewEventChargers instantiates the EventChargers in a central place

func (*EventCharges) Clone

func (ec *EventCharges) Clone() *EventCharges

Clone returns a copy of ec

func (*EventCharges) Equals

func (eC *EventCharges) Equals(evCh *EventCharges) (eq bool)

Equals returns the equality between two EventCharges

func (*EventCharges) FieldAsInterface

func (ec *EventCharges) FieldAsInterface(fldPath []string) (any, error)

FieldAsInterface retrieves a value of a field based on its path from within an *EventCharges value. Needed in order to satisfy the DataProvider interface.

func (*EventCharges) FieldAsString

func (ec *EventCharges) FieldAsString(fldPath []string) (string, error)

func (*EventCharges) Merge

func (ec *EventCharges) Merge(eCs ...*EventCharges)

Merge will merge the event charges into existing

func (*EventCharges) String

func (ec *EventCharges) String() string

String returns the string representation of an *EventCharges value. Needed in order to satisfy the DataProvider interface.

func (*EventCharges) SyncIDs

func (ec *EventCharges) SyncIDs(eCs ...*EventCharges)

SyncIDs will repopulate Accounting, UnitFactors and Rating IDs if they equal the references in ec

type EventsWithOpts

type EventsWithOpts struct {
	Event map[string]any
	Opts  map[string]any
}

type ExportedTPStats

type ExportedTPStats struct {
	ExportPath    string   // Full path to the newly generated export file
	ExportedFiles []string // List of exported files
	Compressed    bool
}

type ExternalAttribute

type ExternalAttribute struct {
	FilterIDs []string
	Blockers  DynamicBlockers
	Path      string
	Type      string
	Value     string
}

ExternalAttribute represents the API-facing attribute structure.

type FlagParams

type FlagParams map[string][]string

FlagParams stores the parameters for a flag

func (FlagParams) Add

func (fWp FlagParams) Add(opts []string)

Add adds the options to the flag

func (FlagParams) Clone

func (fWp FlagParams) Clone() (cln FlagParams)

Clone returns a deep copy of FlagParams

func (FlagParams) Has

func (fWp FlagParams) Has(opt string) (has bool)

Has returns if the key was mentioned in flags

func (FlagParams) ParamValue

func (fWp FlagParams) ParamValue(opt string) (ps string)

ParamValue returns the value of the flag

func (FlagParams) ParamsSlice

func (fWp FlagParams) ParamsSlice(opt string) (ps []string)

ParamsSlice returns the list of profiles for the subsystem

func (FlagParams) SliceFlags

func (fWp FlagParams) SliceFlags() (sls []string)

SliceFlags converts from FlagsParams to []string

type FlagsWithParams

type FlagsWithParams map[string]FlagParams

FlagsWithParams should store a list of flags for each subsystem

func FlagsWithParamsFromSlice

func FlagsWithParamsFromSlice(s []string) (flags FlagsWithParams)

FlagsWithParamsFromSlice construct a FlagsWithParams from the given slice

func (FlagsWithParams) Clone

func (fWp FlagsWithParams) Clone() (cln FlagsWithParams)

Clone returns a deep copy of FlagsWithParams

func (FlagsWithParams) GetBool

func (fWp FlagsWithParams) GetBool(key string) (b bool)

GetBool returns the flag as boolean

func (FlagsWithParams) Has

func (fWp FlagsWithParams) Has(flag string) (has bool)

Has returns if the key was mentioned in flags

func (FlagsWithParams) ParamValue added in v0.10.3

func (fWp FlagsWithParams) ParamValue(subs string) (ps string)

ParamValue returns the value of the flag

func (FlagsWithParams) ParamsSlice

func (fWp FlagsWithParams) ParamsSlice(subs, opt string) (ps []string)

ParamsSlice returns the list of profiles for the subsystem

func (FlagsWithParams) SliceFlags

func (fWp FlagsWithParams) SliceFlags() (sls []string)

SliceFlags converts from FlagsWithParams back to []string

type Float64Converter

type Float64Converter struct{}

func (Float64Converter) Convert

func (Float64Converter) Convert(in any) (any, error)

Convert implements DataConverter interface

type FullPath added in v0.10.1

type FullPath struct {
	PathSlice []string
	Path      string
}

FullPath is the path to the item with all the needed fields

func GetFullFieldPath

func GetFullFieldPath(fldPath string, dP DataProvider) (fpath *FullPath, err error)

GetFullFieldPath returns the full path for the

func NewFullPath

func NewFullPath(path string) *FullPath

NewFullPath is a constructor for FullPath out of string

type GOBMarshaler

type GOBMarshaler struct{}

func (GOBMarshaler) Marshal

func (GOBMarshaler) Marshal(v any) (data []byte, err error)

func (GOBMarshaler) Unmarshal

func (GOBMarshaler) Unmarshal(data []byte, v any) error

type GetIndexesArg

type GetIndexesArg struct {
	IdxItmType string
	TntCtx     string
	IdxKey     string
	Tenant     string
	APIOpts    map[string]any
}

GetIndexesArg the API argumets to specify an index

type GigawordsConverter

type GigawordsConverter struct{}

GigawordsConverter converts a value in Gigawords to octects

func (GigawordsConverter) Convert

func (GigawordsConverter) Convert(in any) (any, error)

type HierarchyPath

type HierarchyPath []string

HierarchyPath is used in various places to represent various path hierarchies (eg: in Diameter groups, XML trees)

func ParseHierarchyPath

func ParseHierarchyPath(path string, sep string) HierarchyPath

func (HierarchyPath) AsString

func (hP HierarchyPath) AsString(sep string, isAbsolute bool) string

AsString converts HierarchyPath to a string.

func (HierarchyPath) Clone

func (h HierarchyPath) Clone() (cln HierarchyPath)

Clone returns a deep copy of HierarchyPath

type IP2HexConverter added in v0.10.2

type IP2HexConverter struct{}

IP2HexConverter will transform ip to hex

func (*IP2HexConverter) Convert added in v0.10.2

func (*IP2HexConverter) Convert(in any) (out any, err error)

Convert implements DataConverter interface

type IPAllocations

type IPAllocations struct {
	Tenant string
	ID     string
	Usages map[string]*IPUsage
	TTLIdx []string
}

IPAllocations represents IP allocations with usage tracking and TTL management.

func (*IPAllocations) CacheClone

func (a *IPAllocations) CacheClone() any

CacheClone returns a clone of IPAllocations object used by ltcache CacheCloner.

func (*IPAllocations) Clone

func (a *IPAllocations) Clone() *IPAllocations

Clone clones IPAllocations object (lkID excluded)

func (*IPAllocations) TenantID

func (a *IPAllocations) TenantID() string

TenantID returns the unique ID in a multi-tenant environment

type IPAllocationsWithAPIOpts

type IPAllocationsWithAPIOpts struct {
	*IPAllocations
	APIOpts map[string]any
}

IPAllocationsWithAPIOpts wraps IPAllocations with APIOpts.

type IPPool

type IPPool struct {
	ID        string
	FilterIDs []string
	Type      string
	Range     string
	Strategy  string
	Message   string
	Weights   DynamicWeights
	Blockers  DynamicBlockers
}

func (*IPPool) Clone

func (p *IPPool) Clone() *IPPool

Clone creates a deep copy of Pool for thread-safe use.

func (*IPPool) FieldAsInterface

func (p *IPPool) FieldAsInterface(fldPath []string) (any, error)

func (*IPPool) FieldAsString

func (p *IPPool) FieldAsString(fldPath []string) (string, error)

func (*IPPool) Merge

func (p *IPPool) Merge(other any)

func (*IPPool) Set

func (p *IPPool) Set(path []string, val any, _ bool) error

func (*IPPool) String

func (p *IPPool) String() string

type IPProfile

type IPProfile struct {
	Tenant    string
	ID        string
	FilterIDs []string
	Weights   DynamicWeights
	TTL       time.Duration
	Stored    bool
	Pools     []*IPPool
}

IPProfile defines the configuration of an IPAllocations object.

func (*IPProfile) CacheClone

func (p *IPProfile) CacheClone() any

CacheClone returns a clone of IPProfile used by ltcache CacheCloner

func (*IPProfile) Clone

func (p *IPProfile) Clone() *IPProfile

Clone creates a deep copy of IPProfile for thread-safe use.

func (*IPProfile) FieldAsInterface

func (p *IPProfile) FieldAsInterface(fldPath []string) (any, error)

func (*IPProfile) FieldAsString

func (p *IPProfile) FieldAsString(fldPath []string) (string, error)

func (*IPProfile) Merge

func (p *IPProfile) Merge(other any)

func (*IPProfile) Set

func (p *IPProfile) Set(path []string, val any, newBranch bool) error

func (*IPProfile) String

func (p *IPProfile) String() string

func (*IPProfile) TenantID

func (p *IPProfile) TenantID() string

TenantID returns the concatenated tenant and ID.

type IPProfileWithAPIOpts

type IPProfileWithAPIOpts struct {
	*IPProfile
	APIOpts map[string]any
}

IPProfileWithAPIOpts wraps IPProfile with APIOpts.

type IPUsage

type IPUsage struct {
	Tenant     string
	ID         string
	ExpiryTime time.Time
	Address    netip.Addr
}

IPUsage represents a usage count.

func (*IPUsage) Clone

func (u *IPUsage) Clone() *IPUsage

Clone duplicates the IPUsage

func (*IPUsage) IsActive

func (u *IPUsage) IsActive(atTime time.Time) bool

IsActive checks ExpiryTime at some time

func (*IPUsage) TenantID

func (u *IPUsage) TenantID() string

TenantID returns the concatenated key between tenant and ID.

type IntervalRate

type IntervalRate struct {
	IntervalStart *Decimal // Starting point when the Rate kicks in
	FixedFee      *Decimal
	RecurrentFee  *Decimal
	Unit          *Decimal // RateUnit
	Increment     *Decimal // RateIncrement
}

func (*IntervalRate) Clone

func (iR *IntervalRate) Clone() *IntervalRate

Clone returns a copy of iR

func (*IntervalRate) Equals

func (iR *IntervalRate) Equals(inRt *IntervalRate) (eq bool)

Equals returns the equality between two IntervalRate

func (*IntervalRate) FieldAsInterface

func (iR *IntervalRate) FieldAsInterface(fldPath []string) (_ any, err error)

func (*IntervalRate) FieldAsString

func (iR *IntervalRate) FieldAsString(fldPath []string) (_ string, err error)

func (*IntervalRate) Merge

func (ivalRate *IntervalRate) Merge(v2 *IntervalRate)

func (*IntervalRate) String

func (iR *IntervalRate) String() string

type JSONB

type JSONB map[string]any

JSONB type for storing maps of events and opts into gorm columns as jsob type

func (JSONB) GormDataType

func (j JSONB) GormDataType() string

func (*JSONB) Scan

func (j *JSONB) Scan(value any) (err error)

Scan scan value into Jsonb, implements sql.Scanner interface

func (JSONB) Value

func (j JSONB) Value() (driver.Value, error)

Value return json value, implement driver.Valuer interface

type JSONBufMarshaler

type JSONBufMarshaler struct{}

func (JSONBufMarshaler) Marshal

func (JSONBufMarshaler) Marshal(v any) (data []byte, err error)

func (JSONBufMarshaler) Unmarshal

func (JSONBufMarshaler) Unmarshal(data []byte, v any) error

type JSONConverter

type JSONConverter struct{}

JSONConverter converts an object to json string

func (JSONConverter) Convert

func (jsnC JSONConverter) Convert(in any) (any, error)

type JSONMarshaler

type JSONMarshaler struct{}

func (JSONMarshaler) Marshal

func (JSONMarshaler) Marshal(v any) ([]byte, error)

func (JSONMarshaler) Unmarshal

func (JSONMarshaler) Unmarshal(data []byte, v any) error

type LengthConverter

type LengthConverter struct{}

LengthConverter returns the lenght of the slice

func (LengthConverter) Convert

func (LengthConverter) Convert(in any) (out any, err error)

Convert implements DataConverter interface

type LoadIDsWithAPIOpts

type LoadIDsWithAPIOpts struct {
	LoadIDs map[string]int64
	Tenant  string
	APIOpts map[string]any
}

type LoadInstance

type LoadInstance struct {
	LoadID           string // Unique identifier for the load
	RatingLoadID     string
	AccountingLoadID string
	//TariffPlanID     string    // Tariff plan identificator for the data loaded
	LoadTime time.Time // Time of load
}

type LoggerInterface

type LoggerInterface interface {
	GetSyslog() *syslog.Writer
	SetLogLevel(level int)
	GetLogLevel() int
	Close() error
	Emerg(m string) error
	Alert(m string) error
	Crit(m string) error
	Err(m string) error
	Warning(m string) error
	Notice(m string) error
	Info(m string) error
	Debug(m string) error
	Write(p []byte) (n int, err error)
}
var Logger LoggerInterface

type MapStorage added in v0.10.2

type MapStorage map[string]any

MapStorage is the basic dataStorage

func NewMapFromCSV

func NewMapFromCSV(str string) (MapStorage, error)

func (MapStorage) Clone

func (ms MapStorage) Clone() (msClone MapStorage)

func (MapStorage) FieldAsInterface added in v0.10.2

func (ms MapStorage) FieldAsInterface(fldPath []string) (val any, err error)

FieldAsInterface returns the value from the path

func (MapStorage) FieldAsString added in v0.10.2

func (ms MapStorage) FieldAsString(fldPath []string) (str string, err error)

FieldAsString returns the value from path as string

func (MapStorage) GetKeys added in v0.10.2

func (ms MapStorage) GetKeys(nested bool, nestedLimit int, prefix string) (keys []string)

GetKeys returns all the keys from map

func (MapStorage) Remove added in v0.10.2

func (ms MapStorage) Remove(fldPath []string) (err error)

Remove removes the item at path

func (MapStorage) Set added in v0.10.2

func (ms MapStorage) Set(fldPath []string, val any) (err error)

Set sets the value at the given path

func (MapStorage) String added in v0.10.2

func (ms MapStorage) String() string

String returns the map as json string

type Marshaler

type Marshaler interface {
	Marshal(v any) ([]byte, error)
	Unmarshal(data []byte, v any) error
}

func NewMarshaler

func NewMarshaler(mrshlerStr string) (ms Marshaler, err error)

NewMarshaler returns the marshaler type selected by mrshlerStr

type MetricWithFilters

type MetricWithFilters struct {
	FilterIDs []string
	MetricID  string
	Blockers  string
}

MetricWithFilters is used in TPStatProfile

type MetricWithTrend

type MetricWithTrend struct {
	ID          string  // Metric ID
	Value       float64 // Metric Value
	TrendGrowth float64 // Difference between last and previous
	TrendLabel  string  // *positive, *negative, *constant, N/A
}

MetricWithTrend contains a metric value with its calculated trend info.

func (*MetricWithTrend) Clone

func (m *MetricWithTrend) Clone() *MetricWithTrend

type MonthDays

type MonthDays []int

Defines month days series

func (MonthDays) Len

func (md MonthDays) Len() int

func (MonthDays) Less

func (md MonthDays) Less(j, i int) bool

func (*MonthDays) Parse

func (md *MonthDays) Parse(input, sep string)

Parse MonthDay elements from string separated by sep.

func (MonthDays) Sort

func (md MonthDays) Sort()

func (MonthDays) Swap

func (md MonthDays) Swap(i, j int)

type Months

type Months []time.Month

Defines months series

func (Months) Len

func (m Months) Len() int

func (Months) Less

func (m Months) Less(j, i int) bool

func (*Months) Parse

func (m *Months) Parse(input, sep string)

Loades Month elemnents from a string separated by sep.

func (Months) Sort

func (m Months) Sort()

func (Months) Swap

func (m Months) Swap(i, j int)

type MultiplyConverter

type MultiplyConverter struct {
	Value float64
}

MultiplyConverter multiplies input with value in params encapsulates the output as float64 value

func (*MultiplyConverter) Convert

func (m *MultiplyConverter) Convert(in any) (out any, err error)

type NMType added in v0.10.1

type NMType byte

NMType the type used for navigable Map

const (
	NMDataType NMType = iota
	NMMapType
	NMSliceType
)

posible NMType

type NavigableMapper interface {
	AsNavigableMap() map[string]*DataNode
}

NavigableMapper is the interface supported by replies convertible to CGRReply

type NetAddr

type NetAddr struct {
	// contains filtered or unexported fields
}

func LocalAddr

func LocalAddr() *NetAddr

func NewNetAddr

func NewNetAddr(network, host string) *NetAddr

func (*NetAddr) Host

func (lc *NetAddr) Host() string

Host .

func (*NetAddr) Network

func (lc *NetAddr) Network() string

Network is part of net.Addr interface

func (*NetAddr) Port

func (lc *NetAddr) Port() int

Port .

func (*NetAddr) String

func (lc *NetAddr) String() string

String is part of net.Addr interface

type NopCloser

type NopCloser struct {
	io.Writer
}

func (NopCloser) Close

func (NopCloser) Close() error

type NopFlushWriter

type NopFlushWriter interface {
	Write([]string) error
	Flush()
}

NopFlushWriter is a writer for one line, compatible with csv.Writer interface on Write Used in TP exporter

type ObjectDP

type ObjectDP struct {
	// contains filtered or unexported fields
}

ObjectDP implements the DataProvider for any any

func (*ObjectDP) FieldAsInterface

func (objDP *ObjectDP) FieldAsInterface(fldPath []string) (data any, err error)

FieldAsInterface is part of engine.DataProvider interface

func (*ObjectDP) FieldAsString

func (objDP *ObjectDP) FieldAsString(fldPath []string) (data string, err error)

FieldAsString is part of engine.DataProvider interface

func (*ObjectDP) String

func (objDP *ObjectDP) String() string

String is part of engine.DataProvider interface when called, it will display the already parsed values out of cache

type OrderedMap added in v0.10.3

type OrderedMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

OrderedMap is a map that maintains the order of its key-value pairs.

func NewOrderedMap added in v0.10.3

func NewOrderedMap[K comparable, V any]() *OrderedMap[K, V]

NewOrderedMap creates a new ordered map and returns a pointer to it.

func (*OrderedMap[K, V]) Delete added in v0.10.3

func (om *OrderedMap[K, V]) Delete(key K)

Delete removes the key-value pair associated with the given key from the ordered map.

func (*OrderedMap[K, V]) Get added in v0.10.3

func (om *OrderedMap[K, V]) Get(key K) (V, bool)

Get retrieves the value associated with the given key from the ordered map. It returns the value and a boolean indicating whether the key exists in the map.

func (*OrderedMap[K, V]) GetByIndex

func (om *OrderedMap[K, V]) GetByIndex(index int) (K, V, bool)

GetByIndex returns the key-value pair at the specified index within the ordered map. If the index is out of bounds, the zero values for K and V are returned with a false flag.

func (*OrderedMap[K, V]) Keys added in v0.10.3

func (om *OrderedMap[K, V]) Keys() []K

Keys returns all keys of the ordered map in order of their insertion.

func (*OrderedMap[K, V]) Map

func (om *OrderedMap[K, V]) Map() map[K]V

Map returns a deep copy of the ordered map's key-value pairs.

func (*OrderedMap[K, V]) Set added in v0.10.3

func (om *OrderedMap[K, V]) Set(key K, value V)

Set adds a new key-value pair to the ordered map. If the key already exists, it updates the value.

func (*OrderedMap[K, V]) Values added in v0.10.3

func (om *OrderedMap[K, V]) Values() []V

Values returns all values of the ordered map in the order of their corresponding keys' insertion.

type OrderedNavigableMap added in v0.10.1

type OrderedNavigableMap struct {
	// contains filtered or unexported fields
}

OrderedNavigableMap is the same as DataNode but keeps the order of fields

func NewOrderedNavigableMap added in v0.10.1

func NewOrderedNavigableMap() *OrderedNavigableMap

NewOrderedNavigableMap initializates a structure of OrderedNavigableMap with a DataNode

func (*OrderedNavigableMap) Append

func (onm *OrderedNavigableMap) Append(fullPath *FullPath, val *DataLeaf) (err error)

Append appends the leaf at the given path the end must be a slice this used with full path and the processed path to not calculate them for every set

func (*OrderedNavigableMap) Compose

func (onm *OrderedNavigableMap) Compose(fullPath *FullPath, val *DataLeaf) (err error)

Compose compose the value of the leaf at the given path this used with full path and the processed path to not calculate them for every set

func (*OrderedNavigableMap) Empty added in v0.10.1

func (onm *OrderedNavigableMap) Empty() bool

Empty returns true if the NM is empty(no data)

func (*OrderedNavigableMap) Field added in v0.10.1

func (onm *OrderedNavigableMap) Field(fldPath []string) (val *DataLeaf, err error)

Field returns the item on the given path

func (*OrderedNavigableMap) FieldAsInterface added in v0.10.1

func (onm *OrderedNavigableMap) FieldAsInterface(fldPath []string) (iface any, err error)

FieldAsInterface returns the interface at the path

func (*OrderedNavigableMap) FieldAsString added in v0.10.1

func (onm *OrderedNavigableMap) FieldAsString(fldPath []string) (str string, err error)

FieldAsString returns the value from path as string

func (*OrderedNavigableMap) GetFirstElement added in v0.10.1

func (onm *OrderedNavigableMap) GetFirstElement() *PathItemElement

GetFirstElement returns the first element from the order

func (*OrderedNavigableMap) GetOrder added in v0.10.1

func (onm *OrderedNavigableMap) GetOrder() (order [][]string)

GetOrder returns the elements order as a slice

func (*OrderedNavigableMap) Interface added in v0.10.1

func (onm *OrderedNavigableMap) Interface() any

Interface returns navigble map that's inside

func (*OrderedNavigableMap) OrderedFields

func (onm *OrderedNavigableMap) OrderedFields() (flds []any)

OrderedFields returns the elements in order they were inserted

func (*OrderedNavigableMap) OrderedFieldsAsStrings

func (onm *OrderedNavigableMap) OrderedFieldsAsStrings() (flds []string)

OrderedFieldsAsStrings returns the elements as strings in order they were inserted

func (*OrderedNavigableMap) Remove added in v0.10.1

func (onm *OrderedNavigableMap) Remove(fullPath *FullPath) (err error)

Remove removes the item for the given path and updates the order

func (*OrderedNavigableMap) RemoveAll added in v0.10.1

func (onm *OrderedNavigableMap) RemoveAll()

RemoveAll will clean the data and the odrder from OrderedNavigableMap

func (*OrderedNavigableMap) Set added in v0.10.1

func (onm *OrderedNavigableMap) Set(fullPath *FullPath, val any) (err error)

Set sets the value at the given path this used with full path and the processed path to not calculate them for every set used in tests

func (*OrderedNavigableMap) SetAsSlice

func (onm *OrderedNavigableMap) SetAsSlice(fullPath *FullPath, vals []*DataNode) (err error)

SetAsSlice sets the slice of nodes at the given path this used with full path and the processed path to not calculate them for every set this is used by agent request to overwrite the slice at path

func (*OrderedNavigableMap) String added in v0.10.1

func (onm *OrderedNavigableMap) String() string

String returns the map as json string

type PASSporTDestinationsIdentity

type PASSporTDestinationsIdentity struct {
	Tn  []string `json:"tn,omitempty"`  // the telephone numbers
	URI []string `json:"uri,omitempty"` // the identities in URI form
}

PASSporTDestinationsIdentity is the destination identities of any type

func NewPASSporTDestinationsIdentity

func NewPASSporTDestinationsIdentity(tn, uri []string) *PASSporTDestinationsIdentity

NewPASSporTDestinationsIdentity returns a new PASSporTDestinationsIdentity with the given ids

type PASSporTHeader

type PASSporTHeader struct {
	Typ string `json:"typ"` // the media type MUST be the string "passport"
	Alg string `json:"alg"` // the cryptographic algorithm for the signature part
	Ppt string `json:"ppt"` // the extension that is used this is optional
	X5u string `json:"x5u"` // the URI referring to the resource for the X.509 public key certificate or certificate chain corresponding to the key used to digitally sign the JWS
}

PASSporTHeader is the JOSE header for PASSporT claim

func NewPASSporTHeader

func NewPASSporTHeader(x5uVal string) *PASSporTHeader

NewPASSporTHeader returns a new PASSporT headder with: extension shaken, ES256 algorithm and the given x5u

type PASSporTOriginsIdentity

type PASSporTOriginsIdentity struct {
	Tn  string `json:"tn,omitempty"`  // the telephone number
	URI string `json:"uri,omitempty"` // the identity in URI form
}

PASSporTOriginsIdentity is the origin identities of any type

func NewPASSporTOriginsIdentity

func NewPASSporTOriginsIdentity(tn, uri string) *PASSporTOriginsIdentity

NewPASSporTOriginsIdentity returns a new PASSporTOriginsIdentity with the given id

type PASSporTPayload

type PASSporTPayload struct {
	ATTest string                       `json:"attest"` // the atestation value: 'A', 'B', or 'C'.These values correspond to 'Full Attestation', 'Partial Attestation', and 'Gateway Attestation', respectively. Not used for verification
	Dest   PASSporTDestinationsIdentity `json:"dest"`   // the destinations identity
	IAT    int64                        `json:"iat"`    // is the date and time of issuance of the JWT
	Orig   PASSporTOriginsIdentity      `json:"orig"`   // the originator identity
	OrigID string                       `json:"origid"` // is an opaque unique identifier representing an element on the path of a given SIP request. Not used for verification
}

PASSporTPayload is the JOSE claim for PASSporT

func NewPASSporTPayload

func NewPASSporTPayload(attest, originID string, dest PASSporTDestinationsIdentity, orig PASSporTOriginsIdentity) *PASSporTPayload

NewPASSporTPayload returns an new PASSporTPayload with the given origin and destination

type Paginator

type Paginator struct {
	Limit    *int // Limit the number of items returned
	Offset   *int // Offset of the first item returned (eg: use Limit*Page in case of PerPage items)
	MaxItems *int
}

Paginate stuff around items returned

func (Paginator) Clone

func (pgnt Paginator) Clone() Paginator

Clone creates a clone of the object

type PaginatorWithSearch

type PaginatorWithSearch struct {
	*Paginator
	Search string // Global matching pattern in items returned, partially used in some APIs
}

type PanicMessageArgs

type PanicMessageArgs struct {
	Tenant  string
	APIOpts map[string]any
	Message string
}

type PathItemElement added in v0.10.1

type PathItemElement struct {

	// The value stored with this element.
	Value []string
	// contains filtered or unexported fields
}

PathItemElement is an element of a linked list. Inspired by Go's double linked list

func (*PathItemElement) Next added in v0.10.1

func (e *PathItemElement) Next() *PathItemElement

Next returns the next list element or nil.

func (*PathItemElement) Prev added in v0.10.1

func (e *PathItemElement) Prev() *PathItemElement

Prev returns the previous list element or nil.

type PathItemList added in v0.10.1

type PathItemList struct {
	// contains filtered or unexported fields
}

PathItemList represents a doubly linked list. The zero value for PathItemList is an empty list ready to use.

func NewPathItemList added in v0.10.1

func NewPathItemList() *PathItemList

NewPathItemList returns an initialized list.

func (*PathItemList) Back added in v0.10.1

func (l *PathItemList) Back() *PathItemElement

Back returns the last element of list l or nil if the list is empty.

func (*PathItemList) Front added in v0.10.1

func (l *PathItemList) Front() *PathItemElement

Front returns the first element of list l or nil if the list is empty.

func (*PathItemList) Init added in v0.10.1

func (l *PathItemList) Init() *PathItemList

Init initializes or clears list l.

func (*PathItemList) InsertAfter added in v0.10.1

func (l *PathItemList) InsertAfter(v []string, mark *PathItemElement) *PathItemElement

InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.

func (*PathItemList) InsertBefore added in v0.10.1

func (l *PathItemList) InsertBefore(v []string, mark *PathItemElement) *PathItemElement

InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.

func (*PathItemList) Len added in v0.10.1

func (l *PathItemList) Len() int

Len returns the number of elements of list l. The complexity is O(1).

func (*PathItemList) MoveAfter added in v0.10.1

func (l *PathItemList) MoveAfter(e, mark *PathItemElement)

MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.

func (*PathItemList) MoveBefore added in v0.10.1

func (l *PathItemList) MoveBefore(e, mark *PathItemElement)

MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.

func (*PathItemList) MoveToBack added in v0.10.1

func (l *PathItemList) MoveToBack(e *PathItemElement)

MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.

func (*PathItemList) MoveToFront added in v0.10.1

func (l *PathItemList) MoveToFront(e *PathItemElement)

MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.

func (*PathItemList) PushBack added in v0.10.1

func (l *PathItemList) PushBack(v []string) *PathItemElement

PushBack inserts a new element e with value v at the back of list l and returns e.

func (*PathItemList) PushBackList added in v0.10.1

func (l *PathItemList) PushBackList(other *PathItemList)

PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same. They must not be nil.

func (*PathItemList) PushFront added in v0.10.1

func (l *PathItemList) PushFront(v []string) *PathItemElement

PushFront inserts a new element e with value v at the front of list l and returns e.

func (*PathItemList) PushFrontList added in v0.10.1

func (l *PathItemList) PushFrontList(other *PathItemList)

PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same. They must not be nil.

func (*PathItemList) Remove added in v0.10.1

func (l *PathItemList) Remove(e *PathItemElement) []string

Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.

type PhoneNumberConverter

type PhoneNumberConverter struct {
	CountryCode string
	Format      phonenumbers.PhoneNumberFormat
}

PhoneNumberConverter converts

func (*PhoneNumberConverter) Convert

func (lc *PhoneNumberConverter) Convert(in any) (out any, err error)

type RPCCDRsFilter

type RPCCDRsFilter struct {
	//CGRIDs                 []string               // If provided, it will filter based on the cgrids present in list
	//NotCGRIDs              []string               // Filter specific CgrIds out
	RunIDs                 []string          // If provided, it will filter on mediation runid
	NotRunIDs              []string          // Filter specific runIds out
	OriginIDs              []string          // If provided, it will filter on OriginIDs
	NotOriginIDs           []string          // Filter specific OriginIDs out
	OriginHosts            []string          // If provided, it will filter cdrhost
	NotOriginHosts         []string          // Filter out specific cdr hosts
	Sources                []string          // If provided, it will filter cdrsource
	NotSources             []string          // Filter out specific CDR sources
	ToRs                   []string          // If provided, filter on TypeOfRecord
	NotToRs                []string          // Filter specific TORs out
	RequestTypes           []string          // If provided, it will fiter reqtype
	NotRequestTypes        []string          // Filter out specific request types
	Tenants                []string          // If provided, it will filter tenant
	NotTenants             []string          // If provided, it will filter tenant
	Categories             []string          // If provided, it will filter çategory
	NotCategories          []string          // Filter out specific categories
	Accounts               []string          // If provided, it will filter account
	NotAccounts            []string          // Filter out specific Accounts
	Subjects               []string          // If provided, it will filter the rating subject
	NotSubjects            []string          // Filter out specific subjects
	DestinationPrefixes    []string          // If provided, it will filter on destination prefix
	NotDestinationPrefixes []string          // Filter out specific destination prefixes
	Costs                  []float64         // Query based on costs specified
	NotCosts               []float64         // Filter out specific costs out from result
	ExtraFields            map[string]string // Query based on extra fields content
	NotExtraFields         map[string]string // Filter out based on extra fields content
	SetupTimeStart         string            // Start of interval, bigger or equal than configured
	SetupTimeEnd           string            // End interval, smaller than setupTime
	AnswerTimeStart        string            // Start of interval, bigger or equal than configured
	AnswerTimeEnd          string            // End interval, smaller than answerTime
	CreatedAtStart         string            // Start of interval, bigger or equal than configured
	CreatedAtEnd           string            // End interval, smaller than
	UpdatedAtStart         string            // Start of interval, bigger or equal than configured
	UpdatedAtEnd           string            // End interval, smaller than
	MinUsage               string            // Start of the usage interval (>=)
	MaxUsage               string            // End of the usage interval (<)
	OrderBy                string            // Ascendent/Descendent
	ExtraArgs              map[string]any    // it will contain optional arguments like: OrderIDStart,OrderIDEnd,MinCost and MaxCost
	Paginator                                // Add pagination
}

RPCCDRsFilter is a filter used in Rpc calls RPCCDRsFilter is slightly different than CDRsFilter by using string instead of Time filters

type RPCCDRsFilterWithAPIOpts

type RPCCDRsFilterWithAPIOpts struct {
	*RPCCDRsFilter
	APIOpts map[string]any
	Tenant  string
}

type RSRFilter

type RSRFilter struct {
	// contains filtered or unexported fields
}

One filter rule

func NewRSRFilter

func NewRSRFilter(fltrVal string) (rsrFltr *RSRFilter, err error)

NewRSRFilter instantiates a new RSRFilter, setting it's properties

func NewRSRFilterMustCompile

func NewRSRFilterMustCompile(fltrVal string) (rsrFltr *RSRFilter)

NewRSRFilterMustCompile is used mostly in tests

func (*RSRFilter) Clone

func (rsrFltr *RSRFilter) Clone() *RSRFilter

Clone method for RSRFilter struct

func (*RSRFilter) FilterRule

func (rsrFltr *RSRFilter) FilterRule() string

func (*RSRFilter) Pass

func (rsrFltr *RSRFilter) Pass(val string) bool

type RSRFilters

type RSRFilters []*RSRFilter

func ParseRSRFilters

func ParseRSRFilters(fldsStr, sep string) (RSRFilters, error)

func ParseRSRFiltersFromSlice

func ParseRSRFiltersFromSlice(fltrStrs []string) (RSRFilters, error)

func (RSRFilters) FilterRules

func (fltrs RSRFilters) FilterRules() (rls string)

func (RSRFilters) Pass

func (fltrs RSRFilters) Pass(val string, allMustMatch bool) (matched bool)

@all: specifies whether all filters should match or at least one

type RSRParser

type RSRParser struct {
	Rules string // Rules container holding the string rules, public so it can be stored

	Path string // instruct extracting info out of header in event
	// contains filtered or unexported fields
}

RSRParser is a parser for data coming from various sources

func NewRSRParser

func NewRSRParser(parserRules string) (rsrParser *RSRParser, err error)

NewRSRParser builds one RSRParser

func NewRSRParserMustCompile

func NewRSRParserMustCompile(parserRules string) (rsrPrsr *RSRParser)

NewRSRParserMustCompile creates a new RSRParser and panic if fails

func (*RSRParser) AttrName

func (prsr *RSRParser) AttrName() string

AttrName exports the attribute name of the RSRParser

func (RSRParser) Clone

func (prsr RSRParser) Clone() (cln *RSRParser)

Clone returns a deep copy of RSRParser

func (*RSRParser) Compile

func (prsr *RSRParser) Compile() (err error)

Compile parses Rules string and repopulates other fields

func (*RSRParser) CompileDynRule

func (prsr *RSRParser) CompileDynRule(dP DataProvider) (p string, err error)

CompileDynRule will return the compiled dynamic rule

func (*RSRParser) ParseDataProvider

func (prsr *RSRParser) ParseDataProvider(dP DataProvider) (out string, err error)

ParseDataProvider will parse the dataprovider using DPDynamicString

func (*RSRParser) ParseDataProviderWithInterfaces

func (prsr *RSRParser) ParseDataProviderWithInterfaces(dP DataProvider) (out string, err error)

ParseDataProviderWithInterfaces will parse the dataprovider using DPDynamicInterface

func (*RSRParser) ParseDataProviderWithInterfaces2

func (prsr *RSRParser) ParseDataProviderWithInterfaces2(dP DataProvider) (out any, err error)

ParseDataProviderWithInterfaces will parse the dataprovider using DPDynamicInterface

func (*RSRParser) ParseValue

func (prsr *RSRParser) ParseValue(value any) (out string, err error)

ParseValue will parse the value out considering converters

type RSRParsers

type RSRParsers []*RSRParser

RSRParsers is a set of RSRParser

func NewRSRParsers

func NewRSRParsers(parsersRules, sep string) (prsrs RSRParsers, err error)

NewRSRParsers creates a new RSRParsers by spliting the rule using the separator

func NewRSRParsersFromSlice

func NewRSRParsersFromSlice(parsersRules []string) (prsrs RSRParsers, err error)

NewRSRParsersFromSlice creates a new RSRParsers from a slice

func NewRSRParsersMustCompile

func NewRSRParsersMustCompile(parsersRules string, rsrSeparator string) (prsrs RSRParsers)

NewRSRParsersMustCompile creates a new RSRParsers and panic if fails

func (RSRParsers) AsStringSlice

func (prsrs RSRParsers) AsStringSlice() (v []string)

func (RSRParsers) Clone

func (prsrs RSRParsers) Clone() (cln RSRParsers)

Clone returns a deep copy of RSRParsers

func (RSRParsers) Compile

func (prsrs RSRParsers) Compile() (err error)

Compile parses Rules string and repopulates other fields

func (RSRParsers) GetIfaceFromValues

func (prsrs RSRParsers) GetIfaceFromValues(evNm DataProvider) (iFaceVals []any, err error)

GetIfaceFromValues returns an interface for each RSRParser

func (RSRParsers) GetRule

func (prsrs RSRParsers) GetRule() (out string)

GetRule returns the original string from which the rules were composed

func (RSRParsers) ParseDataProvider

func (prsrs RSRParsers) ParseDataProvider(dP DataProvider) (out string, err error)

ParseDataProvider will parse the dataprovider using DPDynamicString

func (RSRParsers) ParseDataProviderWithInterfaces

func (prsrs RSRParsers) ParseDataProviderWithInterfaces(dP DataProvider) (out string, err error)

ParseDataProviderWithInterfaces will parse the dataprovider using DPDynamicInterface

func (RSRParsers) ParseDataProviderWithInterfaces2

func (prsrs RSRParsers) ParseDataProviderWithInterfaces2(dP DataProvider) (out any, err error)

ParseDataProviderWithInterfaces will parse the dataprovider using DPDynamicInterface

func (RSRParsers) ParseValue

func (prsrs RSRParsers) ParseValue(value any) (out string, err error)

ParseValue will parse the value out considering converters

type RWDataProvider

type RWDataProvider interface {
	DataProvider

	Set(fldPath []string, val any) (err error)
	Remove(fldPath []string) (err error)
}

RWDataProvider is a DataProvider with write methods on it

type RandomConverter

type RandomConverter struct {
	// contains filtered or unexported fields
}

func (*RandomConverter) Convert

func (rC *RandomConverter) Convert(in any) (
	out any, err error)

Convert implements DataConverter interface

type Ranking

type Ranking struct {
	Tenant            string
	ID                string
	LastUpdate        time.Time
	Metrics           map[string]map[string]float64 // map[statID]map[metricID]metricValue
	Sorting           string
	SortingParameters []string

	SortedStatIDs []string
	// contains filtered or unexported fields
}

Ranking represents a collection of metrics with ranked statistics.

func NewRankingFromProfile

func NewRankingFromProfile(rkP *RankingProfile) (rk *Ranking)

NewRankingFromProfile creates a new Ranking based on profile configuration.

func (*Ranking) AsRankingSummary

func (r *Ranking) AsRankingSummary() (rkSm *RankingSummary)

AsRankingSummary creates a summary with the most recent ranking data.

func (*Ranking) CacheClone

func (r *Ranking) CacheClone() any

CacheClone returns a clone of Ranking used by ltcache CacheCloner

func (*Ranking) Clone

func (r *Ranking) Clone() *Ranking

Clone clones *Ranking

func (*Ranking) Config

func (r *Ranking) Config() *RankingProfile

Config returns the ranking's profile configuration.

func (*Ranking) Lock

func (r *Ranking) Lock()

Lock locks the ranking mutex.

func (*Ranking) MetricIDs

func (r *Ranking) MetricIDs() StringSet

MetricIDs returns the set of metric IDs for this ranking.

func (*Ranking) RLock

func (r *Ranking) RLock()

RLock locks the ranking mutex for reading.

func (*Ranking) RUnlock

func (r *Ranking) RUnlock()

RUnlock unlocks the read lock on the ranking mutex.

func (*Ranking) SetConfig

func (r *Ranking) SetConfig(rp *RankingProfile)

SetConfig sets the ranking's profile configuration.

func (*Ranking) TenantID

func (r *Ranking) TenantID() string

TenantID returns the concatenated tenant and ID.

func (*Ranking) Unlock

func (r *Ranking) Unlock()

Unlock unlocks the ranking mutex.

type RankingProfile

type RankingProfile struct {
	Tenant            string   // Tenant this profile belongs to
	ID                string   // Profile identification
	Schedule          string   // Cron schedule this profile should run at
	StatIDs           []string // List of stat instances to query
	MetricIDs         []string // Filter out only specific metrics in reply for sorting
	Sorting           string   // Sorting strategy. Possible values: <*asc|*desc>
	SortingParameters []string // Sorting parameters: depending on sorting type, list of metric ids for now with optional true or false in case of reverse logic is desired
	Stored            bool     // Offline storage activation for this profile
	ThresholdIDs      []string // List of threshold IDs to limit this Ranking to. *none to disable threshold processing for it.
}

RankingProfile defines the configuration of the Ranking.

func (*RankingProfile) CacheClone

func (rkP *RankingProfile) CacheClone() any

CacheClone returns a clone of RankingProfile used by ltcache CacheCloner

func (*RankingProfile) Clone

func (rkP *RankingProfile) Clone() (cln *RankingProfile)

Clone creates a deep copy of RankingProfile for thread-safe use.

func (*RankingProfile) FieldAsInterface

func (rp *RankingProfile) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*RankingProfile) FieldAsString

func (rp *RankingProfile) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*RankingProfile) Merge

func (rp *RankingProfile) Merge(v2 any)

Merge implements the profile interface, merging values from another RankingProfile.

func (*RankingProfile) Set

func (rp *RankingProfile) Set(path []string, val any, _ bool) (err error)

Set implements the profile interface, setting values in RankingProfile based on path.

func (*RankingProfile) String

func (rp *RankingProfile) String() string

String implements the DataProvider interface, returning the RankingProfile in JSON format.

func (*RankingProfile) TenantID

func (sgp *RankingProfile) TenantID() string

TenantID returns the concatenated tenant and ID.

type RankingProfileWithAPIOpts

type RankingProfileWithAPIOpts struct {
	*RankingProfile
	APIOpts map[string]any
}

RankingWithAPIOpts wraps Ranking with APIOpts.

type RankingSummary

type RankingSummary struct {
	Tenant        string
	ID            string
	LastUpdate    time.Time
	SortedStatIDs []string
}

RankingSummary holds the most recent ranking metrics.

type RankingWithAPIOpts

type RankingWithAPIOpts struct {
	*Ranking
	APIOpts map[string]any
}

RankingWithAPIOpts wraps Ranking with APIOpts.

type Rate

type Rate struct {
	ID              string         // RateID
	FilterIDs       []string       // RateFilterIDs
	ActivationTimes string         // ActivationTimes is a cron formatted time interval
	Weights         DynamicWeights // RateWeights will decide the winner per interval start
	Blocker         bool           // RateBlocker will make this rate recurrent, deactivating further intervals
	IntervalRates   []*IntervalRate
	// contains filtered or unexported fields
}

Rate defines rate related information used within a RateProfile

func (*Rate) Clone

func (rt *Rate) Clone() *Rate

Clone returns a copy of rt

func (*Rate) Compile

func (rt *Rate) Compile() (err error)

func (*Rate) FieldAsInterface

func (rt *Rate) FieldAsInterface(fldPath []string) (_ any, err error)

func (*Rate) FieldAsString

func (rt *Rate) FieldAsString(fldPath []string) (_ string, err error)

func (*Rate) Merge

func (rt *Rate) Merge(vi *Rate)

func (*Rate) RunTimes

func (rt *Rate) RunTimes(sTime, eTime time.Time, verbosity int) (aTimes [][]time.Time, err error)

RunTimes returns the set of activation and deactivation times for this rate on the interval between >=sTime and <eTime aTimes is in the form of [][]

func (*Rate) Set

func (rt *Rate) Set(path []string, val any, newBranch bool) (err error)

func (*Rate) String

func (rt *Rate) String() string

func (*Rate) UID

func (rt *Rate) UID() string

UID returns system wide unique identifier

type RateProfile

type RateProfile struct {
	Tenant          string
	ID              string
	FilterIDs       []string
	Weights         DynamicWeights
	MinCost         *Decimal
	MaxCost         *Decimal
	MaxCostStrategy string
	Rates           map[string]*Rate
}

RateProfile represents the configuration of a Rate profile

func NewRateProfileFromMapDataDBMap

func NewRateProfileFromMapDataDBMap(tnt, id string, mapRP map[string]any, ms Marshaler) (rp *RateProfile, err error)

NewRateProfileFromMapDataDBMap will convert a RateProfile map into a RatePRofile struct. This is used when we get the map from redis database

func (*RateProfile) AsDataDBMap

func (rp *RateProfile) AsDataDBMap(ms Marshaler) (mp map[string]any, err error)

AsDataDBMap is used to is a convert method in order to properly set trough a hasmap in redis server our rate profile

func (*RateProfile) CacheClone

func (rp *RateProfile) CacheClone() any

CacheClone returns a clone of RateProfile used by ltcache CacheCloner

func (*RateProfile) Clone

func (rp *RateProfile) Clone() *RateProfile

Clone clones *RateProfile

func (*RateProfile) Compile

func (rp *RateProfile) Compile() (err error)

func (*RateProfile) FieldAsInterface

func (rp *RateProfile) FieldAsInterface(fldPath []string) (_ any, err error)

func (*RateProfile) FieldAsString

func (rp *RateProfile) FieldAsString(fldPath []string) (_ string, err error)

func (*RateProfile) Merge

func (rp *RateProfile) Merge(v2 any)

func (*RateProfile) Set

func (rp *RateProfile) Set(path []string, val any, newBranch bool) (err error)

func (*RateProfile) Sort

func (rpp *RateProfile) Sort()

Sort will sort the IntervalRates from each Rate based on IntervalStart

func (*RateProfile) String

func (rp *RateProfile) String() string

func (*RateProfile) TenantID

func (rp *RateProfile) TenantID() string

type RateProfileCost

type RateProfileCost struct {
	ID              string // RateProfileID
	Cost            *Decimal
	MinCost         *Decimal
	MaxCost         *Decimal
	MaxCostStrategy string
	CostIntervals   []*RateSIntervalCost
	Rates           map[string]*IntervalRate
	Altered         []string
}

RateProfileCost is the cost returned by RateS at cost queries

func (*RateProfileCost) CorrectCost

func (rPc *RateProfileCost) CorrectCost(rndDec *int, rndMtd string)

CorrectCost should be called in final phase of cost calculation in order to apply further correction like Min/MaxCost or rounding

func (*RateProfileCost) Equals

func (rpC *RateProfileCost) Equals(nRpCt *RateProfileCost) (eq bool)

Equals returns the equality between two RateProfileCost

type RateProfileWithAPIOpts

type RateProfileWithAPIOpts struct {
	*RateProfile
	APIOpts map[string]any
}

RateProfileWithAPIOpts is used in replicatorV1 for dispatcher

type RateSIncrement

type RateSIncrement struct {
	IncrementStart    *Decimal
	RateIntervalIndex int
	RateID            string
	CompressFactor    int64
	Usage             *Decimal
	// contains filtered or unexported fields
}

func (*RateSIncrement) AsRateSIncrementCost

func (rI *RateSIncrement) AsRateSIncrementCost() (rIc *RateSIncrementCost)

AsRateSIncrementCost converts RateSIncrement to RateSIncrementCost The difference between this 2 is that RateSIncrementCost don't need IncrementStart

func (*RateSIncrement) Clone

func (rI *RateSIncrement) Clone() *RateSIncrement

Clone returns a copy of rI

func (*RateSIncrement) CompressEquals

func (rIcr *RateSIncrement) CompressEquals(rIcr2 *RateSIncrement) (eq bool)

CompressEquals compares two RateSIncrement for Compress function

func (*RateSIncrement) Cost

func (rIcr *RateSIncrement) Cost(rts map[string]*IntervalRate) (cost *decimal.Big)

Cost computes the Cost on RateSIncrement

func (*RateSIncrement) Equals

func (rI *RateSIncrement) Equals(rtIn *RateSIncrement, rIRef, rtInRef map[string]*IntervalRate) (eq bool)

Equals returns the equality between two RateSIncrement

func (*RateSIncrement) FieldAsInterface

func (rI *RateSIncrement) FieldAsInterface(fldPath []string) (_ any, err error)

type RateSIncrementCost

type RateSIncrementCost struct {
	Usage             *Decimal
	RateID            string
	RateIntervalIndex int
	CompressFactor    int64
}

RateSIncrementCost is used in the RateProfileCost to reflect RateSIncrement

func (*RateSIncrementCost) Equals

func (rIncrC *RateSIncrementCost) Equals(nRi *RateSIncrementCost, rIRef, rtInRef map[string]*IntervalRate) (eq bool)

Equals returns the equality between two RateSIncrementCost

type RateSInterval

type RateSInterval struct {
	IntervalStart  *Decimal
	Increments     []*RateSIncrement
	CompressFactor int64
	// contains filtered or unexported fields
}

RateSInterval is used by RateS to integrate Rate info for one charging interval

func (*RateSInterval) AsRatesIntervalsCost

func (rI *RateSInterval) AsRatesIntervalsCost() (rIc *RateSIntervalCost)

AsRatesIntervalsCost converts RateSInterval to RateSIntervalCost The difference between this 2 is that RateSIntervalCost don't need IntervalStart

func (*RateSInterval) Clone

func (rI *RateSInterval) Clone() *RateSInterval

Clone returns a copy of rI

func (*RateSInterval) CompressEquals

func (rIv *RateSInterval) CompressEquals(rIv2 *RateSInterval) (eq bool)

CompressEquals compares two RateSIntervals for Compress function

func (*RateSInterval) Cost

func (rIv *RateSInterval) Cost(rts map[string]*IntervalRate) (cost *decimal.Big)

func (*RateSInterval) Equals

func (rIl *RateSInterval) Equals(nRil *RateSInterval, rIlRef, nRilRef map[string]*IntervalRate) (eq bool)

Equals compares two RateSIntervals

func (*RateSInterval) FieldAsInterface

func (rI *RateSInterval) FieldAsInterface(fldPath []string) (any, error)

type RateSIntervalCost

type RateSIntervalCost struct {
	Increments     []*RateSIncrementCost
	CompressFactor int64
}

RateSIntervalCost is used in the RateProfileCost to reflect the RateSInterval used

func (*RateSIntervalCost) Equals

func (rIC *RateSIntervalCost) Equals(nRIc *RateSIntervalCost, rIlRef, nRilRef map[string]*IntervalRate) (eq bool)

Equals returns the equality between two RateSIntervalCost

type ReSearchReplace

type ReSearchReplace struct {
	SearchRegexp    *regexp.Regexp
	ReplaceTemplate string
}

ReSearchReplace id regexp Search/Replace, used for example for field formatting

func (ReSearchReplace) Clone

func (rsr ReSearchReplace) Clone() (cln *ReSearchReplace)

Clone returns a deep copy of ReSearchReplace

func (*ReSearchReplace) Process

func (rsr *ReSearchReplace) Process(source string) string

Process process the string with the regex

type RemoveRPrfRates

type RemoveRPrfRates struct {
	Tenant  string
	ID      string
	RateIDs []string
	APIOpts map[string]any
}

type Resource

type Resource struct {
	Tenant string
	ID     string
	Usages map[string]*ResourceUsage
	TTLIdx []string // holds ordered list of ResourceIDs based on their TTL, empty if feature is disableda
}

Resource represents a resource in the system not thread safe, needs locking at process level

func (*Resource) CacheClone

func (r *Resource) CacheClone() any

CacheClone returns a clone of Resource used by ltcache CacheCloner

func (*Resource) Clone

func (r *Resource) Clone() *Resource

Clone clones *Resource (lkID excluded)

func (*Resource) TenantID

func (r *Resource) TenantID() string

TenantID returns the unique ID in a multi-tenant environment

func (*Resource) TotalUsage

func (r *Resource) TotalUsage() float64

TotalUsage returns the sum of all usage units Exported to be used in FilterS

type ResourceProfile

type ResourceProfile struct {
	Tenant            string
	ID                string // identifier of this resource
	FilterIDs         []string
	UsageTTL          time.Duration // auto-expire the usage after this duration
	Limit             float64       // limixt value
	AllocationMessage string        // message returned by the winning resource on allocation
	Blocker           bool          // blocker flag to stop processing on filters matched
	Stored            bool
	Weights           DynamicWeights // Weight to sort the resources
	ThresholdIDs      []string       // Thresholds to check after changing Limit
}

ResourceProfile represents the user configuration for the resource

func (*ResourceProfile) CacheClone

func (rp *ResourceProfile) CacheClone() any

CacheClone returns a clone of ResourceProfile used by ltcache CacheCloner

func (*ResourceProfile) Clone

func (rp *ResourceProfile) Clone() *ResourceProfile

Clone clones *ResourceProfile (lkID excluded)

func (*ResourceProfile) FieldAsInterface

func (rp *ResourceProfile) FieldAsInterface(fldPath []string) (_ any, err error)

func (*ResourceProfile) FieldAsString

func (rp *ResourceProfile) FieldAsString(fldPath []string) (_ string, err error)

func (*ResourceProfile) Merge

func (rp *ResourceProfile) Merge(v2 any)

func (*ResourceProfile) Set

func (rp *ResourceProfile) Set(path []string, val any, _ bool) (err error)

func (*ResourceProfile) String

func (rp *ResourceProfile) String() string

func (*ResourceProfile) TenantID

func (rp *ResourceProfile) TenantID() string

TenantID returns unique identifier of the ResourceProfile in a multi-tenant environment

type ResourceProfileWithAPIOpts

type ResourceProfileWithAPIOpts struct {
	*ResourceProfile
	APIOpts map[string]any
}

ResourceProfileWithAPIOpts is used in replicatorV1 for dispatcher

type ResourceUsage

type ResourceUsage struct {
	Tenant     string
	ID         string // Unique identifier of this ResourceUsage, Eg: FreeSWITCH UUID
	ExpiryTime time.Time
	Units      float64 // Number of units used
}

ResourceUsage represents an usage counted

func (*ResourceUsage) Clone

func (ru *ResourceUsage) Clone() (cln *ResourceUsage)

Clone duplicates ru

func (*ResourceUsage) IsActive

func (ru *ResourceUsage) IsActive(atTime time.Time) bool

isActive checks ExpiryTime at some time

func (*ResourceUsage) TenantID

func (ru *ResourceUsage) TenantID() string

TenantID returns the concatenated key between tenant and ID

type ResourceWithAPIOpts

type ResourceWithAPIOpts struct {
	*Resource
	APIOpts map[string]any
}

ResourceWithAPIOpts is used in replicatorV1 for dispatcher

type ResourceWithConfig

type ResourceWithConfig struct {
	*Resource
	Config *ResourceProfile
}

func (*ResourceWithConfig) Available

func (r *ResourceWithConfig) Available() float64

Available returns the available number of units Exported method to be used by filterS

type RoundConverter

type RoundConverter struct {
	Decimals int
	Method   string
}

RoundConverter will round floats

func (*RoundConverter) Convert

func (rnd *RoundConverter) Convert(in any) (out any, err error)

type Route

type Route struct {
	ID              string // RouteID
	FilterIDs       []string
	AccountIDs      []string
	RateProfileIDs  []string // used when computing price
	ResourceIDs     []string // queried in some strategies
	StatIDs         []string // queried in some strategies
	Weights         DynamicWeights
	Blockers        DynamicBlockers // if true, stops processing further routes
	RouteParameters string
	// contains filtered or unexported fields
}

Route defines a single route within a RouteProfile.

func (*Route) Clone

func (r *Route) Clone() *Route

Clone method for Route

func (*Route) FieldAsInterface

func (r *Route) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*Route) FieldAsString

func (r *Route) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*Route) Merge

func (r *Route) Merge(v2 *Route)

Merge implements the merge interface, merging values from another Route.

func (*Route) Ratio

func (r *Route) Ratio() any

Ratio returns the cached ratio value for this route.

func (*Route) String

func (r *Route) String() string

String implements the DataProvider interface, returning the Route in JSON format.

type RouteProfile

type RouteProfile struct {
	Tenant            string
	ID                string // LCR Profile ID
	FilterIDs         []string
	Weights           DynamicWeights
	Blockers          DynamicBlockers
	Sorting           string // Sorting strategy
	SortingParameters []string
	Routes            []*Route
}

RouteProfile represents the configuration of a Route profile.

func (*RouteProfile) CacheClone

func (rp *RouteProfile) CacheClone() any

CacheClone returns a clone of RouteProfile used by ltcache CacheCloner

func (*RouteProfile) Clone

func (rp *RouteProfile) Clone() *RouteProfile

Clone method for RouteProfile

func (*RouteProfile) Compile

func (rp *RouteProfile) Compile() error

Compile is a wrapper for convenience setting up the RouteProfile.

func (*RouteProfile) FieldAsInterface

func (rp *RouteProfile) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*RouteProfile) FieldAsString

func (rp *RouteProfile) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*RouteProfile) Merge

func (rp *RouteProfile) Merge(v2 any)

Merge implements the profile interface, merging values from another RouteProfile.

func (*RouteProfile) Set

func (rp *RouteProfile) Set(path []string, val any, newBranch bool) (err error)

Set implements the profile interface, setting values in RouteProfile based on path.

func (*RouteProfile) String

func (rp *RouteProfile) String() string

String implements the DataProvider interface, returning the RouteProfile in JSON format.

func (*RouteProfile) TenantID

func (rp *RouteProfile) TenantID() string

TenantID returns unique identifier of the LCRProfile in a multi-tenant environment.

type RouteProfileWithAPIOpts

type RouteProfileWithAPIOpts struct {
	*RouteProfile
	APIOpts map[string]any
}

RouteProfileWithAPIOpts wraps RouteProfile with APIOpts.

type SIPURIHostConverter

type SIPURIHostConverter struct{}

SIPURIHostConverter will return the

func (*SIPURIHostConverter) Convert

func (*SIPURIHostConverter) Convert(in any) (out any, err error)

Convert implements DataConverter interface

type SIPURIMethodConverter

type SIPURIMethodConverter struct{}

SIPURIMethodConverter will return the

func (*SIPURIMethodConverter) Convert

func (*SIPURIMethodConverter) Convert(in any) (out any, err error)

Convert implements DataConverter interface

type SIPURIUserConverter

type SIPURIUserConverter struct{}

SIPURIUserConverter will return the

func (*SIPURIUserConverter) Convert

func (*SIPURIUserConverter) Convert(in any) (out any, err error)

Convert implements DataConverter interface

type SafeMapStorage

type SafeMapStorage struct {
	MapStorage
	sync.RWMutex
}

SafeMapStorage is a Mapstorage with mutex

func (*SafeMapStorage) Clone

func (ms *SafeMapStorage) Clone() (msClone *SafeMapStorage)

func (*SafeMapStorage) ClonedMapStorage

func (ms *SafeMapStorage) ClonedMapStorage() (msClone MapStorage)

func (*SafeMapStorage) FieldAsInterface

func (ms *SafeMapStorage) FieldAsInterface(fldPath []string) (val any, err error)

FieldAsInterface returns the value from the path

func (*SafeMapStorage) FieldAsString

func (ms *SafeMapStorage) FieldAsString(fldPath []string) (str string, err error)

FieldAsString returns the value from path as string

func (*SafeMapStorage) GetKeys

func (ms *SafeMapStorage) GetKeys(nested bool, nestedLimit int, prefix string) (keys []string)

GetKeys returns all the keys from map

func (*SafeMapStorage) Remove

func (ms *SafeMapStorage) Remove(fldPath []string) (err error)

Remove removes the item at path

func (*SafeMapStorage) Set

func (ms *SafeMapStorage) Set(fldPath []string, val any) (err error)

Set sets the value at the given path

func (*SafeMapStorage) String

func (ms *SafeMapStorage) String() string

String returns the map as json string

type ScheduledRanking

type ScheduledRanking struct {
	RankingID string
	Next      time.Time
	Previous  time.Time
}

type ScheduledTrend

type ScheduledTrend struct {
	TrendID  string
	Next     time.Time
	Previous time.Time
}

type Server

type Server interface {
	RpcRegister(rcvr any)
	RpcRegisterName(name string, rcvr any)
	RegisterHTTPFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	RegisterHttpHandler(pattern string, handler http.Handler)
	BiRPCRegisterName(method string, handlerFunc any)
}

type SessionFilter

type SessionFilter struct {
	Limit   *int
	Filters []string
	Tenant  string
	APIOpts map[string]any
}

type SessionIDsWithAPIOpts

type SessionIDsWithAPIOpts struct {
	IDs     []string
	Tenant  string
	APIOpts map[string]any
}

type SetIndexesArg

type SetIndexesArg struct {
	IdxItmType string
	TntCtx     string
	Indexes    map[string]StringSet
	Tenant     string
	APIOpts    map[string]any
}

SetIndexesArg the API arguments needed for seting an index

type SliceConverter

type SliceConverter struct{}

SliceConverter converts the interface in the unix time

func (SliceConverter) Convert

func (SliceConverter) Convert(in any) (out any, err error)

Convert implements DataConverter interface

type StdLogger

type StdLogger struct {
	// contains filtered or unexported fields
}

func NewStdLogger

func NewStdLogger(nodeID string, level int) *StdLogger

func NewStdLoggerWithWriter

func NewStdLoggerWithWriter(w io.Writer, nodeID string, level int) *StdLogger

func (*StdLogger) Alert

func (sl *StdLogger) Alert(m string) (err error)

Alert logs to stderr with alert level

func (*StdLogger) Close

func (sl *StdLogger) Close() (err error)

func (*StdLogger) Crit

func (sl *StdLogger) Crit(m string) (err error)

Crit logs to stderr with critical level

func (*StdLogger) Debug

func (sl *StdLogger) Debug(m string) (err error)

Debug logs to stderr with debug level

func (*StdLogger) Emerg

func (sl *StdLogger) Emerg(m string) (err error)

Emerg logs to stderr with emergency level

func (*StdLogger) Err

func (sl *StdLogger) Err(m string) (err error)

Err logs to stderr with error level

func (*StdLogger) GetLogLevel

func (sl *StdLogger) GetLogLevel() int

GetLogLevel() returns the level logger number for the server

func (*StdLogger) GetSyslog

func (sl *StdLogger) GetSyslog() *syslog.Writer

func (*StdLogger) Info

func (sl *StdLogger) Info(m string) (err error)

Info logs to stderr with info level

func (*StdLogger) Notice

func (sl *StdLogger) Notice(m string) (err error)

Notice logs to stderr with notice level

func (*StdLogger) SetLogLevel

func (sl *StdLogger) SetLogLevel(level int)

SetLogLevel changes the log level

func (*StdLogger) Warning

func (sl *StdLogger) Warning(m string) (err error)

Warning logs to stderr with warning level

func (*StdLogger) Write

func (sl *StdLogger) Write(p []byte) (n int, err error)

type String2HexConverter added in v0.10.2

type String2HexConverter struct{}

String2HexConverter will transform the string to hex

func (*String2HexConverter) Convert added in v0.10.2

func (*String2HexConverter) Convert(in any) (o any, err error)

Convert implements DataConverter interface

type StringSet

type StringSet map[string]struct{}

StringSet will manage data within a set

func JoinStringSet

func JoinStringSet(s ...StringSet) (conc StringSet)

JoinStringSet intersect multiple StringSets in one

func NewStringSet

func NewStringSet(dataSlice []string) (s StringSet)

NewStringSet returns a new StringSet

func (StringSet) Add

func (s StringSet) Add(val string)

Add adds a key in set

func (StringSet) AddSlice

func (s StringSet) AddSlice(dataSlice []string)

AddSlice adds all the element of a slice

func (StringSet) AsOrderedSlice added in v0.10.1

func (s StringSet) AsOrderedSlice() (ss []string)

AsOrderedSlice returns the keys as ordered string slice

func (StringSet) AsSlice

func (s StringSet) AsSlice() []string

AsSlice returns the keys as string slice

func (StringSet) Clone

func (s StringSet) Clone() (cln StringSet)

Clone creates a clone of the set

func (StringSet) Equals

func (s StringSet) Equals(s2 StringSet) bool

Equals returns true if the set are the same

func (StringSet) FieldAsInterface

func (s StringSet) FieldAsInterface(fldPath []string) (any, error)

FieldAsInterface returns an empty structure if the path exists else ErrNotFound

func (StringSet) FieldAsString

func (s StringSet) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString returns an empty structure as a json string if the path exists else ErrNotFound

func (StringSet) GetOne

func (s StringSet) GetOne() string

GetOne returns a key from set

func (StringSet) Has

func (s StringSet) Has(val string) bool

Has returns if the key is in set

func (StringSet) Intersect

func (s StringSet) Intersect(s2 StringSet)

Intersect removes all key s2 do not have

func (StringSet) Remove

func (s StringSet) Remove(val string)

Remove removes a key from set

func (StringSet) Sha1 added in v0.10.1

func (s StringSet) Sha1() string

Sha1 returns the Sha1 on top of ordered slice

func (StringSet) Size

func (s StringSet) Size() int

Size returns the size of the set

func (StringSet) String

func (s StringSet) String() string

String returns the set as a json string ( the fields are not ordered)

type StringWithAPIOpts

type StringWithAPIOpts struct {
	APIOpts map[string]any
	Tenant  string
	Arg     string
}

type StripConverter

type StripConverter struct {
	// contains filtered or unexported fields
}

StripConverter strips the prefix, the suffix or both from a string.

func (StripConverter) Convert

func (sc StripConverter) Convert(in any) (any, error)

Convert trims the input string based on the StripConverter's configuration. It returns a CAST_FAILED error if the input is not a string.

type SyncedChan

type SyncedChan struct {
	// contains filtered or unexported fields
}

func NewSyncedChan

func NewSyncedChan() *SyncedChan

func (*SyncedChan) CloseOnce

func (s *SyncedChan) CloseOnce()

func (*SyncedChan) Done

func (s *SyncedChan) Done() <-chan struct{}

type SysLogger

type SysLogger struct {
	// contains filtered or unexported fields
}

func NewSysLogger

func NewSysLogger(nodeID string, level int) (logger *SysLogger, err error)

func (*SysLogger) Alert

func (sl *SysLogger) Alert(m string) (_ error)

Alert logs to syslog with alert level

func (*SysLogger) Close

func (sl *SysLogger) Close() (err error)

func (*SysLogger) Crit

func (sl *SysLogger) Crit(m string) (_ error)

Crit logs to syslog with critical level

func (*SysLogger) Debug

func (sl *SysLogger) Debug(m string) (_ error)

Debug logs to syslog with debug level

func (*SysLogger) Emerg

func (sl *SysLogger) Emerg(m string) (_ error)

Emerg logs to syslog with emergency level

func (*SysLogger) Err

func (sl *SysLogger) Err(m string) (_ error)

Err logs to syslog with error level

func (*SysLogger) GetLogLevel

func (sl *SysLogger) GetLogLevel() int

GetLogLevel() returns the level logger number for the server

func (*SysLogger) GetSyslog

func (sl *SysLogger) GetSyslog() *syslog.Writer

func (*SysLogger) Info

func (sl *SysLogger) Info(m string) (_ error)

Info logs to syslog with info level

func (*SysLogger) Notice

func (sl *SysLogger) Notice(m string) (_ error)

Notice logs to syslog with notice level

func (*SysLogger) SetLogLevel

func (sl *SysLogger) SetLogLevel(level int)

SetLogLevel changes the log level

func (*SysLogger) Warning

func (sl *SysLogger) Warning(m string) (_ error)

Warning logs to syslog with warning level

func (*SysLogger) Write

func (sl *SysLogger) Write(p []byte) (n int, err error)

type TPAPAction

type TPAPAction struct {
	ID        string
	FilterIDs []string
	TTL       string
	Type      string
	Opts      string
	Diktats   []*TPAPDiktat
}

type TPAPDiktat

type TPAPDiktat struct {
	Path  string
	Value string
}

type TPAccount

type TPAccount struct {
	TPid         string
	Tenant       string
	ID           string
	FilterIDs    []string
	Weights      string
	Blockers     string
	Balances     map[string]*TPAccountBalance
	ThresholdIDs []string
}

type TPAccountBalance

type TPAccountBalance struct {
	ID             string
	FilterIDs      []string
	Weights        string
	Blockers       string
	Type           string
	Opts           string
	CostIncrement  []*TPBalanceCostIncrement
	AttributeIDs   []string
	RateProfileIDs []string
	UnitFactors    []*TPBalanceUnitFactor
	Units          string
}

type TPActionProfile

type TPActionProfile struct {
	TPid      string
	Tenant    string
	ID        string
	FilterIDs []string
	Weights   string
	Blockers  string
	Schedule  string
	Targets   []*TPActionTarget
	Actions   []*TPAPAction
}

type TPActionTarget

type TPActionTarget struct {
	TargetType string
	TargetIDs  []string
}

type TPActivationInterval

type TPActivationInterval struct {
	ActivationTime string
	ExpiryTime     string
}

TPActivationInterval represents an activation interval for an item

func (*TPActivationInterval) AsActivationInterval

func (tpAI *TPActivationInterval) AsActivationInterval(timezone string) (ai *ActivationInterval, err error)

AsActivationTime converts TPActivationInterval into ActivationInterval

type TPAttribute

type TPAttribute struct {
	FilterIDs []string
	Blockers  string
	Path      string
	Type      string
	Value     string
}

TPAttribute is used in TPAttributeProfile

type TPAttributeProfile

type TPAttributeProfile struct {
	TPid       string
	Tenant     string
	ID         string
	FilterIDs  []string
	Weights    string
	Blockers   string
	Attributes []*TPAttribute
}

TPAttributeProfile is used in APIs to manage remotely offline AttributeProfile

type TPBalanceCostIncrement

type TPBalanceCostIncrement struct {
	FilterIDs    []string
	Increment    string
	FixedFee     *float64
	RecurrentFee *float64
}

func NewTPBalanceCostIncrement

func NewTPBalanceCostIncrement(filtersStr, incrementStr, fixedFeeStr, recurrentFeeStr string) (costIncrement *TPBalanceCostIncrement, err error)

func (*TPBalanceCostIncrement) AsString

func (costIncr *TPBalanceCostIncrement) AsString() (s string)

type TPBalanceUnitFactor

type TPBalanceUnitFactor struct {
	FilterIDs []string
	Factor    float64
}

func NewTPBalanceUnitFactor

func NewTPBalanceUnitFactor(filtersStr, factorStr string) (unitFactor *TPBalanceUnitFactor, err error)

func (*TPBalanceUnitFactor) AsString

func (unitFactor *TPBalanceUnitFactor) AsString() string

type TPChargerProfile

type TPChargerProfile struct {
	TPid         string
	Tenant       string
	ID           string
	FilterIDs    []string
	Weights      string
	Blockers     string
	RunID        string
	AttributeIDs []string
}

TPChargerProfile is used in APIs to manage remotely offline ChargerProfile

type TPFilter

type TPFilter struct {
	Type    string   // Filter type (*string, *rsr_filters, *cdr_stats)
	Element string   // Name of the field providing us the Values to check (used in case of some )
	Values  []string // Filter definition
}

TPFilter is used in TPFilterProfile

type TPFilterProfile

type TPFilterProfile struct {
	TPid    string
	Tenant  string
	ID      string
	Filters []*TPFilter
}

TPFilterProfile is used in APIs to manage remotely offline FilterProfile

type TPIntervalRate

type TPIntervalRate struct {
	IntervalStart string
	FixedFee      float64
	RecurrentFee  float64 // RateValue
	Unit          string
	Increment     string
}

type TPRankingProfile

type TPRankingProfile struct {
	TPid              string
	Tenant            string
	ID                string
	Schedule          string
	StatIDs           []string
	MetricIDs         []string
	Sorting           string
	SortingParameters []string
	Stored            bool
	ThresholdIDs      []string
}

TPRankingProfile is used in APIs to manage remotely offline RankingProfile

type TPRate

type TPRate struct {
	ID              string   // RateID
	FilterIDs       []string // RateFilterIDs
	ActivationTimes string
	Weights         string // RateWeights will decide the winner per interval start
	Blocker         bool   // RateBlocker will make this rate recurrent, deactivating further intervals
	IntervalRates   []*TPIntervalRate
}

type TPRateProfile

type TPRateProfile struct {
	TPid            string
	Tenant          string
	ID              string
	FilterIDs       []string
	Weights         string
	MinCost         float64
	MaxCost         float64
	MaxCostStrategy string
	Rates           map[string]*TPRate
}

type TPResourceProfile

type TPResourceProfile struct {
	TPid              string
	Tenant            string
	ID                string // Identifier of this limit
	FilterIDs         []string
	UsageTTL          string
	Limit             string // Limit value
	AllocationMessage string
	Blocker           bool // blocker flag to stop processing on filters matched
	Stored            bool
	Weights           string   // Weight to sort the ResourceLimits
	ThresholdIDs      []string // Thresholds to check after changing Limit
}

TPResourceProfile is used in APIs to manage remotely offline ResourceProfile

type TPRoute

type TPRoute struct {
	ID              string // RouteID
	FilterIDs       []string
	AccountIDs      []string
	RateProfileIDs  []string // used when computing price
	ResourceIDs     []string // queried in some strategies
	StatIDs         []string // queried in some strategies
	Weights         string
	Blockers        string
	RouteParameters string
}

TPRoute is used in TPRouteProfile

type TPRouteProfile

type TPRouteProfile struct {
	TPid              string
	Tenant            string
	ID                string
	FilterIDs         []string
	Weights           string
	Blockers          string
	Sorting           string
	SortingParameters []string
	Routes            []*TPRoute
}

TPRouteProfile is used in APIs to manage remotely offline RouteProfile

type TPStatProfile

type TPStatProfile struct {
	TPid         string
	Tenant       string
	ID           string
	FilterIDs    []string
	QueueLength  int
	TTL          string
	MinItems     int
	Weights      string
	Blockers     string // blocker flag to stop processing on filters matched
	Stored       bool
	ThresholdIDs []string
	Metrics      []*MetricWithFilters
}

TPStatProfile is used in APIs to manage remotely offline StatProfile

type TPThresholdProfile

type TPThresholdProfile struct {
	TPid             string
	Tenant           string
	ID               string
	FilterIDs        []string
	MaxHits          int
	MinHits          int
	MinSleep         string
	Blocker          bool   // blocker flag to stop processing on filters matched
	Weights          string // Weight to sort the thresholds
	ActionProfileIDs []string
	Async            bool
}

TPThresholdProfile is used in APIs to manage remotely offline ThresholdProfile

type TPTntID

type TPTntID struct {
	TPid   string
	Tenant string
	ID     string
}

type TPTrendsProfile

type TPTrendsProfile struct {
	TPid            string
	Tenant          string
	ID              string
	Schedule        string
	StatID          string
	Metrics         []string
	TTL             string
	QueueLength     int
	MinItems        int
	CorrelationType string
	Tolerance       float64
	Stored          bool
	ThresholdIDs    []string
}

TPTrendProfile is used in APIs to manage remotely offline TrendProfile

type TenantID

type TenantID struct {
	Tenant string
	ID     string
}

func NewTenantID

func NewTenantID(input string) *TenantID

NewTenantID parses a string in the format of "tenant:ID" and returns a TenantID struct. If the separator is not found, the entire string is treated as the ID.

func (*TenantID) Equal

func (tID *TenantID) Equal(tID2 *TenantID) bool

func (*TenantID) TenantID

func (tID *TenantID) TenantID() string

type TenantIDWithAPIOpts

type TenantIDWithAPIOpts struct {
	*TenantID
	APIOpts map[string]any
}

type TenantWithAPIOpts

type TenantWithAPIOpts struct {
	Tenant  string
	APIOpts map[string]any
}

type TimeStringConverter

type TimeStringConverter struct {
	Layout string
}

func (*TimeStringConverter) Convert

func (tS *TimeStringConverter) Convert(in any) (
	out any, err error)

Convert implements DataConverter interface

type Trend

type Trend struct {
	Tenant            string
	ID                string
	RunTimes          []time.Time
	Metrics           map[time.Time]map[string]*MetricWithTrend
	CompressedMetrics []byte // if populated, Metrics and RunTimes will be emty
	// contains filtered or unexported fields
}

Trend represents a collection of metrics with trend analysis.

func NewTrendFromProfile

func NewTrendFromProfile(tP *TrendProfile) *Trend

NewTrendFromProfile creates an empty trend based on profile configuration.

func (*Trend) AsTrendSummary

func (t *Trend) AsTrendSummary() (ts *TrendSummary)

AsTrendSummary creates a summary with the most recent trend data.

func (*Trend) CacheClone

func (t *Trend) CacheClone() any

CacheClone returns a clone of Trend used by ltcache CacheCloner

func (*Trend) Clone

func (t *Trend) Clone() *Trend

func (*Trend) Compile

func (t *Trend) Compile(cleanTtl time.Duration, qLength int)

Compile initializes or cleans up the Trend. Safe for concurrent use.

func (*Trend) Compress

func (t *Trend) Compress(ms Marshaler, limit int) (tr *Trend, err error)

Compress creates a compressed version of the trend.

func (*Trend) Config

func (t *Trend) Config() *TrendProfile

Config returns the trend's profile configuration.

func (*Trend) GetTrendGrowth

func (t *Trend) GetTrendGrowth(mID string, mVal float64, correlation string, roundDec int) (tG float64, err error)

GetTrendGrowth calculates percentage growth for a metric compared to previous values.

func (*Trend) IndexesAppendMetric

func (t *Trend) IndexesAppendMetric(mWt *MetricWithTrend, rTime time.Time)

IndexesAppendMetric adds a single metric to internal indexes.

func (*Trend) Lock

func (t *Trend) Lock()

Lock locks the trend mutex.

func (*Trend) RLock

func (t *Trend) RLock()

RLock locks the trend mutex for reading.

func (*Trend) RUnlock

func (t *Trend) RUnlock()

RUnlock unlocks the read lock on the trend mutex.

func (*Trend) SetConfig

func (t *Trend) SetConfig(tp *TrendProfile)

SetConfig sets the trend's profile configuration.

func (*Trend) TenantID

func (t *Trend) TenantID() string

func (*Trend) Uncompress

func (t *Trend) Uncompress(ms Marshaler) (err error)

Uncompress expands a compressed trend.

func (*Trend) Unlock

func (t *Trend) Unlock()

Unlock unlocks the trend mutex.

type TrendProfile

type TrendProfile struct {
	Tenant          string
	ID              string
	Schedule        string // Cron expression scheduling gathering of the metrics
	StatID          string
	Metrics         []string
	TTL             time.Duration
	QueueLength     int
	MinItems        int     // minimum number of items for building Trends
	CorrelationType string  // *last, *average
	Tolerance       float64 // allow this deviation margin for *constant trend
	Stored          bool    // store the Trend in dataDB
	ThresholdIDs    []string
}

TrendProfile defines the configuration of the Trend.

func (*TrendProfile) CacheClone

func (tP *TrendProfile) CacheClone() any

CacheClone returns a clone of TrendProfile used by ltcache CacheCloner

func (*TrendProfile) Clone

func (tp *TrendProfile) Clone() (clnTp *TrendProfile)

Clone creates a deep copy of TrendProfile for thread-safe use.

func (*TrendProfile) FieldAsInterface

func (tp *TrendProfile) FieldAsInterface(fldPath []string) (_ any, err error)

FieldAsInterface implements the DataProvider interface, retrieving field value as interface.

func (*TrendProfile) FieldAsString

func (tp *TrendProfile) FieldAsString(fldPath []string) (_ string, err error)

FieldAsString implements the DataProvider interface, retrieving field value as string.

func (*TrendProfile) Merge

func (tp *TrendProfile) Merge(v2 any)

Merge implements the profile interface, merging values from another TrendProfile.

func (*TrendProfile) Set

func (tp *TrendProfile) Set(path []string, val any, _ bool) (err error)

Set implements the profile interface, setting values in TrendProfile based on path.

func (*TrendProfile) String

func (tp *TrendProfile) String() string

String implements the DataProvider interface, returning the TrendProfile in JSON format.

func (*TrendProfile) TenantID

func (tp *TrendProfile) TenantID() string

TenantID returns the concatenated tenant and ID.

type TrendProfileWithAPIOpts

type TrendProfileWithAPIOpts struct {
	*TrendProfile
	APIOpts map[string]any
}

TrendProfileWithAPIOpts wraps TrendProfile with APIOpts.

type TrendSummary

type TrendSummary struct {
	Tenant  string
	ID      string
	Time    time.Time
	Metrics map[string]*MetricWithTrend
}

TrendSummary holds the most recent trend metrics.

type TrendWithAPIOpts

type TrendWithAPIOpts struct {
	*Trend
	APIOpts map[string]any
}

TrendWithAPIOpts wraps Trend with APIOpts.

type UnitFactor

type UnitFactor struct {
	FilterIDs []string
	Factor    *Decimal
}

UnitFactor is a multiplicator for the usage received

func (*UnitFactor) Clone

func (uF *UnitFactor) Clone() *UnitFactor

Clone returns a copy of uF

func (*UnitFactor) Equals

func (uF *UnitFactor) Equals(nUf *UnitFactor) (eq bool)

Equals compares two UnitFactors

func (*UnitFactor) FieldAsInterface

func (uF *UnitFactor) FieldAsInterface(fldPath []string) (_ any, err error)

func (*UnitFactor) FieldAsString

func (uF *UnitFactor) FieldAsString(fldPath []string) (_ string, err error)

func (*UnitFactor) String

func (uF *UnitFactor) String() string

type UnixTimeConverter

type UnixTimeConverter struct{}

UnixTimeConverter converts the interface in the unix time

func (*UnixTimeConverter) Convert

func (tS *UnixTimeConverter) Convert(in any) (
	out any, err error)

Convert implements DataConverter interface

type WeekDays

type WeekDays []time.Weekday

Defines week days series

func (WeekDays) Len

func (wd WeekDays) Len() int

func (WeekDays) Less

func (wd WeekDays) Less(j, i int) bool

func (*WeekDays) Parse

func (wd *WeekDays) Parse(input, sep string)

func (WeekDays) Sort

func (wd WeekDays) Sort()

func (WeekDays) Swap

func (wd WeekDays) Swap(i, j int)

type XMLElement

type XMLElement struct {
	XMLName    xml.Name
	Value      string        `xml:",chardata"`
	Attributes []*xml.Attr   `xml:",attr"`
	Elements   []*XMLElement `xml:"omitempty"`
}

XMLElement is specially crafted to be automatically marshalled by encoding/xml

func NMAsXMLElements

func NMAsXMLElements(nm *OrderedNavigableMap) (ents []*XMLElement, err error)

NMAsXMLElements returns the values as []*XMLElement which can be later marshaled considers each value returned by .Values() in the form of []*NMItem, otherwise errors

type Years

type Years []int

Defines years days series

func (Years) Len

func (ys Years) Len() int

func (Years) Less

func (ys Years) Less(j, i int) bool

func (*Years) Parse

func (ys *Years) Parse(input, sep string)

Parse Years elements from string separated by sep.

func (Years) Sort

func (ys Years) Sort()

func (Years) Swap

func (ys Years) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL