utils

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: GPL-3.0 Imports: 41 Imported by: 93

Documentation

Overview

Most of the logic follows standard library implementation in this file

Most of the logic follows standard library implementation in this file

Index

Constants

View Source
const (
	CGRateS                      = "CGRateS"
	VERSION                      = "v0.10.3"
	DIAMETER_FIRMWARE_REVISION   = 918
	REDIS_MAX_CONNS              = 10
	CGRATES                      = "cgrates"
	POSTGRES                     = "postgres"
	MYSQL                        = "mysql"
	MONGO                        = "mongo"
	REDIS                        = "redis"
	INTERNAL                     = "internal"
	DataManager                  = "DataManager"
	LOCALHOST                    = "127.0.0.1"
	PREPAID                      = "prepaid"
	META_PREPAID                 = "*prepaid"
	POSTPAID                     = "postpaid"
	META_POSTPAID                = "*postpaid"
	PSEUDOPREPAID                = "pseudoprepaid"
	META_PSEUDOPREPAID           = "*pseudoprepaid"
	META_RATED                   = "*rated"
	META_NONE                    = "*none"
	META_NOW                     = "*now"
	ROUNDING_UP                  = "*up"
	ROUNDING_MIDDLE              = "*middle"
	ROUNDING_DOWN                = "*down"
	ANY                          = "*any"
	MetaAll                      = "*all"
	ZERO                         = "*zero"
	ASAP                         = "*asap"
	COMMENT_CHAR                 = '#'
	CSV_SEP                      = ','
	FALLBACK_SEP                 = ';'
	INFIELD_SEP                  = ";"
	MetaPipe                     = "*|"
	FIELDS_SEP                   = ","
	InInFieldSep                 = ":"
	STATIC_HDRVAL_SEP            = "::"
	REGEXP_PREFIX                = "~"
	FILTER_VAL_START             = "("
	FILTER_VAL_END               = ")"
	JSON                         = "json"
	MSGPACK                      = "msgpack"
	CSV_LOAD                     = "CSVLOAD"
	CGRID                        = "CGRID"
	ToR                          = "ToR"
	OrderID                      = "OrderID"
	OriginID                     = "OriginID"
	InitialOriginID              = "InitialOriginID"
	OriginIDPrefix               = "OriginIDPrefix"
	Source                       = "Source"
	OriginHost                   = "OriginHost"
	RequestType                  = "RequestType"
	Direction                    = "Direction"
	Tenant                       = "Tenant"
	Category                     = "Category"
	Context                      = "Context"
	Contexts                     = "Contexts"
	Account                      = "Account"
	Subject                      = "Subject"
	Destination                  = "Destination"
	SetupTime                    = "SetupTime"
	AnswerTime                   = "AnswerTime"
	Usage                        = "Usage"
	Value                        = "Value"
	LastUsed                     = "LastUsed"
	PDD                          = "PDD"
	SUPPLIER                     = "Supplier"
	RunID                        = "RunID"
	MetaReqRunID                 = "*req.RunID"
	COST                         = "Cost"
	CostDetails                  = "CostDetails"
	RATED                        = "rated"
	Partial                      = "Partial"
	PreRated                     = "PreRated"
	STATIC_VALUE_PREFIX          = "^"
	CSV                          = "csv"
	FWV                          = "fwv"
	MetaPartialCSV               = "*partial_csv"
	DRYRUN                       = "dry_run"
	META_COMBIMED                = "*combimed"
	MetaMongo                    = "*mongo"
	MetaRedis                    = "*redis"
	MetaPostgres                 = "*postgres"
	MetaInternal                 = "*internal"
	MetaLocalHost                = "*localhost"
	ZERO_RATING_SUBJECT_PREFIX   = "*zero"
	OK                           = "OK"
	MetaFileXML                  = "*file_xml"
	CDRE                         = "cdre"
	MASK_CHAR                    = "*"
	CONCATENATED_KEY_SEP         = ":"
	UNIT_TEST                    = "UNIT_TEST"
	HDR_VAL_SEP                  = "/"
	MONETARY                     = "*monetary"
	SMS                          = "*sms"
	MMS                          = "*mms"
	GENERIC                      = "*generic"
	DATA                         = "*data"
	VOICE                        = "*voice"
	MAX_COST_FREE                = "*free"
	MAX_COST_DISCONNECT          = "*disconnect"
	SECONDS                      = "seconds"
	META_OUT                     = "*out"
	META_ANY                     = "*any"
	ASR                          = "ASR"
	ACD                          = "ACD"
	TASKS_KEY                    = "tasks"
	ACTION_PLAN_PREFIX           = "apl_"
	AccountActionPlansPrefix     = "aap_"
	ACTION_TRIGGER_PREFIX        = "atr_"
	RATING_PLAN_PREFIX           = "rpl_"
	RATING_PROFILE_PREFIX        = "rpf_"
	ACTION_PREFIX                = "act_"
	SHARED_GROUP_PREFIX          = "shg_"
	ACCOUNT_PREFIX               = "acc_"
	DESTINATION_PREFIX           = "dst_"
	REVERSE_DESTINATION_PREFIX   = "rds_"
	DERIVEDCHARGERS_PREFIX       = "dcs_"
	USERS_PREFIX                 = "usr_"
	ResourcesPrefix              = "res_"
	ResourceProfilesPrefix       = "rsp_"
	ThresholdPrefix              = "thd_"
	TimingsPrefix                = "tmg_"
	FilterPrefix                 = "ftr_"
	CDR_STATS_PREFIX             = "cst_"
	VERSION_PREFIX               = "ver_"
	StatQueueProfilePrefix       = "sqp_"
	SupplierProfilePrefix        = "spp_"
	AttributeProfilePrefix       = "alp_"
	ChargerProfilePrefix         = "cpp_"
	DispatcherProfilePrefix      = "dpp_"
	DispatcherHostPrefix         = "dph_"
	ThresholdProfilePrefix       = "thp_"
	StatQueuePrefix              = "stq_"
	LoadIDPrefix                 = "lid_"
	LOADINST_KEY                 = "load_history"
	CREATE_CDRS_TABLES_SQL       = "create_cdrs_tables.sql"
	CREATE_TARIFFPLAN_TABLES_SQL = "create_tariffplan_tables.sql"
	TEST_SQL                     = "TEST_SQL"
	META_CONSTANT                = "*constant"
	META_FILLER                  = "*filler"
	META_HANDLER                 = "*handler"
	MetaHTTPPost                 = "*http_post"
	MetaHTTPjson                 = "*http_json"
	MetaHTTPjsonCDR              = "*http_json_cdr"
	MetaHTTPjsonMap              = "*http_json_map"
	MetaAMQPjsonCDR              = "*amqp_json_cdr"
	MetaAMQPjsonMap              = "*amqp_json_map"
	MetaAMQPV1jsonMap            = "*amqpv1_json_map"
	MetaSQSjsonMap               = "*sqs_json_map"
	MetaKafkajsonMap             = "*kafka_json_map"
	MetaSQL                      = "*sql"
	MetaMySQL                    = "*mysql"
	MetaS3jsonMap                = "*s3_json_map"
	CONFIG_PATH                  = "/etc/cgrates/"
	DISCONNECT_CAUSE             = "DisconnectCause"
	MetaFlatstore                = "*flatstore"
	MetaRating                   = "*rating"
	NOT_AVAILABLE                = "N/A"
	CALL                         = "call"
	EXTRA_FIELDS                 = "ExtraFields"
	META_SURETAX                 = "*sure_tax"
	MetaDynamic                  = "*dynamic"
	COUNTER_EVENT                = "*event"
	COUNTER_BALANCE              = "*balance"
	EVENT_NAME                   = "EventName"
	// action trigger threshold types
	TRIGGER_MIN_EVENT_COUNTER   = "*min_event_counter"
	TRIGGER_MAX_EVENT_COUNTER   = "*max_event_counter"
	TRIGGER_MAX_BALANCE_COUNTER = "*max_balance_counter"
	TRIGGER_MIN_BALANCE         = "*min_balance"
	TRIGGER_MAX_BALANCE         = "*max_balance"
	TRIGGER_BALANCE_EXPIRED     = "*balance_expired"
	HIERARCHY_SEP               = ">"
	META_COMPOSED               = "*composed"
	META_USAGE_DIFFERENCE       = "*usage_difference"
	MetaSIPCID                  = "*sipcid"
	MetaDifference              = "*difference"
	MetaVariable                = "*variable"
	MetaCCUsage                 = "*cc_usage"
	MetaValueExponent           = "*value_exponent"
	NegativePrefix              = "!"
	MatchStartPrefix            = "^"
	MatchGreaterThanOrEqual     = ">="
	MatchLessThanOrEqual        = "<="
	MatchGreaterThan            = ">"
	MatchLessThan               = "<"
	MatchEndPrefix              = "$"
	MetaRaw                     = "*raw"
	CreatedAt                   = "CreatedAt"
	UpdatedAt                   = "UpdatedAt"
	HandlerArgSep               = "|"
	NodeID                      = "NodeID"
	ActiveGoroutines            = "ActiveGoroutines"
	MemoryUsage                 = "MemoryUsage"
	RunningSince                = "RunningSince"
	GoVersion                   = "GoVersion"
	SessionTTL                  = "SessionTTL"
	SessionTTLMaxDelay          = "SessionTTLMaxDelay"
	SessionTTLLastUsed          = "SessionTTLLastUsed"
	SessionTTLUsage             = "SessionTTLUsage"
	SessionTTLLastUsage         = "SessionTTLLastUsage"
	XML                         = "xml"
	MetaGOB                     = "*gob"
	MetaJSON                    = "*json"
	MetaMSGPACK                 = "*msgpack"
	MetaDateTime                = "*datetime"
	MetaMaskedDestination       = "*masked_destination"
	MetaUnixTimestamp           = "*unix_timestamp"
	MetaPostCDR                 = "*post_cdr"
	MetaDumpToFile              = "*dump_to_file"
	NonTransactional            = ""
	DataDB                      = "data_db"
	StorDB                      = "stor_db"
	NotFoundCaps                = "NOT_FOUND"
	ServerErrorCaps             = "SERVER_ERROR"
	MandatoryIEMissingCaps      = "MANDATORY_IE_MISSING"
	UnsupportedCachePrefix      = "unsupported cache prefix"
	CDRSCtx                     = "cdrs"
	MandatoryInfoMissing        = "mandatory information missing"
	UnsupportedServiceIDCaps    = "UNSUPPORTED_SERVICE_ID"
	ServiceManager              = "service_manager"
	ServiceAlreadyRunning       = "service already running"
	RunningCaps                 = "RUNNING"
	StoppedCaps                 = "STOPPED"
	SchedulerNotRunningCaps     = "SCHEDULLER_NOT_RUNNING"
	MetaScheduler               = "*scheduler"
	MetaSessionsCosts           = "*sessions_costs"
	MetaRALs                    = "*rals"
	MetaRerate                  = "*rerate"
	MetaRefund                  = "*refund"
	MetaStats                   = "*stats"
	MetaResponder               = "*responder"
	MetaCore                    = "*core"
	MetaServiceManager          = "*servicemanager"
	MetaChargers                = "*chargers"
	MetaConfig                  = "*config"
	MetaDispatchers             = "*dispatchers"
	MetaDispatcherHosts         = "*dispatcher_hosts"
	MetaFilters                 = "*filters"
	MetaCDRs                    = "*cdrs"
	MetaCaches                  = "*caches"
	MetaGuardian                = "*guardians"
	MetaContinue                = "*continue"
	Migrator                    = "migrator"
	UnsupportedMigrationTask    = "unsupported migration task"
	NoStorDBConnection          = "not connected to StorDB"
	UndefinedVersion            = "undefined version"
	TxtSuffix                   = ".txt"
	JSNSuffix                   = ".json"
	GOBSuffix                   = ".gob"
	FormSuffix                  = ".form"
	XMLSuffix                   = ".xml"
	CSVSuffix                   = ".csv"
	FWVSuffix                   = ".fwv"
	CONTENT_JSON                = "json"
	CONTENT_FORM                = "form"
	CONTENT_TEXT                = "text"
	FileLockPrefix              = "file_"
	ActionsPoster               = "act"
	CDRPoster                   = "cdr"
	MetaFileCSV                 = "*file_csv"
	MetaFileFWV                 = "*file_fwv"
	MetaFScsv                   = "*freeswitch_csv"
	Accounts                    = "Accounts"
	AccountService              = "AccountS"
	Actions                     = "Actions"
	ActionPlans                 = "ActionPlans"
	ActionTriggers              = "ActionTriggers"
	SharedGroups                = "SharedGroups"
	TimingIDs                   = "TimingIDs"
	Timings                     = "Timings"
	Rates                       = "Rates"
	DestinationRates            = "DestinationRates"
	RatingPlans                 = "RatingPlans"
	RatingProfiles              = "RatingProfiles"
	AccountActions              = "AccountActions"
	Resources                   = "Resources"
	Stats                       = "Stats"
	Filters                     = "Filters"
	DispatcherProfiles          = "DispatcherProfiles"
	DispatcherHosts             = "DispatcherHosts"
	MetaEveryMinute             = "*every_minute"
	MetaHourly                  = "*hourly"
	ID                          = "ID"
	Thresholds                  = "Thresholds"
	Suppliers                   = "Suppliers"
	Attributes                  = "Attributes"
	Chargers                    = "Chargers"
	Dispatchers                 = "Dispatchers"
	StatS                       = "Stats"
	LoadIDsVrs                  = "LoadIDs"
	RALService                  = "RALs"
	CostSource                  = "CostSource"
	ExtraInfo                   = "ExtraInfo"
	Meta                        = "*"
	MetaSysLog                  = "*syslog"
	MetaStdLog                  = "*stdout"
	EventType                   = "EventType"
	EventSource                 = "EventSource"
	AccountID                   = "AccountID"
	ResourceID                  = "ResourceID"
	TotalUsage                  = "TotalUsage"
	StatID                      = "StatID"
	BalanceType                 = "BalanceType"
	BalanceID                   = "BalanceID"
	BalanceDestinationIds       = "BalanceDestinationIds"
	BalanceWeight               = "BalanceWeight"
	BalanceExpirationDate       = "BalanceExpirationDate"
	BalanceTimingTags           = "BalanceTimingTags"
	BalanceRatingSubject        = "BalanceRatingSubject"
	BalanceCategories           = "BalanceCategories"
	BalanceSharedGroups         = "BalanceSharedGroups"
	BalanceBlocker              = "BalanceBlocker"
	BalanceDisabled             = "BalanceDisabled"
	Units                       = "Units"
	AccountUpdate               = "AccountUpdate"
	BalanceUpdate               = "BalanceUpdate"
	StatUpdate                  = "StatUpdate"
	ResourceUpdate              = "ResourceUpdate"
	CDR                         = "CDR"
	CDRs                        = "CDRs"
	ExpiryTime                  = "ExpiryTime"
	AllowNegative               = "AllowNegative"
	Disabled                    = "Disabled"
	Action                      = "Action"
	MetaNow                     = "*now"
	SessionSCosts               = "SessionSCosts"
	Timing                      = "Timing"
	RQF                         = "RQF"
	Resource                    = "Resource"
	User                        = "User"
	Subscribers                 = "Subscribers"
	DerivedChargersV            = "DerivedChargers"
	Destinations                = "Destinations"
	ReverseDestinations         = "ReverseDestinations"
	RatingPlan                  = "RatingPlan"
	RatingProfile               = "RatingProfile"
	MetaRatingPlans             = "*rating_plans"
	MetaRatingProfiles          = "*rating_profiles"
	MetaUsers                   = "*users"
	MetaSubscribers             = "*subscribers"
	MetaDerivedChargersV        = "*derivedchargers"
	MetaStorDB                  = "*stordb"
	MetaDataDB                  = "*datadb"
	MetaWeight                  = "*weight"
	MetaLC                      = "*lc"
	MetaHC                      = "*hc"
	MetaQOS                     = "*qos"
	MetaReas                    = "*reas"
	MetaReds                    = "*reds"
	Weight                      = "Weight"
	Cost                        = "Cost"
	DestinationIDs              = "DestinationIDs"
	RatingSubject               = "RatingSubject"
	Categories                  = "Categories"
	Blocker                     = "Blocker"
	RatingPlanID                = "RatingPlanID"
	StartTime                   = "StartTime"
	AccountSummary              = "AccountSummary"
	RatingFilters               = "RatingFilters"
	RatingFilter                = "RatingFilter"
	Accounting                  = "Accounting"
	Rating                      = "Rating"
	Charges                     = "Charges"
	CompressFactor              = "CompressFactor"
	Increments                  = "Increments"
	Balance                     = "Balance"
	BalanceSummaries            = "BalanceSummaries"
	Type                        = "Type"
	YearsFieldName              = "Years"
	MonthsFieldName             = "Months"
	MonthDaysFieldName          = "MonthDays"
	WeekDaysFieldName           = "WeekDays"
	GroupIntervalStart          = "GroupIntervalStart"
	RateIncrement               = "RateIncrement"
	RateUnit                    = "RateUnit"
	BalanceUUID                 = "BalanceUUID"
	RatingID                    = "RatingID"
	ExtraChargeID               = "ExtraChargeID"
	ConnectFee                  = "ConnectFee"
	RoundingMethod              = "RoundingMethod"
	RoundingDecimals            = "RoundingDecimals"
	MaxCostStrategy             = "MaxCostStrategy"
	TimingID                    = "TimingID"
	RatesID                     = "RatesID"
	RatingFiltersID             = "RatingFiltersID"
	AccountingID                = "AccountingID"
	MetaSessionS                = "*sessions"
	MetaDefault                 = "*default"
	Error                       = "Error"
	MetaCgreq                   = "*cgreq"
	MetaCgrep                   = "*cgrep"
	MetaCGRAReq                 = "*cgrareq"
	CGR_ACD                     = "cgr_acd"
	FilterIDs                   = "FilterIDs"
	FieldName                   = "FieldName"
	Path                        = "Path"
	MetaRound                   = "*round"
	Pong                        = "Pong"
	MetaEventCost               = "*event_cost"
	MetaSuppliersMaxCost        = "*suppliers_maxcost"
	MetaMaxCost                 = "*maxcost"
	MetaSuppliersEventCost      = "*suppliers_event_cost"
	MetaSuppliersIgnoreErrors   = "*suppliers_ignore_errors"
	Freeswitch                  = "freeswitch"
	Kamailio                    = "kamailio"
	Opensips                    = "opensips"
	Asterisk                    = "asterisk"
	SchedulerS                  = "SchedulerS"
	MetaMultiply                = "*multiply"
	MetaDivide                  = "*divide"
	MetaUrl                     = "*url"
	MetaXml                     = "*xml"
	ApiKey                      = "apikey"
	MetaReq                     = "*req"
	MetaVars                    = "*vars"
	MetaRep                     = "*rep"
	MetaExp                     = "*exp"
	MetaHdr                     = "*hdr"
	MetaTrl                     = "*trl"
	MetaTmp                     = "*tmp"
	MetaCmedReq                 = "*cmedreq" // used with combinedMediation
	CGROriginHost               = "cgr_originhost"
	MetaInitiate                = "*initiate"
	MetaFD                      = "*fd"
	MetaUpdate                  = "*update"
	MetaTerminate               = "*terminate"
	MetaEvent                   = "*event"
	MetaMessage                 = "*message"
	MetaDryRun                  = "*dryrun"
	Event                       = "Event"
	EmptyString                 = ""
	DynamicDataPrefix           = "~"
	AttrValueSep                = "="
	ANDSep                      = "&"
	PipeSep                     = "|"
	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                      = "]"
	MetaLog                     = "*log"
	MetaRemoteHost              = "*remote_host"
	RemoteHost                  = "RemoteHost"
	Local                       = "local"
	TCP                         = "tcp"
	CGRDebitInterval            = "CGRDebitInterval"
	Version                     = "Version"
	MetaTenant                  = "*tenant"
	ResourceUsage               = "ResourceUsage"
	MetaDuration                = "*duration"
	MetaLibPhoneNumber          = "*libphonenumber"
	MetaIP2Hex                  = "*ip2hex"
	MetaString2Hex              = "*string2hex"
	MetaReload                  = "*reload"
	MetaLoad                    = "*load"
	MetaRemove                  = "*remove"
	MetaRemoveAll               = "*removeall"
	MetaStore                   = "*store"
	MetaClear                   = "*clear"
	MetaExport                  = "*export"
	LoadIDs                     = "load_ids"
	DNSAgent                    = "DNSAgent"
	TLSNoCaps                   = "tls"
	MetaRouteID                 = "*route_id"
	MetaApiKey                  = "*api_key"
	UsageID                     = "UsageID"
	Rcode                       = "Rcode"
	Replacement                 = "Replacement"
	Regexp                      = "Regexp"
	Order                       = "Order"
	Preference                  = "Preference"
	Flags                       = "Flags"
	Service                     = "Service"
	MetaSuppliersLimit          = "*suppliers_limit"
	MetaSuppliersOffset         = "*suppliers_offset"
	ApierV                      = "ApierV"
	MetaApier                   = "*apier"
	MetaAnalyzer                = "*analyzer"
	CGREventString              = "CGREvent"
	MetaTextPlain               = "*text_plain"
	MetaIgnoreErrors            = "*ignore_errors"
	MetaRelease                 = "*release"
	MetaAllocate                = "*allocate"
	MetaAuthorize               = "*authorize"
	MetaInit                    = "*init"
	MetaRatingPlanCost          = "*rating_plan_cost"
	RatingPlanIDs               = "RatingPlanIDs"
	ERs                         = "ERs"
	Ratio                       = "Ratio"
	Load                        = "Load"
	Slash                       = "/"
	UUID                        = "UUID"
	ActionsID                   = "ActionsID"
	MetaAct                     = "*act"
	DestinationPrefix           = "DestinationPrefix"
	DestinationID               = "DestinationID"
	ExportTemplate              = "ExportTemplate"
	ExportFormat                = "ExportFormat"
	Synchronous                 = "Synchronous"
	Attempts                    = "Attempts"
	FieldSeparator              = "FieldSeparator"
	ExportPath                  = "ExportPath"
	ExportID                    = "ExportID"
	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"
	MetaGroup                   = "*group"
	InternalRPCSet              = "InternalRPCSet"
	MetaFileName                = "*fileName"
	MetaBusy                    = "*busy"
	MetaQueue                   = "*queue"
	MetaRounding                = "*rounding"
)
View Source
const (
	Move    = "move"
	Migrate = "migrate"
)

Migrator Action

View Source
const (
	MetaAccounts            = "*accounts"
	MetaAccountActionPlans  = "*account_action_plans"
	MetaReverseDestinations = "*reverse_destinations"
	MetaActionPlans         = "*action_plans"
	MetaActionTriggers      = "*action_triggers"
	MetaActions             = "*actions"
	MetaResourceProfile     = "*resource_profiles"
	MetaStatQueueProfiles   = "*statqueue_profiles"
	MetaStatQueues          = "*statqueues"
	MetaThresholdProfiles   = "*threshold_profiles"
	MetaSupplierProfiles    = "*supplier_profiles"
	MetaAttributeProfiles   = "*attribute_profiles"
	MetaFilterIndexes       = "*filter_indexes"
	MetaDispatcherProfiles  = "*dispatcher_profiles"
	MetaChargerProfiles     = "*charger_profiles"
	MetaSharedGroups        = "*shared_groups"
	MetaThresholds          = "*thresholds"
	MetaSuppliers           = "*suppliers"
	MetaAttributes          = "*attributes"
	MetaLoadIDs             = "*load_ids"
)

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"
)

MetaMetrics

View Source
const (
	SessionS    = "SessionS"
	AttributeS  = "AttributeS"
	SupplierS   = "SupplierS"
	ResourceS   = "ResourceS"
	StatService = "StatS"
	FilterS     = "FilterS"
	ThresholdS  = "ThresholdS"
	DispatcherS = "DispatcherS"
	LoaderS     = "LoaderS"
	ChargerS    = "ChargerS"
	CacheS      = "CacheS"
	AnalyzerS   = "AnalyzerS"
	CDRServer   = "CDRServer"
	ResponderS  = "ResponderS"
	GuardianS   = "GuardianS"
	ApierS      = "ApierS"
)

Services

View Source
const (
	SessionsLow    = "sessions"
	AttributesLow  = "attributes"
	ChargerSLow    = "chargers"
	SuppliersLow   = "suppliers"
	ResourcesLow   = "resources"
	StatServiceLow = "stats"
	ThresholdsLow  = "thresholds"
	DispatcherSLow = "dispatchers"
	AnalyzerSLow   = "analyzers"
	SchedulerSLow  = "schedulers"
	LoaderSLow     = "loaders"
	RALsLow        = "rals"
	ReplicatorLow  = "replicator"
	ApierSLow      = "apiers"
)

Lower service names

View Source
const (
	LOG                       = "*log"
	RESET_TRIGGERS            = "*reset_triggers"
	SET_RECURRENT             = "*set_recurrent"
	UNSET_RECURRENT           = "*unset_recurrent"
	ALLOW_NEGATIVE            = "*allow_negative"
	DENY_NEGATIVE             = "*deny_negative"
	RESET_ACCOUNT             = "*reset_account"
	REMOVE_ACCOUNT            = "*remove_account"
	SET_BALANCE               = "*set_balance"
	REMOVE_BALANCE            = "*remove_balance"
	TOPUP_RESET               = "*topup_reset"
	TOPUP                     = "*topup"
	DEBIT_RESET               = "*debit_reset"
	DEBIT                     = "*debit"
	RESET_COUNTERS            = "*reset_counters"
	ENABLE_ACCOUNT            = "*enable_account"
	DISABLE_ACCOUNT           = "*disable_account"
	HttpPost                  = "*http_post"
	HttpPostAsync             = "*http_post_async"
	MAIL_ASYNC                = "*mail_async"
	UNLIMITED                 = "*unlimited"
	CDRLOG                    = "*cdrlog"
	SET_DDESTINATIONS         = "*set_ddestinations"
	TRANSFER_MONETARY_DEFAULT = "*transfer_monetary_default"
	CGR_RPC                   = "*cgr_rpc"
	TopUpZeroNegative         = "*topup_zero_negative"
	SetExpiry                 = "*set_expiry"
	MetaPublishAccount        = "*publish_account"
	MetaPublishBalance        = "*publish_balance"
	MetaRemoveSessionCosts    = "*remove_session_costs"
	MetaRemoveExpired         = "*remove_expired"
	MetaPostEvent             = "*post_event"
	MetaCDRAccount            = "*cdr_account"
)

Actions

View Source
const (
	MetaSetVersions         = "*set_versions"
	MetaEnsureIndexes       = "*ensure_indexes"
	MetaTpRatingPlans       = "*tp_rating_plans"
	MetaTpFilters           = "*tp_filters"
	MetaTpDestinationRates  = "*tp_destination_rates"
	MetaTpActionTriggers    = "*tp_action_triggers"
	MetaTpAccountActions    = "*tp_account_actions"
	MetaTpActionPlans       = "*tp_action_plans"
	MetaTpActions           = "*tp_actions"
	MetaTpThresholds        = "*tp_thresholds"
	MetaTpSuppliers         = "*tp_suppliers"
	MetaTpStats             = "*tp_stats"
	MetaTpSharedGroups      = "*tp_shared_groups"
	MetaTpRatingProfiles    = "*tp_rating_profiles"
	MetaTpResources         = "*tp_resources"
	MetaTpRates             = "*tp_rates"
	MetaTpTimings           = "*tp_timings"
	MetaTpDestinations      = "*tp_destinations"
	MetaTpChargers          = "*tp_chargers"
	MetaTpDispatchers       = "*tp_dispatchers"
	MetaDurationSeconds     = "*duration_seconds"
	MetaDurationNanoseconds = "*duration_nanoseconds"
	CapAttributes           = "Attributes"
	CapResourceAllocation   = "ResourceAllocation"
	CapMaxUsage             = "MaxUsage"
	CapSuppliers            = "Suppliers"
	CapThresholds           = "Thresholds"
	CapStatQueues           = "StatQueues"
)

Migrator Metas

View Source
const (
	TpRatingPlans      = "TpRatingPlans"
	TpFilters          = "TpFilters"
	TpDestinationRates = "TpDestinationRates"
	TpActionTriggers   = "TpActionTriggers"
	TpAccountActionsV  = "TpAccountActions"
	TpActionPlans      = "TpActionPlans"
	TpActions          = "TpActions"
	TpThresholds       = "TpThresholds"
	TpSuppliers        = "TpSuppliers"
	TpStats            = "TpStats"
	TpSharedGroups     = "TpSharedGroups"
	TpRatingProfiles   = "TpRatingProfiles"
	TpResources        = "TpResources"
	TpRates            = "TpRates"
	TpTiming           = "TpTiming"
	TpResource         = "TpResource"
	TpDestinations     = "TpDestinations"
	TpRatingPlan       = "TpRatingPlan"
	TpRatingProfile    = "TpRatingProfile"
	TpChargers         = "TpChargers"
	TpDispatchers      = "TpDispatchers"
)
View Source
const (
	MetaFirst          = "*first"
	MetaRandom         = "*random"
	MetaBroadcast      = "*broadcast"
	MetaRoundRobin     = "*round_robin"
	MetaRatio          = "*ratio"
	ThresholdSv1       = "ThresholdSv1"
	StatSv1            = "StatSv1"
	ResourceSv1        = "ResourceSv1"
	SupplierSv1        = "SupplierSv1"
	AttributeSv1       = "AttributeSv1"
	SessionSv1         = "SessionSv1"
	ChargerSv1         = "ChargerSv1"
	MetaAuth           = "*auth"
	APIKey             = "APIKey"
	RouteID            = "RouteID"
	APIMethods         = "APIMethods"
	NestingSep         = "."
	ArgDispatcherField = "ArgDispatcher"
)

Dispatcher Const

View Source
const (
	MetaNot            = "*not"
	MetaString         = "*string"
	MetaPrefix         = "*prefix"
	MetaSuffix         = "*suffix"
	MetaEmpty          = "*empty"
	MetaExists         = "*exists"
	MetaTimings        = "*timings"
	MetaRSR            = "*rsr"
	MetaStatS          = "*stats"
	MetaDestinations   = "*destinations"
	MetaLessThan       = "*lt"
	MetaLessOrEqual    = "*lte"
	MetaGreaterThan    = "*gt"
	MetaGreaterOrEqual = "*gte"
	MetaResources      = "*resources"
	MetaEqual          = "*eq"

	MetaNotString       = "*notstring"
	MetaNotPrefix       = "*notprefix"
	MetaNotSuffix       = "*notsuffix"
	MetaNotEmpty        = "*notempty"
	MetaNotExists       = "*notexists"
	MetaNotTimings      = "*nottimings"
	MetaNotRSR          = "*notrsr"
	MetaNotStatS        = "*notstats"
	MetaNotDestinations = "*notdestinations"
	MetaNotResources    = "*notresources"
	MetaNotEqual        = "*noteq"

	MetaEC = "*ec"
)

Filter types

View Source
const (
	ReplicatorSv1                        = "ReplicatorSv1"
	ReplicatorSv1Ping                    = "ReplicatorSv1.Ping"
	ReplicatorSv1GetAccount              = "ReplicatorSv1.GetAccount"
	ReplicatorSv1GetDestination          = "ReplicatorSv1.GetDestination"
	ReplicatorSv1GetReverseDestination   = "ReplicatorSv1.GetReverseDestination"
	ReplicatorSv1GetStatQueue            = "ReplicatorSv1.GetStatQueue"
	ReplicatorSv1GetFilter               = "ReplicatorSv1.GetFilter"
	ReplicatorSv1GetThreshold            = "ReplicatorSv1.GetThreshold"
	ReplicatorSv1GetThresholdProfile     = "ReplicatorSv1.GetThresholdProfile"
	ReplicatorSv1GetStatQueueProfile     = "ReplicatorSv1.GetStatQueueProfile"
	ReplicatorSv1GetTiming               = "ReplicatorSv1.GetTiming"
	ReplicatorSv1GetResource             = "ReplicatorSv1.GetResource"
	ReplicatorSv1GetResourceProfile      = "ReplicatorSv1.GetResourceProfile"
	ReplicatorSv1GetActionTriggers       = "ReplicatorSv1.GetActionTriggers"
	ReplicatorSv1GetShareGroup           = "ReplicatorSv1.GetShareGroup"
	ReplicatorSv1GetActions              = "ReplicatorSv1.GetActions"
	ReplicatorSv1GetActionPlan           = "ReplicatorSv1.GetActionPlan"
	ReplicatorSv1GetAllActionPlans       = "ReplicatorSv1.GetAllActionPlans"
	ReplicatorSv1GetAccountActionPlans   = "ReplicatorSv1.GetAccountActionPlans"
	ReplicatorSv1GetRatingPlan           = "ReplicatorSv1.GetRatingPlan"
	ReplicatorSv1GetRatingProfile        = "ReplicatorSv1.GetRatingProfile"
	ReplicatorSv1GetSupplierProfile      = "ReplicatorSv1.GetSupplierProfile"
	ReplicatorSv1GetAttributeProfile     = "ReplicatorSv1.GetAttributeProfile"
	ReplicatorSv1GetChargerProfile       = "ReplicatorSv1.GetChargerProfile"
	ReplicatorSv1GetDispatcherProfile    = "ReplicatorSv1.GetDispatcherProfile"
	ReplicatorSv1GetDispatcherHost       = "ReplicatorSv1.GetDispatcheHost"
	ReplicatorSv1GetItemLoadIDs          = "ReplicatorSv1.GetItemLoadIDs"
	ReplicatorSv1GetFilterIndexes        = "ReplicatorSv1.GetFilterIndexes"
	ReplicatorSv1MatchFilterIndex        = "ReplicatorSv1.MatchFilterIndex"
	ReplicatorSv1SetThresholdProfile     = "ReplicatorSv1.SetThresholdProfile"
	ReplicatorSv1SetThreshold            = "ReplicatorSv1.SetThreshold"
	ReplicatorSv1SetFilterIndexes        = "ReplicatorSv1.SetFilterIndexes"
	ReplicatorSv1Account                 = "ReplicatorSv1.SetAccount"
	ReplicatorSv1SetDestination          = "ReplicatorSv1.SetDestination"
	ReplicatorSv1SetReverseDestination   = "ReplicatorSv1.SetReverseDestination"
	ReplicatorSv1SetStatQueue            = "ReplicatorSv1.SetStatQueue"
	ReplicatorSv1SetFilter               = "ReplicatorSv1.SetFilter"
	ReplicatorSv1SetStatQueueProfile     = "ReplicatorSv1.SetStatQueueProfile"
	ReplicatorSv1SetTiming               = "ReplicatorSv1.SetTiming"
	ReplicatorSv1SetResource             = "ReplicatorSv1.SetResource"
	ReplicatorSv1SetResourceProfile      = "ReplicatorSv1.SetResourceProfile"
	ReplicatorSv1SetActionTriggers       = "ReplicatorSv1.SetActionTriggers"
	ReplicatorSv1SetSharedGroup          = "ReplicatorSv1.SetSharedGroup"
	ReplicatorSv1SetActions              = "ReplicatorSv1.SetActions"
	ReplicatorSv1SetActionPlan           = "ReplicatorSv1.SetActionPlan"
	ReplicatorSv1SetAccountActionPlans   = "ReplicatorSv1.SetAccountActionPlans"
	ReplicatorSv1SetRatingPlan           = "ReplicatorSv1.SetRatingPlan"
	ReplicatorSv1SetRatingProfile        = "ReplicatorSv1.SetRatingProfile"
	ReplicatorSv1SetSupplierProfile      = "ReplicatorSv1.SetSupplierProfile"
	ReplicatorSv1SetAttributeProfile     = "ReplicatorSv1.SetAttributeProfile"
	ReplicatorSv1SetChargerProfile       = "ReplicatorSv1.SetChargerProfile"
	ReplicatorSv1SetDispatcherProfile    = "ReplicatorSv1.SetDispatcherProfile"
	ReplicatorSv1SetDispatcherHost       = "ReplicatorSv1.SetDispatcherHost"
	ReplicatorSv1SetLoadIDs              = "ReplicatorSv1.SetLoadIDs"
	ReplicatorSv1RemoveThreshold         = "ReplicatorSv1.RemoveThreshold"
	ReplicatorSv1RemoveDestination       = "ReplicatorSv1.RemoveDestination"
	ReplicatorSv1RemoveAccount           = "ReplicatorSv1.RemoveAccount"
	ReplicatorSv1RemoveStatQueue         = "ReplicatorSv1.RemoveStatQueue"
	ReplicatorSv1RemoveFilter            = "ReplicatorSv1.RemoveFilter"
	ReplicatorSv1RemoveThresholdProfile  = "ReplicatorSv1.RemoveThresholdProfile"
	ReplicatorSv1RemoveStatQueueProfile  = "ReplicatorSv1.RemoveStatQueueProfile"
	ReplicatorSv1RemoveTiming            = "ReplicatorSv1.RemoveTiming"
	ReplicatorSv1RemoveResource          = "ReplicatorSv1.RemoveResource"
	ReplicatorSv1RemoveResourceProfile   = "ReplicatorSv1.RemoveResourceProfile"
	ReplicatorSv1RemoveActionTriggers    = "ReplicatorSv1.RemoveActionTriggers"
	ReplicatorSv1RemoveSharedGroup       = "ReplicatorSv1.RemoveSharedGroup"
	ReplicatorSv1RemoveActions           = "ReplicatorSv1.RemoveActions"
	ReplicatorSv1RemoveActionPlan        = "ReplicatorSv1.RemoveActionPlan"
	ReplicatorSv1RemAccountActionPlans   = "ReplicatorSv1.RemAccountActionPlans"
	ReplicatorSv1RemoveRatingPlan        = "ReplicatorSv1.RemoveRatingPlan"
	ReplicatorSv1RemoveRatingProfile     = "ReplicatorSv1.RemoveRatingProfile"
	ReplicatorSv1RemoveSupplierProfile   = "ReplicatorSv1.RemoveSupplierProfile"
	ReplicatorSv1RemoveAttributeProfile  = "ReplicatorSv1.RemoveAttributeProfile"
	ReplicatorSv1RemoveChargerProfile    = "ReplicatorSv1.RemoveChargerProfile"
	ReplicatorSv1RemoveDispatcherProfile = "ReplicatorSv1.RemoveDispatcherProfile"
	ReplicatorSv1RemoveDispatcherHost    = "ReplicatorSv1.RemoveDispatcherHost"
)

ReplicatorSv1 APIs

View Source
const (
	ApierV1                                   = "ApierV1"
	ApierV2                                   = "ApierV2"
	APIerSv1                                  = "APIerSv1"
	APIerSv1ComputeFilterIndexes              = "APIerSv1.ComputeFilterIndexes"
	APIerSv1ComputeFilterIndexIDs             = "APIerSv1.ComputeFilterIndexIDs"
	APIerSv1Ping                              = "APIerSv1.Ping"
	APIerSv1SetDispatcherProfile              = "APIerSv1.SetDispatcherProfile"
	APIerSv1GetDispatcherProfile              = "APIerSv1.GetDispatcherProfile"
	APIerSv1GetDispatcherProfileIDs           = "APIerSv1.GetDispatcherProfileIDs"
	APIerSv1RemoveDispatcherProfile           = "APIerSv1.RemoveDispatcherProfile"
	APIerSv1SetDispatcherHost                 = "APIerSv1.SetDispatcherHost"
	APIerSv1GetDispatcherHost                 = "APIerSv1.GetDispatcherHost"
	APIerSv1GetDispatcherHostIDs              = "APIerSv1.GetDispatcherHostIDs"
	APIerSv1RemoveDispatcherHost              = "APIerSv1.RemoveDispatcherHost"
	APIerSv1GetEventCost                      = "APIerSv1.GetEventCost"
	APIerSv1LoadTariffPlanFromFolder          = "APIerSv1.LoadTariffPlanFromFolder"
	APIerSv1GetCost                           = "APIerSv1.GetCost"
	APIerSv1SetBalance                        = "APIerSv1.SetBalance"
	APIerSv1GetFilter                         = "APIerSv1.GetFilter"
	APIerSv1GetFilterIndexes                  = "APIerSv1.GetFilterIndexes"
	APIerSv1RemoveFilterIndexes               = "APIerSv1.RemoveFilterIndexes"
	APIerSv1RemoveFilter                      = "APIerSv1.RemoveFilter"
	APIerSv1SetFilter                         = "APIerSv1.SetFilter"
	APIerSv1GetFilterIDs                      = "APIerSv1.GetFilterIDs"
	APIerSv1GetAccountActionPlansIndexHealth  = "APIerSv1.GetAccountActionPlansIndexHealth"
	APIerSv1GetReverseDestinationsIndexHealth = "APIerSv1.GetReverseDestinationsIndexHealth"
	APIerSv1GetThresholdsIndexesHealth        = "APIerSv1.GetThresholdsIndexesHealth"
	APIerSv1GetResourcesIndexesHealth         = "APIerSv1.GetResourcesIndexesHealth"
	APIerSv1GetStatsIndexesHealth             = "APIerSv1.GetStatsIndexesHealth"
	APIerSv1GetSuppliersIndexesHealth         = "APIerSv1.GetSuppliersIndexesHealth"
	APIerSv1GetChargersIndexesHealth          = "APIerSv1.GetChargersIndexesHealth"
	APIerSv1GetAttributesIndexesHealth        = "APIerSv1.GetAttributesIndexesHealth"
	APIerSv1GetDispatchersIndexesHealth       = "APIerSv1.GetDispatchersIndexesHealth"
	APIerSv1GetRatingProfile                  = "APIerSv1.GetRatingProfile"
	APIerSv1RemoveRatingProfile               = "APIerSv1.RemoveRatingProfile"
	APIerSv1SetRatingProfile                  = "APIerSv1.SetRatingProfile"
	APIerSv1GetRatingProfileIDs               = "APIerSv1.GetRatingProfileIDs"
	APIerSv1SetDataDBVersions                 = "APIerSv1.SetDataDBVersions"
	APIerSv1SetStorDBVersions                 = "APIerSv1.SetStorDBVersions"
	APIerSv1GetAccountActionPlan              = "APIerSv1.GetAccountActionPlan"
	APIerSv1ComputeActionPlanIndexes          = "APIerSv1.ComputeActionPlanIndexes"
	APIerSv1GetActions                        = "APIerSv1.GetActions"
	APIerSv1GetActionPlan                     = "APIerSv1.GetActionPlan"
	APIerSv1GetActionPlanIDs                  = "APIerSv1.GetActionPlanIDs"
	APIerSv1GetRatingPlanIDs                  = "APIerSv1.GetRatingPlanIDs"
	APIerSv1GetRatingPlan                     = "APIerSv1.GetRatingPlan"
	APIerSv1RemoveRatingPlan                  = "APIerSv1.RemoveRatingPlan"
	APIerSv1GetDestination                    = "APIerSv1.GetDestination"
	APIerSv1GetReverseDestination             = "APIerSv1.GetReverseDestination"
	APIerSv1AddBalance                        = "APIerSv1.AddBalance"
	APIerSv1DebitBalance                      = "APIerSv1.DebitBalance"
	APIerSv1SetAccount                        = "APIerSv1.SetAccount"
	APIerSv1GetAccountsCount                  = "APIerSv1.GetAccountsCount"
	APIerSv1GetDataDBVersions                 = "APIerSv1.GetDataDBVersions"
	APIerSv1GetStorDBVersions                 = "APIerSv1.GetStorDBVersions"
	APIerSv1GetCDRs                           = "APIerSv1.GetCDRs"
	APIerSv1GetTPAccountActions               = "APIerSv1.GetTPAccountActions"
	APIerSv1SetTPAccountActions               = "APIerSv1.SetTPAccountActions"
	APIerSv1GetTPAccountActionsByLoadId       = "APIerSv1.GetTPAccountActionsByLoadId"
	APIerSv1GetTPAccountActionLoadIds         = "APIerSv1.GetTPAccountActionLoadIds"
	APIerSv1GetTPAccountActionIds             = "APIerSv1.GetTPAccountActionIds"
	APIerSv1RemoveTPAccountActions            = "APIerSv1.RemoveTPAccountActions"
	APIerSv1GetTPActionPlan                   = "APIerSv1.GetTPActionPlan"
	APIerSv1SetTPActionPlan                   = "APIerSv1.SetTPActionPlan"
	APIerSv1GetTPActionPlanIds                = "APIerSv1.GetTPActionPlanIds"
	APIerSv1SetTPActionTriggers               = "APIerSv1.SetTPActionTriggers"
	APIerSv1GetTPActionTriggers               = "APIerSv1.GetTPActionTriggers"
	APIerSv1RemoveTPActionTriggers            = "APIerSv1.RemoveTPActionTriggers"
	APIerSv1GetTPActionTriggerIds             = "APIerSv1.GetTPActionTriggerIds"
	APIerSv1GetTPActions                      = "APIerSv1.GetTPActions"
	APIerSv1RemoveTPActionPlan                = "APIerSv1.RemoveTPActionPlan"
	APIerSv1GetTPAttributeProfile             = "APIerSv1.GetTPAttributeProfile"
	APIerSv1SetTPAttributeProfile             = "APIerSv1.SetTPAttributeProfile"
	APIerSv1GetTPAttributeProfileIds          = "APIerSv1.GetTPAttributeProfileIds"
	APIerSv1RemoveTPAttributeProfile          = "APIerSv1.RemoveTPAttributeProfile"
	APIerSv1GetTPCharger                      = "APIerSv1.GetTPCharger"
	APIerSv1SetTPCharger                      = "APIerSv1.SetTPCharger"
	APIerSv1RemoveTPCharger                   = "APIerSv1.RemoveTPCharger"
	APIerSv1GetTPChargerIDs                   = "APIerSv1.GetTPChargerIDs"
	APIerSv1SetTPFilterProfile                = "APIerSv1.SetTPFilterProfile"
	APIerSv1GetTPFilterProfile                = "APIerSv1.GetTPFilterProfile"
	APIerSv1GetTPFilterProfileIds             = "APIerSv1.GetTPFilterProfileIds"
	APIerSv1RemoveTPFilterProfile             = "APIerSv1.RemoveTPFilterProfile"
	APIerSv1GetTPDestination                  = "APIerSv1.GetTPDestination"
	APIerSv1SetTPDestination                  = "APIerSv1.SetTPDestination"
	APIerSv1GetTPDestinationIDs               = "APIerSv1.GetTPDestinationIDs"
	APIerSv1RemoveTPDestination               = "APIerSv1.RemoveTPDestination"
	APIerSv1GetTPResource                     = "APIerSv1.GetTPResource"
	APIerSv1SetTPResource                     = "APIerSv1.SetTPResource"
	APIerSv1RemoveTPResource                  = "APIerSv1.RemoveTPResource"
	APIerSv1SetTPRate                         = "APIerSv1.SetTPRate"
	APIerSv1GetTPRate                         = "APIerSv1.GetTPRate"
	APIerSv1RemoveTPRate                      = "APIerSv1.RemoveTPRate"
	APIerSv1GetTPRateIds                      = "APIerSv1.GetTPRateIds"
	APIerSv1SetTPThreshold                    = "APIerSv1.SetTPThreshold"
	APIerSv1GetTPThreshold                    = "APIerSv1.GetTPThreshold"
	APIerSv1GetTPThresholdIDs                 = "APIerSv1.GetTPThresholdIDs"
	APIerSv1RemoveTPThreshold                 = "APIerSv1.RemoveTPThreshold"
	APIerSv1SetTPStat                         = "APIerSv1.SetTPStat"
	APIerSv1GetTPStat                         = "APIerSv1.GetTPStat"
	APIerSv1RemoveTPStat                      = "APIerSv1.RemoveTPStat"
	APIerSv1GetTPDestinationRate              = "APIerSv1.GetTPDestinationRate"
	APIerSv1SetTPSupplierProfile              = "APIerSv1.SetTPSupplierProfile"
	APIerSv1GetTPSupplierProfile              = "APIerSv1.GetTPSupplierProfile"
	APIerSv1GetTPSupplierProfileIDs           = "APIerSv1.GetTPSupplierProfileIDs"
	APIerSv1RemoveTPSupplierProfile           = "APIerSv1.RemoveTPSupplierProfile"
	APIerSv1GetTPDispatcherProfile            = "APIerSv1.GetTPDispatcherProfile"
	APIerSv1SetTPDispatcherProfile            = "APIerSv1.SetTPDispatcherProfile"
	APIerSv1RemoveTPDispatcherProfile         = "APIerSv1.RemoveTPDispatcherProfile"
	APIerSv1GetTPDispatcherProfileIDs         = "APIerSv1.GetTPDispatcherProfileIDs"
	APIerSv1GetTPSharedGroups                 = "APIerSv1.GetTPSharedGroups"
	APIerSv1SetTPSharedGroups                 = "APIerSv1.SetTPSharedGroups"
	APIerSv1GetTPSharedGroupIds               = "APIerSv1.GetTPSharedGroupIds"
	APIerSv1RemoveTPSharedGroups              = "APIerSv1.RemoveTPSharedGroups"
	APIerSv1ExportCDRs                        = "APIerSv1.ExportCDRs"
	APIerSv1GetTPRatingPlan                   = "APIerSv1.GetTPRatingPlan"
	APIerSv1SetTPRatingPlan                   = "APIerSv1.SetTPRatingPlan"
	APIerSv1GetTPRatingPlanIds                = "APIerSv1.GetTPRatingPlanIds"
	APIerSv1RemoveTPRatingPlan                = "APIerSv1.RemoveTPRatingPlan"
	APIerSv1SetTPActions                      = "APIerSv1.SetTPActions"
	APIerSv1GetTPActionIds                    = "APIerSv1.GetTPActionIds"
	APIerSv1RemoveTPActions                   = "APIerSv1.RemoveTPActions"
	APIerSv1SetActionPlan                     = "APIerSv1.SetActionPlan"
	APIerSv1ExecuteAction                     = "APIerSv1.ExecuteAction"
	APIerSv1SetTPRatingProfile                = "APIerSv1.SetTPRatingProfile"
	APIerSv1GetTPRatingProfile                = "APIerSv1.GetTPRatingProfile"
	APIerSv1RemoveTPRatingProfile             = "APIerSv1.RemoveTPRatingProfile"
	APIerSv1SetTPDestinationRate              = "APIerSv1.SetTPDestinationRate"
	APIerSv1GetTPRatingProfileLoadIds         = "APIerSv1.GetTPRatingProfileLoadIds"
	APIerSv1GetTPRatingProfilesByLoadID       = "APIerSv1.GetTPRatingProfilesByLoadID"
	APIerSv1GetTPRatingProfileIds             = "APIerSv1.GetTPRatingProfileIds"
	APIerSv1GetTPDestinationRateIds           = "APIerSv1.GetTPDestinationRateIds"
	APIerSv1RemoveTPDestinationRate           = "APIerSv1.RemoveTPDestinationRate"
	APIerSv1ImportTariffPlanFromFolder        = "APIerSv1.ImportTariffPlanFromFolder"
	APIerSv1ExportTPToFolder                  = "APIerSv1.ExportTPToFolder"
	APIerSv1LoadRatingPlan                    = "APIerSv1.LoadRatingPlan"
	APIerSv1LoadRatingProfile                 = "APIerSv1.LoadRatingProfile"
	APIerSv1LoadAccountActions                = "APIerSv1.LoadAccountActions"
	APIerSv1SetActions                        = "APIerSv1.SetActions"
	APIerSv1AddTriggeredAction                = "APIerSv1.AddTriggeredAction"
	APIerSv1GetAccountActionTriggers          = "APIerSv1.GetAccountActionTriggers"
	APIerSv1AddAccountActionTriggers          = "APIerSv1.AddAccountActionTriggers"
	APIerSv1ResetAccountActionTriggers        = "APIerSv1.ResetAccountActionTriggers"
	APIerSv1SetAccountActionTriggers          = "APIerSv1.SetAccountActionTriggers"
	APIerSv1RemoveAccountActionTriggers       = "APIerSv1.RemoveAccountActionTriggers"
	APIerSv1GetScheduledActions               = "APIerSv1.GetScheduledActions"
	APIerSv1RemoveActionTiming                = "APIerSv1.RemoveActionTiming"
	APIerSv1ComputeReverseDestinations        = "APIerSv1.ComputeReverseDestinations"
	APIerSv1ComputeAccountActionPlans         = "APIerSv1.ComputeAccountActionPlans"
	APIerSv1SetDestination                    = "APIerSv1.SetDestination"
	APIerSv1GetDataCost                       = "APIerSv1.GetDataCost"
	APIerSv1ReplayFailedPosts                 = "APIerSv1.ReplayFailedPosts"
	APIerSv1RemoveAccount                     = "APIerSv1.RemoveAccount"
	APIerSv1DebitUsage                        = "APIerSv1.DebitUsage"
	APIerSv1GetCacheStats                     = "APIerSv1.GetCacheStats"
	APIerSv1ReloadCache                       = "APIerSv1.ReloadCache"
	APIerSv1GetActionTriggers                 = "APIerSv1.GetActionTriggers"
	APIerSv1SetActionTrigger                  = "APIerSv1.SetActionTrigger"
	APIerSv1RemoveActionPlan                  = "APIerSv1.RemoveActionPlan"
	APIerSv1RemoveActions                     = "APIerSv1.RemoveActions"
	APIerSv1RemoveBalances                    = "APIerSv1.RemoveBalances"
	APIerSv1ReloadCdreConfig                  = "APIerSv1.ReloadCdreConfig"
	APIerSv1GetLoadHistory                    = "APIerSv1.GetLoadHistory"
	APIerSv1GetLoadIDs                        = "APIerSv1.GetLoadIDs"
	APIerSv1ExecuteScheduledActions           = "APIerSv1.ExecuteScheduledActions"
	APIerSv1GetLoadTimes                      = "APIerSv1.GetLoadTimes"
	APIerSv1GetSharedGroup                    = "APIerSv1.GetSharedGroup"
	APIerSv1RemoveActionTrigger               = "APIerSv1.RemoveActionTrigger"
	APIerSv1GetAccount                        = "APIerSv1.GetAccount"
)

APIerSv1 APIs

View Source
const (
	APIerSv1SetTPTiming              = "APIerSv1.SetTPTiming"
	APIerSv1GetTPTiming              = "APIerSv1.GetTPTiming"
	APIerSv1RemoveTPTiming           = "APIerSv1.RemoveTPTiming"
	APIerSv1GetTPTimingIds           = "APIerSv1.GetTPTimingIds"
	APIerSv1LoadTariffPlanFromStorDb = "APIerSv1.LoadTariffPlanFromStorDb"
	APIerSv1RemoveTPFromFolder       = "APIerSv1.RemoveTPFromFolder"
)

APIerSv1 TP APIs

View Source
const (
	APIerSv2                           = "APIerSv2"
	APIerSv2LoadTariffPlanFromFolder   = "APIerSv2.LoadTariffPlanFromFolder"
	APIerSv2GetCDRs                    = "APIerSv2.GetCDRs"
	APIerSv2GetAccount                 = "APIerSv2.GetAccount"
	APIerSv2GetAccounts                = "APIerSv2.GetAccounts"
	APIerSv2SetAccount                 = "APIerSv2.SetAccount"
	APIerSv2CountCDRs                  = "APIerSv2.CountCDRs"
	APIerSv2SetBalance                 = "APIerSv2.SetBalance"
	APIerSv2SetActions                 = "APIerSv2.SetActions"
	APIerSv2RemoveTPTiming             = "APIerSv2.RemoveTPTiming"
	APIerSv2GetTPDestination           = "APIerSv2.GetTPDestination"
	APIerSv2SetTPDestination           = "APIerSv2.SetTPDestination"
	APIerSv2RemoveTPDestination        = "APIerSv2.RemoveTPDestination"
	APIerSv2GetTPDestinationIDs        = "APIerSv2.GetTPDestinationIDs"
	APIerSv2GetTPTiming                = "APIerSv2.GetTPTiming"
	APIerSv2SetTPTiming                = "APIerSv2.SetTPTiming"
	APIerSv2SetAccountActionTriggers   = "APIerSv2.SetAccountActionTriggers"
	APIerSv2GetAccountActionTriggers   = "APIerSv2.GetAccountActionTriggers"
	APIerSv2SetActionPlan              = "APIerSv2.SetActionPlan"
	APIerSv2GetActions                 = "APIerSv2.GetActions"
	APIerSv2GetDestinations            = "APIerSv2.GetDestinations"
	APIerSv2GetCacheStats              = "APIerSv2.GetCacheStats"
	APIerSv2ExecuteAction              = "APIerSv2.ExecuteAction"
	APIerSv2ResetAccountActionTriggers = "APIerSv2.ResetAccountActionTriggers"
	APIerSv2RemoveActions              = "APIerSv2.RemoveActions"
	APIerSv2ExportCdrsToFile           = "APIerSv2.ExportCdrsToFile"
)

APIerSv2 APIs

View Source
const (
	ServiceManagerV1              = "ServiceManagerV1"
	ServiceManagerV1StartService  = "ServiceManagerV1.StartService"
	ServiceManagerV1StopService   = "ServiceManagerV1.StopService"
	ServiceManagerV1ServiceStatus = "ServiceManagerV1.ServiceStatus"
	ServiceManagerV1Ping          = "ServiceManagerV1.Ping"
)
View Source
const (
	ConfigSv1                     = "ConfigSv1"
	ConfigSv1GetJSONSection       = "ConfigSv1.GetJSONSection"
	ConfigSv1ReloadConfigFromPath = "ConfigSv1.ReloadConfigFromPath"
	ConfigSv1ReloadConfigFromJSON = "ConfigSv1.ReloadConfigFromJSON"
)
View Source
const (
	RALsV1                   = "RALsV1"
	RALsV1GetRatingPlansCost = "RALsV1.GetRatingPlansCost"
	RALsV1Ping               = "RALsV1.Ping"
)
View Source
const (
	CoreS         = "CoreS"
	CoreSv1       = "CoreSv1"
	CoreSv1Status = "CoreSv1.Status"
	CoreSv1Ping   = "CoreSv1.Ping"
	CoreSv1Sleep  = "CoreSv1.Sleep"
)
View Source
const (
	SupplierSv1GetSuppliers                = "SupplierSv1.GetSuppliers"
	SupplierSv1GetSupplierProfilesForEvent = "SupplierSv1.GetSupplierProfilesForEvent"
	SupplierSv1Ping                        = "SupplierSv1.Ping"
	APIerSv1GetSupplierProfile             = "APIerSv1.GetSupplierProfile"
	APIerSv1GetSupplierProfileIDs          = "APIerSv1.GetSupplierProfileIDs"
	APIerSv1RemoveSupplierProfile          = "APIerSv1.RemoveSupplierProfile"
	APIerSv1SetSupplierProfile             = "APIerSv1.SetSupplierProfile"
)

SupplierS APIs

View Source
const (
	APIerSv1SetAttributeProfile      = "APIerSv1.SetAttributeProfile"
	APIerSv1GetAttributeProfile      = "APIerSv1.GetAttributeProfile"
	APIerSv1GetAttributeProfileIDs   = "APIerSv1.GetAttributeProfileIDs"
	APIerSv1RemoveAttributeProfile   = "APIerSv1.RemoveAttributeProfile"
	APIerSv2SetAttributeProfile      = "APIerSv2.SetAttributeProfile"
	AttributeSv1GetAttributeForEvent = "AttributeSv1.GetAttributeForEvent"
	AttributeSv1ProcessEvent         = "AttributeSv1.ProcessEvent"
	AttributeSv1Ping                 = "AttributeSv1.Ping"
)

AttributeS APIs

View Source
const (
	ChargerSv1Ping                = "ChargerSv1.Ping"
	ChargerSv1GetChargersForEvent = "ChargerSv1.GetChargersForEvent"
	ChargerSv1ProcessEvent        = "ChargerSv1.ProcessEvent"
	APIerSv1GetChargerProfile     = "APIerSv1.GetChargerProfile"
	APIerSv1RemoveChargerProfile  = "APIerSv1.RemoveChargerProfile"
	APIerSv1SetChargerProfile     = "APIerSv1.SetChargerProfile"
	APIerSv1GetChargerProfileIDs  = "APIerSv1.GetChargerProfileIDs"
)

ChargerS APIs

View Source
const (
	ThresholdSv1ProcessEvent          = "ThresholdSv1.ProcessEvent"
	ThresholdSv1GetThreshold          = "ThresholdSv1.GetThreshold"
	ThresholdSv1GetThresholdIDs       = "ThresholdSv1.GetThresholdIDs"
	ThresholdSv1Ping                  = "ThresholdSv1.Ping"
	ThresholdSv1GetThresholdsForEvent = "ThresholdSv1.GetThresholdsForEvent"
	APIerSv1GetThresholdProfileIDs    = "APIerSv1.GetThresholdProfileIDs"
	APIerSv1GetThresholdProfile       = "APIerSv1.GetThresholdProfile"
	APIerSv1RemoveThresholdProfile    = "APIerSv1.RemoveThresholdProfile"
	APIerSv1SetThresholdProfile       = "APIerSv1.SetThresholdProfile"
)

ThresholdS APIs

View Source
const (
	StatSv1ProcessEvent            = "StatSv1.ProcessEvent"
	StatSv1GetQueueIDs             = "StatSv1.GetQueueIDs"
	StatSv1GetQueueStringMetrics   = "StatSv1.GetQueueStringMetrics"
	StatSv1GetQueueFloatMetrics    = "StatSv1.GetQueueFloatMetrics"
	StatSv1Ping                    = "StatSv1.Ping"
	StatSv1GetStatQueuesForEvent   = "StatSv1.GetStatQueuesForEvent"
	StatSv1GetStatQueue            = "StatSv1.GetStatQueue"
	APIerSv1GetStatQueueProfile    = "APIerSv1.GetStatQueueProfile"
	APIerSv1RemoveStatQueueProfile = "APIerSv1.RemoveStatQueueProfile"
	APIerSv1SetStatQueueProfile    = "APIerSv1.SetStatQueueProfile"
	APIerSv1GetStatQueueProfileIDs = "APIerSv1.GetStatQueueProfileIDs"
)

StatS APIs

View Source
const (
	ResourceSv1AuthorizeResources   = "ResourceSv1.AuthorizeResources"
	ResourceSv1GetResourcesForEvent = "ResourceSv1.GetResourcesForEvent"
	ResourceSv1AllocateResources    = "ResourceSv1.AllocateResources"
	ResourceSv1ReleaseResources     = "ResourceSv1.ReleaseResources"
	ResourceSv1Ping                 = "ResourceSv1.Ping"
	ResourceSv1GetResource          = "ResourceSv1.GetResource"
	APIerSv1SetResourceProfile      = "APIerSv1.SetResourceProfile"
	APIerSv1RemoveResourceProfile   = "APIerSv1.RemoveResourceProfile"
	APIerSv1GetResourceProfile      = "APIerSv1.GetResourceProfile"
	APIerSv1GetResourceProfileIDs   = "APIerSv1.GetResourceProfileIDs"
)

ResourceS 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"
	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"
	SMGenericV1InitiateSession           = "SMGenericV1.InitiateSession"
	SessionSv1Sleep                      = "SessionSv1.Sleep"
)

SessionS APIs

View Source
const (
	Responder                            = "Responder"
	ResponderDebit                       = "Responder.Debit"
	ResponderRefundIncrements            = "Responder.RefundIncrements"
	ResponderGetMaxSessionTime           = "Responder.GetMaxSessionTime"
	ResponderMaxDebit                    = "Responder.MaxDebit"
	ResponderRefundRounding              = "Responder.RefundRounding"
	ResponderGetCost                     = "Responder.GetCost"
	ResponderGetCostOnRatingPlans        = "Responder.GetCostOnRatingPlans"
	ResponderGetMaxSessionTimeOnAccounts = "Responder.GetMaxSessionTimeOnAccounts"
	ResponderShutdown                    = "Responder.Shutdown"
	ResponderPing                        = "Responder.Ping"
)

Responder APIs

View Source
const (
	DispatcherSv1Ping               = "DispatcherSv1.Ping"
	DispatcherSv1GetProfileForEvent = "DispatcherSv1.GetProfileForEvent"
	DispatcherSv1Apier              = "DispatcherSv1.Apier"
	DispatcherServicePing           = "DispatcherService.Ping"
)

DispatcherS APIs

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

AnalyzerS APIs

View Source
const (
	LoaderSv1       = "LoaderSv1"
	LoaderSv1Load   = "LoaderSv1.Load"
	LoaderSv1Remove = "LoaderSv1.Remove"
	LoaderSv1Ping   = "LoaderSv1.Ping"
)

LoaderS APIs

View Source
const (
	CacheSv1                  = "CacheSv1"
	CacheSv1GetCacheStats     = "CacheSv1.GetCacheStats"
	CacheSv1GetItemIDs        = "CacheSv1.GetItemIDs"
	CacheSv1HasItem           = "CacheSv1.HasItem"
	CacheSv1GetItemExpiryTime = "CacheSv1.GetItemExpiryTime"
	CacheSv1RemoveItem        = "CacheSv1.RemoveItem"
	CacheSv1PrecacheStatus    = "CacheSv1.PrecacheStatus"
	CacheSv1HasGroup          = "CacheSv1.HasGroup"
	CacheSv1GetGroupItemIDs   = "CacheSv1.GetGroupItemIDs"
	CacheSv1RemoveGroup       = "CacheSv1.RemoveGroup"
	CacheSv1Clear             = "CacheSv1.Clear"
	CacheSv1ReloadCache       = "CacheSv1.ReloadCache"
	CacheSv1LoadCache         = "CacheSv1.LoadCache"
	CacheSv1FlushCache        = "CacheSv1.FlushCache"
	CacheSv1Ping              = "CacheSv1.Ping"
)

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"
	CDRsV1Ping               = "CDRsV1.Ping"
	CDRsV2                   = "CDRsV2"
	CDRsV2StoreSessionCost   = "CDRsV2.StoreSessionCost"
	CdrsV2ProcessExternalCdr = "CdrsV2.ProcessExternalCdr"
	CdrsV2ProcessCdr         = "CdrsV2.ProcessCdr"
)

Cdrs APIs

View Source
const (
	SchedulerSv1       = "SchedulerSv1"
	SchedulerSv1Ping   = "SchedulerSv1.Ping"
	SchedulerSv1Reload = "SchedulerSv1.Reload"
)

Scheduler

View Source
const (
	CGR_ACCOUNT          = "cgr_account"
	CGR_SUPPLIER         = "cgr_supplier"
	CGR_DESTINATION      = "cgr_destination"
	CGR_SUBJECT          = "cgr_subject"
	CGR_CATEGORY         = "cgr_category"
	CGR_REQTYPE          = "cgr_reqtype"
	CGR_TENANT           = "cgr_tenant"
	CGR_PDD              = "cgr_pdd"
	CGR_DISCONNECT_CAUSE = "cgr_disconnectcause"
	CGR_COMPUTELCR       = "cgr_computelcr"
	CGR_SUPPLIERS        = "cgr_suppliers"
	CGRFlags             = "cgr_flags"
)

cgr_ variables

View Source
const (
	TimingsCsv            = "Timings.csv"
	DestinationsCsv       = "Destinations.csv"
	RatesCsv              = "Rates.csv"
	DestinationRatesCsv   = "DestinationRates.csv"
	RatingPlansCsv        = "RatingPlans.csv"
	RatingProfilesCsv     = "RatingProfiles.csv"
	SharedGroupsCsv       = "SharedGroups.csv"
	ActionsCsv            = "Actions.csv"
	ActionPlansCsv        = "ActionPlans.csv"
	ActionTriggersCsv     = "ActionTriggers.csv"
	AccountActionsCsv     = "AccountActions.csv"
	ResourcesCsv          = "Resources.csv"
	StatsCsv              = "Stats.csv"
	ThresholdsCsv         = "Thresholds.csv"
	FiltersCsv            = "Filters.csv"
	SuppliersCsv          = "Suppliers.csv"
	AttributesCsv         = "Attributes.csv"
	ChargersCsv           = "Chargers.csv"
	DispatcherProfilesCsv = "DispatcherProfiles.csv"
	DispatcherHostsCsv    = "DispatcherHosts.csv"
)

CSV file name

View Source
const (
	TBLTPTimings          = "tp_timings"
	TBLTPDestinations     = "tp_destinations"
	TBLTPRates            = "tp_rates"
	TBLTPDestinationRates = "tp_destination_rates"
	TBLTPRatingPlans      = "tp_rating_plans"
	TBLTPRateProfiles     = "tp_rating_profiles"
	TBLTPSharedGroups     = "tp_shared_groups"
	TBLTPActions          = "tp_actions"
	TBLTPActionPlans      = "tp_action_plans"
	TBLTPActionTriggers   = "tp_action_triggers"
	TBLTPAccountActions   = "tp_account_actions"
	TBLTPResources        = "tp_resources"
	TBLTPStats            = "tp_stats"
	TBLTPThresholds       = "tp_thresholds"
	TBLTPFilters          = "tp_filters"
	SessionCostsTBL       = "session_costs"
	CDRsTBL               = "cdrs"
	TBLTPSuppliers        = "tp_suppliers"
	TBLTPAttributes       = "tp_attributes"
	TBLTPChargers         = "tp_chargers"
	TBLVersions           = "versions"
	OldSMCosts            = "sm_costs"
	TBLTPDispatchers      = "tp_dispatcher_profiles"
	TBLTPDispatcherHosts  = "tp_dispatcher_hosts"
)

Table Name

View Source
const (
	CacheDestinations            = "*destinations"
	CacheReverseDestinations     = "*reverse_destinations"
	CacheRatingPlans             = "*rating_plans"
	CacheRatingProfiles          = "*rating_profiles"
	CacheActions                 = "*actions"
	CacheActionPlans             = "*action_plans"
	CacheAccountActionPlans      = "*account_action_plans"
	CacheActionTriggers          = "*action_triggers"
	CacheSharedGroups            = "*shared_groups"
	CacheResources               = "*resources"
	CacheResourceProfiles        = "*resource_profiles"
	CacheTimings                 = "*timings"
	CacheEventResources          = "*event_resources"
	CacheStatQueueProfiles       = "*statqueue_profiles"
	CacheStatQueues              = "*statqueues"
	CacheThresholdProfiles       = "*threshold_profiles"
	CacheThresholds              = "*thresholds"
	CacheFilters                 = "*filters"
	CacheSupplierProfiles        = "*supplier_profiles"
	CacheAttributeProfiles       = "*attribute_profiles"
	CacheChargerProfiles         = "*charger_profiles"
	CacheDispatcherProfiles      = "*dispatcher_profiles"
	CacheDispatcherHosts         = "*dispatcher_hosts"
	CacheDispatchers             = "*dispatchers"
	CacheDispatcherRoutes        = "*dispatcher_routes"
	CacheResourceFilterIndexes   = "*resource_filter_indexes"
	CacheStatFilterIndexes       = "*stat_filter_indexes"
	CacheThresholdFilterIndexes  = "*threshold_filter_indexes"
	CacheSupplierFilterIndexes   = "*supplier_filter_indexes"
	CacheAttributeFilterIndexes  = "*attribute_filter_indexes"
	CacheChargerFilterIndexes    = "*charger_filter_indexes"
	CacheDispatcherFilterIndexes = "*dispatcher_filter_indexes"
	CacheReverseFilterIndexes    = "*reverse_filter_indexes"
	CacheDiameterMessages        = "*diameter_messages"
	CacheRPCResponses            = "*rpc_responses"
	CacheClosedSessions          = "*closed_sessions"
	MetaPrecaching               = "*precaching"
	MetaReady                    = "*ready"
	CacheLoadIDs                 = "*load_ids"
	CacheAccounts                = "*accounts"
	CacheRPCConnections          = "*rpc_connections"
	CacheCDRIDs                  = "*cdr_ids"
	CacheRatingProfilesTmp       = "*tmp_rating_profiles"
	CacheReplicationHosts        = "*replication_hosts"
)

Cache Name

View Source
const (
	ResourceFilterIndexes   = "rfi_"
	StatFilterIndexes       = "sfi_"
	ThresholdFilterIndexes  = "tfi_"
	SupplierFilterIndexes   = "spi_"
	AttributeFilterIndexes  = "afi_"
	ChargerFilterIndexes    = "cfi_"
	DispatcherFilterIndexes = "dfi_"
	ActionPlanIndexes       = "api_"
	ReverseFilterIndexes    = "fii_"
)

Prefix for indexing

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

Agents

View Source
const (
	SQSPoster    = "SQSPoster"
	S3Poster     = "S3Poster"
	AWSRegion    = "aws_region"
	AWSKey       = "aws_key"
	AWSSecret    = "aws_secret"
	KafkaTopic   = "topic"
	KafkaGroupID = "group_id"
	KafkaMaxWait = "max_wait"
)

Poster

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

Google_API

View Source
const (
	NodeIDCfg             = "node_id"
	LoggerCfg             = "logger"
	LogLevelCfg           = "log_level"
	HttpSkipTlsVerifyCfg  = "http_skip_tls_verify"
	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"
	ConnectAttemptsCfg    = "connect_attempts"
	ReconnectsCfg         = "reconnects"
	ConnectTimeoutCfg     = "connect_timeout"
	ReplyTimeoutCfg       = "reply_timeout"
	LockingTimeoutCfg     = "locking_timeout"
	DigestSeparatorCfg    = "digest_separator"
	DigestEqualCfg        = "digest_equal"
	RSRSepCfg             = "rsr_separator"
	MaxParallelConnsCfg   = "max_parallel_conns"
	ConcurrentRequestsCfg = "concurrent_requests"
	ConcurrentStrategyCfg = "concurrent_strategy"
)

GeneralCfg

View Source
const (
	TypeCfg                = "type"
	MaxOpenConnsCfg        = "max_open_conns"
	MaxIdleConnsCfg        = "max_idle_conns"
	ConnMaxLifetimeCfg     = "conn_max_lifetime"
	StringIndexedFieldsCfg = "string_indexed_fields"
	PrefixIndexedFieldsCfg = "prefix_indexed_fields"
	QueryTimeoutCfg        = "query_timeout"
	SSLModeCfg             = "sslmode"
	ItemsCfg               = "items"
)

StorDbCfg

View Source
const (
	DataDbTypeCfg          = "db_type"
	DataDbHostCfg          = "db_host"
	DataDbPortCfg          = "db_port"
	DataDbNameCfg          = "db_name"
	DataDbUserCfg          = "db_user"
	DataDbPassCfg          = "db_password"
	DataDbSentinelNameCfg  = "redis_sentinel"
	RmtConnsCfg            = "remote_conns"
	RplConnsCfg            = "replication_conns"
	ReplicationFilteredCfg = "replication_filtered"
)

DataDbCfg

View Source
const (
	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"
	HTTPWSURLCfg             = "ws_url"
	HTTPFreeswitchCDRsURLCfg = "freeswitch_cdrs_url"
	HTTPCDRsURLCfg           = "http_cdrs"
	HTTPUseBasicAuthCfg      = "use_basic_auth"
	HTTPAuthUsersCfg         = "auth_users"
)

HTTPCfg

View Source
const (
	StatSConnsCfg     = "stats_conns"
	ResourceSConnsCfg = "resources_conns"
	ApierSConnsCfg    = "apiers_conns"
)

FilterSCfg

View Source
const (
	EnabledCfg                 = "enabled"
	ThresholdSConnsCfg         = "thresholds_conns"
	CacheSConnsCfg             = "caches_conns"
	RpSubjectPrefixMatchingCfg = "rp_subject_prefix_matching"
	RemoveExpiredCfg           = "remove_expired"
	MaxComputedUsageCfg        = "max_computed_usage"
	BalanceRatingSubjectCfg    = "balance_rating_subject"
	MaxIncrementsCfg           = "max_increments"
)

RalsCfg

View Source
const (
	CDRsConnsCfg = "cdrs_conns"
	FiltersCfg   = "filters"
)

SchedulerCfg

View Source
const (
	ExtraFieldsCfg      = "extra_fields"
	StoreCdrsCfg        = "store_cdrs"
	SMCostRetriesCfg    = "session_cost_retries"
	ChargerSConnsCfg    = "chargers_conns"
	AttributeSConnsCfg  = "attributes_conns"
	OnlineCDRExportsCfg = "online_cdr_exports"
)

CdrsCfg

View Source
const (
	ListenBijsonCfg        = "listen_bijson"
	RALsConnsCfg           = "rals_conns"
	ResSConnsCfg           = "resources_conns"
	ThreshSConnsCfg        = "thresholds_conns"
	SupplSConnsCfg         = "suppliers_conns"
	AttrSConnsCfg          = "attributes_conns"
	ReplicationConnsCfg    = "replication_conns"
	DebitIntervalCfg       = "debit_interval"
	StoreSCostsCfg         = "store_session_costs"
	SessionTTLCfg          = "session_ttl"
	SessionTTLMaxDelayCfg  = "session_ttl_max_delay"
	SessionTTLLastUsedCfg  = "session_ttl_last_used"
	SessionTTLUsageCfg     = "session_ttl_usage"
	SessionTTLLastUsageCfg = "session_ttl_last_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"
)

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"
	EventSocketConnsCfg    = "event_socket_conns"
)

FsAgentCfg

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

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

	// AsteriskConnCfg
	UserCf = "user"

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

	// DiameterAgentCfg
	ListenNetCfg         = "listen_net"
	ListenCfg            = "listen"
	DictionariesPathCfg  = "dictionaries_path"
	OriginHostCfg        = "origin_host"
	OriginRealmCfg       = "origin_realm"
	VendorIdCfg          = "vendor_id"
	ProductNameCfg       = "product_name"
	ConcurrentReqsCfg    = "concurrent_requests"
	SyncedConnReqsCfg    = "synced_conn_requests"
	ASRTemplateCfg       = "asr_template"
	RARTemplateCfg       = "rar_template"
	ForcedDisconnectCfg  = "forced_disconnect"
	TemplatesCfg         = "templates"
	RequestProcessorsCfg = "request_processors"

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

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

	// AttributeSCfg
	IndexedSelectsCfg = "indexed_selects"
	ProcessRunsCfg    = "process_runs"
	NestedFieldsCfg   = "nested_fields"

	// ChargerSCfg
	StoreIntervalCfg = "store_interval"

	// StatSCfg
	StoreUncompressedLimitCfg = "store_uncompressed_limit"

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

	// CdreCfg
	ExportFormatCfg      = "export_format"
	ExportPathCfg        = "export_path"
	AttributeSContextCfg = "attributes_context"
	SynchronousCfg       = "synchronous"
	AttemptsCfg          = "attempts"

	//LoaderSCfg
	IdCfg           = "id"
	DryRunCfg       = "dry_run"
	LockFileNameCfg = "lock_filename"
	TpInDirCfg      = "tp_in_dir"
	TpOutDirCfg     = "tp_out_dir"
	DataCfg         = "data"

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

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"
	BreakOnSuccessCfg  = "break_on_success"
	Handler_id         = "handler_id"
	LayoutCfg          = "layout"
	CostShiftDigitsCfg = "cost_shift_digits"
	MaskDestIDCfg      = "mask_destinationd_id"
	MaskLenCfg         = "mask_length"
)

FC Template

View Source
const (
	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"
	FieldSeparatorCfg  = "field_separator"
	CachesConnsCfg     = "caches_conns"
	SchedulerConnsCfg  = "scheduler_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"
	OutDataDBRedisSentinelCfg = "out_datadb_redis_sentinel"
	OutStorDBTypeCfg          = "out_stordb_type"
	OutStorDBHostCfg          = "out_stordb_host"
	OutStorDBPortCfg          = "out_stordb_port"
	OutStorDBNameCfg          = "out_stordb_name"
	OutStorDBUserCfg          = "out_stordb_user"
	OutStorDBPasswordCfg      = "out_stordb_password"
	UsersFiltersCfg           = "users_filters"
)

MigratorCgrCfg

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

MailerCfg

View Source
const (
	IDCfg                       = "id"
	RowLengthCfg                = "row_length"
	FieldSepCfg                 = "field_separator"
	RunDelayCfg                 = "run_delay"
	SourcePathCfg               = "source_path"
	ProcessedPathCfg            = "processed_path"
	XmlRootPathCfg              = "xml_root_path"
	TenantCfg                   = "tenant"
	FlagsCfg                    = "flags"
	FailedCallsPrefixCfg        = "failed_calls_prefix"
	PartialRecordCacheCfg       = "partial_record_cache"
	PartialCacheExpiryActionCfg = "partial_cache_expiry_action"
	FieldsCfg                   = "fields"
	CacheDumpFieldsCfg          = "cache_dump_fields"
)

EventReaderCfg

View Source
const (
	CdreProfiles     = "cdre"             // from JSON
	LoaderCfg        = "loaders"          // from JSON
	HttpAgentCfg     = "http_agent"       // from JSON
	RpcConns         = "rpc_conns"        // from JSON
	GeneralCfg       = "general"          // from JSON
	DataDbCfg        = "data_db"          // from JSON
	StorDbCfg        = "stor_db"          // from JSON
	TlsCfg           = "tls"              // from JSON
	CacheCfg         = "caches"           // from JSON
	HttpCfg          = "http"             // from JSON
	FilterSCfg       = "filters"          // from JSON
	RalsCfg          = "rals"             // from JSON
	SchedulerCfg     = "schedulers"       // from JSON
	CdrsCfg          = "cdrs"             // from JSON
	SessionSCfg      = "sessions"         // from JSON
	FsAgentCfg       = "freeswitch_agent" // from JSON
	KamAgentCfg      = "kamailio_agent"   // from JSON
	AsteriskAgentCfg = "asterisk_agent"   // from JSON
	DiameterAgentCfg = "diameter_agent"   // from JSON
	RadiusAgentCfg   = "radius_agent"     // from JSON
	DnsAgentCfg      = "dns_agent"        // from JSON
	AttributeSCfg    = "attributes"       // from JSON
	ChargerSCfg      = "chargers"         // from JSON
	ResourceSCfg     = "resources"        // from JSON
	StatsCfg         = "stats"            // from JSON
	ThresholdSCfg    = "thresholds"       // from JSON
	SupplierSCfg     = "suppliers"        // from JSON
	SureTaxCfg       = "suretax"          // from JSON
	DispatcherSCfg   = "dispatchers"      // from JSON
	LoaderCgrCfg     = "loader"           // from JSON
	MigratorCgrCfg   = "migrator"         // from JSON
	MailerCfg        = "mailer"           // from JSON
	AnalyzerSCfg     = "analyzers"        // from JSON
	Apier            = "apiers"           // from JSON
	ErsCfg           = "ers"              // from JSON

)

CGRConfig

View Source
const (
	AbsoluteMaxUint     = ^uint(0)
	AbsoluteMinUint     = 0
	AbsoluteMaxInt      = int(AbsoluteMaxUint >> 1)
	AbsoluteMinInt      = -AbsoluteMaxInt - 1
	AbsoluteMaxDuration = time.Duration(AbsoluteMaxInt)
)

Go type limits

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 (
	INCREMENTAL = "*incremental"
)

Variables

View Source
var (
	CDRExportFormats = NewStringSet([]string{DRYRUN, MetaFileCSV, MetaFileFWV, MetaHTTPjsonCDR, MetaHTTPjsonMap,
		MetaHTTPjson, MetaHTTPPost, MetaAMQPjsonCDR, MetaAMQPjsonMap, MetaAMQPV1jsonMap, MetaSQSjsonMap,
		MetaKafkajsonMap, MetaS3jsonMap})
	MainCDRFields = NewStringSet([]string{CGRID, Source, OriginHost, OriginID, ToR, RequestType, Tenant, Category,
		Account, Subject, Destination, SetupTime, AnswerTime, Usage, COST, RATED, Partial, RunID,
		PreRated, CostSource, CostDetails, ExtraInfo, OrderID})
	PostPaidRatedSlice = []string{META_POSTPAID, META_RATED}
	ItemList           = NewStringSet([]string{MetaAccounts, MetaAttributes, MetaChargers, MetaDispatchers, MetaDispatcherHosts,
		MetaFilters, MetaResources, MetaStats, MetaThresholds, MetaSuppliers,
	})
	AttrInlineTypes = NewStringSet([]string{META_CONSTANT, MetaVariable, META_COMPOSED, META_USAGE_DIFFERENCE,
		MetaSum, MetaValueExponent})

	GitLastLog                  string // If set, it will be processed as part of versioning
	PosterTransportContentTypes = map[string]string{
		MetaHTTPjsonCDR:   CONTENT_JSON,
		MetaHTTPjsonMap:   CONTENT_JSON,
		MetaHTTPjson:      CONTENT_JSON,
		MetaHTTPPost:      CONTENT_FORM,
		MetaAMQPjsonCDR:   CONTENT_JSON,
		MetaAMQPjsonMap:   CONTENT_JSON,
		MetaAMQPV1jsonMap: CONTENT_JSON,
		MetaSQSjsonMap:    CONTENT_JSON,
		MetaKafkajsonMap:  CONTENT_JSON,
		MetaS3jsonMap:     CONTENT_JSON,
	}
	CDREFileSuffixes = map[string]string{
		MetaHTTPjsonCDR:   JSNSuffix,
		MetaHTTPjsonMap:   JSNSuffix,
		MetaAMQPjsonCDR:   JSNSuffix,
		MetaAMQPjsonMap:   JSNSuffix,
		MetaAMQPV1jsonMap: JSNSuffix,
		MetaSQSjsonMap:    JSNSuffix,
		MetaKafkajsonMap:  JSNSuffix,
		MetaS3jsonMap:     JSNSuffix,
		MetaHTTPPost:      FormSuffix,
		MetaFileCSV:       CSVSuffix,
		MetaFileFWV:       FWVSuffix,
	}
	// CachePartitions enables creation of cache partitions
	CachePartitions = NewStringSet([]string{CacheDestinations, CacheReverseDestinations,
		CacheRatingPlans, CacheRatingProfiles, CacheActions, CacheActionPlans,
		CacheAccountActionPlans, CacheActionTriggers, CacheSharedGroups, CacheTimings,
		CacheResourceProfiles, CacheResources, CacheEventResources, CacheStatQueueProfiles,
		CacheStatQueues, CacheThresholdProfiles, CacheThresholds, CacheFilters,
		CacheSupplierProfiles, CacheAttributeProfiles, CacheChargerProfiles,
		CacheDispatcherProfiles, CacheDispatcherHosts, CacheResourceFilterIndexes,
		CacheStatFilterIndexes, CacheThresholdFilterIndexes, CacheSupplierFilterIndexes,
		CacheAttributeFilterIndexes, CacheChargerFilterIndexes, CacheDispatcherFilterIndexes, CacheReverseFilterIndexes,
		CacheDispatcherRoutes, CacheDiameterMessages, CacheRPCResponses, CacheClosedSessions,
		CacheCDRIDs, CacheLoadIDs, CacheRPCConnections, CacheRatingProfilesTmp})
	CacheInstanceToPrefix = map[string]string{
		CacheDestinations:            DESTINATION_PREFIX,
		CacheReverseDestinations:     REVERSE_DESTINATION_PREFIX,
		CacheRatingPlans:             RATING_PLAN_PREFIX,
		CacheRatingProfiles:          RATING_PROFILE_PREFIX,
		CacheActions:                 ACTION_PREFIX,
		CacheActionPlans:             ACTION_PLAN_PREFIX,
		CacheAccountActionPlans:      AccountActionPlansPrefix,
		CacheActionTriggers:          ACTION_TRIGGER_PREFIX,
		CacheSharedGroups:            SHARED_GROUP_PREFIX,
		CacheResourceProfiles:        ResourceProfilesPrefix,
		CacheResources:               ResourcesPrefix,
		CacheTimings:                 TimingsPrefix,
		CacheStatQueueProfiles:       StatQueueProfilePrefix,
		CacheStatQueues:              StatQueuePrefix,
		CacheThresholdProfiles:       ThresholdProfilePrefix,
		CacheThresholds:              ThresholdPrefix,
		CacheFilters:                 FilterPrefix,
		CacheSupplierProfiles:        SupplierProfilePrefix,
		CacheAttributeProfiles:       AttributeProfilePrefix,
		CacheChargerProfiles:         ChargerProfilePrefix,
		CacheDispatcherProfiles:      DispatcherProfilePrefix,
		CacheDispatcherHosts:         DispatcherHostPrefix,
		CacheResourceFilterIndexes:   ResourceFilterIndexes,
		CacheStatFilterIndexes:       StatFilterIndexes,
		CacheThresholdFilterIndexes:  ThresholdFilterIndexes,
		CacheSupplierFilterIndexes:   SupplierFilterIndexes,
		CacheAttributeFilterIndexes:  AttributeFilterIndexes,
		CacheChargerFilterIndexes:    ChargerFilterIndexes,
		CacheDispatcherFilterIndexes: DispatcherFilterIndexes,
		CacheReverseFilterIndexes:    ReverseFilterIndexes,
		CacheLoadIDs:                 LoadIDPrefix,
		CacheAccounts:                ACCOUNT_PREFIX,
	}
	CachePrefixToInstance map[string]string // will be built on init
	PrefixToIndexCache    = map[string]string{
		ThresholdProfilePrefix:  CacheThresholdFilterIndexes,
		ResourceProfilesPrefix:  CacheResourceFilterIndexes,
		StatQueueProfilePrefix:  CacheStatFilterIndexes,
		SupplierProfilePrefix:   CacheSupplierFilterIndexes,
		AttributeProfilePrefix:  CacheAttributeFilterIndexes,
		ChargerProfilePrefix:    CacheChargerFilterIndexes,
		DispatcherProfilePrefix: CacheDispatcherFilterIndexes,
		ReverseFilterIndexes:    CacheReverseFilterIndexes,
	}
	CacheIndexesToPrefix map[string]string // will be built on init

	// NonMonetaryBalances are types of balances which are not handled as monetary
	NonMonetaryBalances = NewStringSet([]string{VOICE, SMS, DATA, GENERIC})

	// AccountableRequestTypes are the ones handled by Accounting subsystem
	AccountableRequestTypes = NewStringSet([]string{META_PREPAID, META_POSTPAID, META_PSEUDOPREPAID})

	CacheDataDBPartitions = NewStringSet([]string{CacheDestinations, CacheReverseDestinations,
		CacheRatingPlans, CacheRatingProfiles, CacheActions,
		CacheActionPlans, CacheAccountActionPlans, CacheActionTriggers, CacheSharedGroups, CacheResourceProfiles, CacheResources,
		CacheTimings, CacheStatQueueProfiles, CacheStatQueues, CacheThresholdProfiles, CacheThresholds,
		CacheFilters, CacheSupplierProfiles, CacheAttributeProfiles, CacheChargerProfiles,
		CacheDispatcherProfiles, CacheDispatcherHosts, CacheResourceFilterIndexes, CacheStatFilterIndexes,
		CacheThresholdFilterIndexes, CacheSupplierFilterIndexes, CacheAttributeFilterIndexes, CacheReverseFilterIndexes,
		CacheChargerFilterIndexes, CacheDispatcherFilterIndexes, CacheLoadIDs, CacheAccounts})

	// ProtectedSFlds are the fields that sessions should not alter
	ProtectedSFlds = NewStringSet([]string{CGRID, OriginHost, OriginID, Usage})
)
View Source
var (
	PostgressSSLModeDisable    = "disable"
	PostgressSSLModeAllow      = "allow"
	PostgressSSLModePrefer     = "prefer"
	PostgressSSLModeRequire    = "require"
	PostgressSSLModeVerifyCa   = "verify-ca"
	PostgressSSLModeVerifyFull = "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 (
	ErrNoMoreData               = errors.New("NO_MORE_DATA")
	ErrNotImplemented           = errors.New("NOT_IMPLEMENTED")
	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")
	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")
	RalsErrorPrfx               = "RALS_ERROR"
	DispatcherErrorPrefix       = "DISPATCHER_ERROR"
	ErrUnsupportedFormat        = errors.New("UNSUPPORTED_FORMAT")
	ErrNoDatabaseConn           = errors.New("NO_DATA_BASE_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")
	ErrCombimedNotFound         = errors.New("COMBIMED_NOT_FOUND")

	ErrMap = map[string]error{
		ErrNoMoreData.Error():              ErrNoMoreData,
		ErrNotImplemented.Error():          ErrNotImplemented,
		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 ValueFormulas = map[string]valueFormula{
	INCREMENTAL: incrementalFormula,
}

Functions

func APIErrorHandler

func APIErrorHandler(errIn error) (err error)

Centralized returns for APIs

func APIerRPCCall

func APIerRPCCall(inst any, serviceMethod string, args any, reply any) error

ApierRPCCall implements generic RPCCall for APIer instances

func AppendNavMapVal added in v0.10.1

func AppendNavMapVal(nm navMap, fldPath *FullPath, val NMInterface) (err error)

AppendNavMapVal appends value to the map

func AsMapStringIface

func AsMapStringIface(item any) (map[string]any, error)

AsMapStringIface converts an item (mostly struct) as map[string]any

func Avg

func Avg(values []float64) float64

func AvgNegative

func AvgNegative(values []float64) float64

func BoolPointer

func BoolPointer(b bool) *bool

func CapitalizedMessage

func CapitalizedMessage(errMessage string) (capStr string)

CapitalizeErrorMessage returns the capitalized version of an error, useful in APIs

func CastIfToString

func CastIfToString(iface any) (strVal string, casts bool)

Returns the string representation of iface or error if not convertible

func CastRPCErr

func CastRPCErr(err error) error

func Clone

func Clone(a, b any) error

Simple object cloner, b should be a pointer towards a value into which we want to decode

func ComposeNavMapVal added in v0.10.1

func ComposeNavMapVal(nm navMap, fldPath *FullPath, val NMInterface) (err error)

ComposeNavMapVal compose adds value to prevision item

func ConcatenatedKey

func ConcatenatedKey(keyVals ...string) string

func ConvertMapValStrIf

func ConvertMapValStrIf(inMap map[string]string) map[string]any

Converts map[string]string into map[string]any

func CopyHour

func CopyHour(src, dest time.Time) time.Time

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 DaysInMonth

func DaysInMonth(year int, month time.Month) float64

func DaysInYear

func DaysInYear(year int) float64

func Difference

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

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

func DurationPointer

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

func EqualTo

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

func ErrEnvNotFound

func ErrEnvNotFound(key string) error

func ErrHasPrefix

func ErrHasPrefix(err error, prfx string) (has bool)

func ErrNotConvertibleTF

func ErrNotConvertibleTF(from, to 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 FallbackSubjKeys

func FallbackSubjKeys(tenant, tor, fallbackSubjects string) []string

Helper to return the subject fallback keys we need in dataDb

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 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 Float64SliceHasMember added in v0.10.2

func Float64SliceHasMember(ss []float64, s float64) bool

Float64SliceHasMember searches within a *sorted* slice useful to search in shared vars (no slice sort)

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 FromMapStringInterface

func FromMapStringInterface(m map[string]any, in any) error

func FromMapStringInterfaceValue

func FromMapStringInterfaceValue(m map[string]any, v reflect.Value) (any, error)

initial intent was to use it with *cgr_rpc but does not handle slice and structure fields

func FromMapStringString

func FromMapStringString(m map[string]string, in any)

func GenUUID

func GenUUID() string

helper function for uuid generation

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 GetMapExtraFields

func GetMapExtraFields(in any, extraFields string) map[string]string

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 GetPathWithoutIndex added in v0.10.1

func GetPathWithoutIndex(spath string) (opath string)

func GetStartTime

func GetStartTime() string

GetStartTime return the Start time of engine (in UNIX format)

func GetUniformType

func GetUniformType(item any) (any, error)

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 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 IfaceAsInt64

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

func IfaceAsSliceString

func IfaceAsSliceString(fld any) (out []string, err error)

IfaceAsSliceString is trying to convert the interface to a slice of strings

func IfaceAsString

func IfaceAsString(fld any) (out string)

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 InfieldJoin

func InfieldJoin(vals ...string) string

func InfieldSplit

func InfieldSplit(val string) []string

func Int64Pointer

func Int64Pointer(i int64) *int64

func IntPointer

func IntPointer(i int) *int

func IsNetworkError

func IsNetworkError(err error) bool

IsNetworkError will decide if an error is network generated or RPC one used by Dispatcher to figure out whether it should try another connection

func IsSliceMember

func IsSliceMember(ss []string, s string) bool

Binary string search in slice

func LogFull

func LogFull(v any)

func LogStack

func LogStack()

LogStack logs to syslog the stack trace using debug level

func LongExecTimeDetector

func LongExecTimeDetector(logID string, maxDur time.Duration) (endchan chan struct{})

endchan := LongExecTimeDetector("mesaj", 5*time.Second) defer func() { close(endchan) }()

func MapKeys

func MapKeys(m map[string]string) []string

Return map keys

func MapStringStringPointer

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

func MapStringToInt64

func MapStringToInt64(in map[string]string) (out 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 MergeMapsStringIface

func MergeMapsStringIface(mps ...map[string]any) (outMp map[string]any)

Used to merge multiple maps (eg: output of struct having ExtraFields)

func MinDuration

func MinDuration(d1, d2 time.Duration) time.Duration

returns the minimum duration between the two

func MirrorMap

func MirrorMap(mapIn map[string]string) map[string]string

Mirrors key/val

func MissingMapFields

func MissingMapFields(s map[string]any, mandatories []string) []string

MissingMapFields detects missing field values based on mandatory field names from a map[string]any

func MissingMapKeys

func MissingMapKeys(inMap map[string]string, requiredKeys []string) []string

Returns mising keys in a map

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 NewBiJSONrpcClient

func NewBiJSONrpcClient(addr string, handlers map[string]any) (*rpc2.Client, error)

NewBiJSONrpcClient will create a bidirectional JSON client connection

func NewConcReqsGobServerCodec added in v0.10.2

func NewConcReqsGobServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

func NewConcReqsServerCodec added in v0.10.2

func NewConcReqsServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewConcReqsServerCodec returns a new rpc.ServerCodec using JSON-RPC on conn.

func NewCustomJSONServerCodec

func NewCustomJSONServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewCustomJSONServerCodec is used only when DispatcherS is active to handle APIer methods generically

func NewErrAttributeS

func NewErrAttributeS(err error) error

func NewErrChargerS added in v0.10.1

func NewErrChargerS(err error) error

func NewErrDispatcherS

func NewErrDispatcherS(err error) error

func NewErrFldStringCast

func NewErrFldStringCast(fldName string, valIface any) error

func NewErrMandatoryIeMissing

func NewErrMandatoryIeMissing(fields ...string) error

func NewErrNotConnected

func NewErrNotConnected(serv string) error

func NewErrRALs

func NewErrRALs(err error) error

func NewErrResourceS

func NewErrResourceS(err error) error

func NewErrServerError

func NewErrServerError(err error) error

func NewErrServiceNotOperational

func NewErrServiceNotOperational(serv string) error

func NewErrStringCast

func NewErrStringCast(valIface any) error

func NewErrSupplierS

func NewErrSupplierS(err error) error

func NewRPCRequest

func NewRPCRequest(r io.Reader) *rpcRequest

NewRPCRequest returns a new rpcRequest.

func Newlogger

func Newlogger(loggertype, id string) (err error)

functie Newlogger (logger type)

func NonemptyStructFields

func NonemptyStructFields(s any) map[string]any

Detects nonempty struct fields, s should be a pointer to a struct Useful to not overwrite db fields with non defined params in api

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 ParseZeroRatingSubject

func ParseZeroRatingSubject(tor, rateSubj string, defaultRateSubj map[string]string) (time.Duration, error)

ParseZeroRatingSubject will parse the subject in the balance returns duration if able to extract it from subject returns error if not able to parse duration (ie: if ratingSubject is standard one)

func PrefixSliceItems

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

func RPCCall

func RPCCall(inst any, serviceMethod string, args any, reply any) error

RPCCall is a generic method calling RPC on a struct instance serviceMethod is assumed to be in the form InstanceV1.Method where V1Method will become RPC method called on instance

func RandomInteger

func RandomInteger(min, max int64) int64

RandomInteger returns a random 64-bit integer between min and max values

func ReflectFieldAsString

func ReflectFieldAsString(intf any, fldName, extraFieldsLabel string) (string, error)

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

func ReflectFieldInterface

func ReflectFieldInterface(intf any, fldName, extraFieldsLabel string) (retIf any, err error)

ReflectFieldInterface 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 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 RegisterRpcParams

func RegisterRpcParams(name string, obj any)

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 RoundDuration

func RoundDuration(whole, amount time.Duration) time.Duration

RoundDuration returns a number equal or larger than the amount that exactly is divisible to whole

func SetMapExtraFields

func SetMapExtraFields(in any, values map[string]string, extraFields string)

func Sha1

func Sha1(attrs ...string) string

Sha1 generate the SHA1 hash from any string

func SizeFmt

func SizeFmt(num float64, suffix string) string

formats number in K,M,G, etc.

func SliceHasMember

func SliceHasMember(ss []string, s string) bool

SliceHasMember searches within a *sorted* slice useful to search in shared vars (no slice sort)

func SliceMemberHasPrefix

func SliceMemberHasPrefix(ss []string, prfx string) bool

Iterates over slice members and returns true if one starts with prefix

func SliceStringToIface

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

SliceStringToIface converts slice of strings into a slice of interfaces

func SliceWithoutMember

func SliceWithoutMember(ss []string, s string) []string

func SplitConcatenatedKey

func SplitConcatenatedKey(key string) []string

func SplitPrefix

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

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 StripSlicePrefix

func StripSlicePrefix(slc []string, nrItems int) []string

StripSlicePrefix will strip a number of items from the beginning of the slice

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 TimeIs0h

func TimeIs0h(t time.Time) bool

func TimePointer

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

func ToIJSON

func ToIJSON(v any) string

func ToJSON

func ToJSON(v any) string

func ToMapMapStringInterface

func ToMapMapStringInterface(in any) map[string]any

Converts a struct to map[string]any

func ToMapStringString

func ToMapStringString(in any) map[string]string

Converts a struct to map[string]string

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

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 conversion is being attempted ToDo: add here more fields

func UpdateStructWithStrMap

func UpdateStructWithStrMap(s any, m map[string]string) []string

Update struct with map fields, returns not matching map keys, s is a struct to be updated

func WarnExecTime

func WarnExecTime(startTime time.Time, logID string, maxDur time.Duration)

WarnExecTime is used when we need to meassure the execution of specific functions and warn when the total duration is higher than expected should be usually called with defer, ie: defer WarnExecTime(time.Now(), "MyTestFunc", time.Duration(2*time.Second))

Types

type ActivationInterval

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

func (*ActivationInterval) IsActiveAtTime

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

type ApierTPTiming

type ApierTPTiming struct {
	TPid      string // Tariff plan id
	ID        string // Timing id
	Years     string // semicolon separated list of years this timing is valid on, *any supported
	Months    string // semicolon separated list of months this timing is valid on, *any supported
	MonthDays string // semicolon separated list of month's days this timing is valid on, *any supported
	WeekDays  string // semicolon separated list of week day names this timing is valid on *any supported
	Time      string // String representing the time this timing starts on
}

type ArgDispatcher

type ArgDispatcher struct {
	APIKey  *string
	RouteID *string
}

type ArgRSv1ResourceUsage

type ArgRSv1ResourceUsage struct {
	*CGREvent
	UsageID  string // ResourceUsage Identifier
	UsageTTL *time.Duration
	Units    float64
	*ArgDispatcher
}

type ArgsCache

type ArgsCache struct {
	DestinationIDs        []string
	ReverseDestinationIDs []string
	RatingPlanIDs         []string
	RatingProfileIDs      []string
	ActionIDs             []string
	ActionPlanIDs         []string
	AccountActionPlanIDs  []string
	ActionTriggerIDs      []string
	SharedGroupIDs        []string
	ResourceProfileIDs    []string
	ResourceIDs           []string
	StatsQueueIDs         []string
	StatsQueueProfileIDs  []string
	ThresholdIDs          []string
	ThresholdProfileIDs   []string
	FilterIDs             []string
	SupplierProfileIDs    []string
	AttributeProfileIDs   []string
	ChargerProfileIDs     []string
	DispatcherProfileIDs  []string
	DispatcherHostIDs     []string
	DispatcherRoutesIDs   []string
}

type ArgsComputeFilterIndexIDs

type ArgsComputeFilterIndexIDs struct {
	Tenant        string
	Context       string
	AttributeIDs  []string
	ResourceIDs   []string
	StatIDs       []string
	SupplierIDs   []string
	ThresholdIDs  []string
	ChargerIDs    []string
	DispatcherIDs []string
}

type ArgsComputeFilterIndexes

type ArgsComputeFilterIndexes struct {
	Tenant      string
	Context     string
	AttributeS  bool
	ResourceS   bool
	StatS       bool
	SupplierS   bool
	ThresholdS  bool
	ChargerS    bool
	DispatcherS bool
}

type ArgsGetCacheItem

type ArgsGetCacheItem struct {
	CacheID string
	ItemID  string
}

type ArgsGetCacheItemIDs

type ArgsGetCacheItemIDs struct {
	CacheID      string
	ItemIDPrefix string
}

type ArgsGetCacheItemIDsWithArgDispatcher

type ArgsGetCacheItemIDsWithArgDispatcher struct {
	*ArgDispatcher
	TenantArg
	ArgsGetCacheItemIDs
}

type ArgsGetCacheItemWithArgDispatcher

type ArgsGetCacheItemWithArgDispatcher struct {
	*ArgDispatcher
	TenantArg
	ArgsGetCacheItem
}

type ArgsGetGroup

type ArgsGetGroup struct {
	CacheID string
	GroupID string
}

type ArgsGetGroupWithArgDispatcher

type ArgsGetGroupWithArgDispatcher struct {
	*ArgDispatcher
	TenantArg
	ArgsGetGroup
}

type AttrCacheIDsWithArgDispatcher

type AttrCacheIDsWithArgDispatcher struct {
	*ArgDispatcher
	TenantArg
	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 AttrExecuteAction

type AttrExecuteAction struct {
	Tenant    string
	Account   string
	ActionsId string
}

type AttrExpFileCdrs

type AttrExpFileCdrs struct {
	CdrFormat           *string  // Cdr output file format <CdreCdrFormats>
	FieldSeparator      *string  // Separator used between fields
	ExportId            *string  // Optional exportid
	ExportDir           *string  // If provided it overwrites the configured export directory
	ExportFileName      *string  // If provided the output filename will be set to this
	ExportTemplate      *string  // Exported fields template  <""|fld1,fld2|*xml:instance_name>
	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
	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
	SuppressCgrIds      bool     // Disable CgrIds reporting in reply/ExportedCgrIds and reply/UnexportedCgrIds
	Paginator
}

func (*AttrExpFileCdrs) AsCDRsFilter

func (aefc *AttrExpFileCdrs) AsCDRsFilter(timezone string) (*CDRsFilter, error)

type AttrGetAccount

type AttrGetAccount struct {
	Tenant  string
	Account string
}

type AttrGetAccounts

type AttrGetAccounts struct {
	Tenant     string
	AccountIDs []string
	Offset     int // Set the item offset
	Limit      int // Limit number of items retrieved
	Filter     map[string]bool
}

type AttrGetCallCost

type AttrGetCallCost struct {
	CgrId string // Unique id of the CDR
	RunId string // Run Id
}

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
}

func (*AttrGetCdrs) AsCDRsFilter

func (fltr *AttrGetCdrs) AsCDRsFilter(timezone string) (cdrFltr *CDRsFilter, err error)

type AttrGetRatingProfile

type AttrGetRatingProfile struct {
	Tenant   string // Tenant's Id
	Category string // TypeOfRecord
	Subject  string // Rating subject, usually the same as account
}

func (*AttrGetRatingProfile) GetID

func (self *AttrGetRatingProfile) GetID() string

type AttrImportTPFromFolder

type AttrImportTPFromFolder struct {
	TPid          string
	FolderPath    string
	RunId         string
	CsvSeparator  string
	ArgDispatcher *ArgDispatcher
}

type AttrLoadTpFromFolder

type AttrLoadTpFromFolder struct {
	FolderPath    string // Take files from folder absolute path
	DryRun        bool   // Do not write to database but parse only
	Validate      bool   // Run structural checks on data
	Recursive     bool   // load data recursive
	ArgDispatcher *ArgDispatcher
	Caching       *string
}

type AttrReloadCache

type AttrReloadCache struct {
	ArgsCache
	FlushAll bool // If provided, cache flush will be executed before any action
}

Data used to do remote cache reloads via api

func InitAttrReloadCache

func InitAttrReloadCache() (rpl AttrReloadCache)

InitAttrReloadCache initialize AttrReloadCache with empty string slice

type AttrReloadCacheWithArgDispatcher

type AttrReloadCacheWithArgDispatcher struct {
	*ArgDispatcher
	TenantArg
	AttrReloadCache
}

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 AttrRemoveAccount

type AttrRemoveAccount struct {
	Tenant          string
	Account         string
	ReloadScheduler bool
}

type AttrSetAccount

type AttrSetAccount struct {
	Tenant           string
	Account          string
	ActionPlanID     string
	ActionTriggersID string
	ExtraOptions     map[string]bool
	ReloadScheduler  bool
}

type AttrSetActions

type AttrSetActions struct {
	ActionsId string      // Actions id
	Overwrite bool        // If previously defined, will be overwritten
	Actions   []*TPAction // Set of actions this Actions profile will perform
}

type AttrSetBalance

type AttrSetBalance struct {
	Tenant          string
	Account         string
	BalanceType     string
	Value           float64
	Balance         map[string]any
	ActionExtraData *map[string]any
	Cdrlog          bool
}

type AttrSetDestination

type AttrSetDestination struct {
	Id        string
	Prefixes  []string
	Overwrite bool
}

type AttrSetRatingProfile

type AttrSetRatingProfile struct {
	Tenant                string                // Tenant's Id
	Category              string                // TypeOfRecord
	Subject               string                // Rating subject, usually the same as account
	Overwrite             bool                  // Overwrite if exists
	RatingPlanActivations []*TPRatingActivation // Activate rating plans at specific time
	Cache                 *string
}

type AttrTPRatingProfileIds

type AttrTPRatingProfileIds struct {
	TPid     string // Tariff plan id
	Tenant   string // Tenant's Id
	Category string // TypeOfRecord
	Subject  string // Rating subject, usually the same as account
}

type BiRPCClient

type BiRPCClient interface {
	Call(*context.Context, string, any, any) error // So we can use it also as birpc.ClientConnector
	ID() string
}

type BiRPCInternalClient

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

Need separate client from the original RpcClientConnection since diretly passing the server is not enough without passing the client's reference

func NewBiRPCInternalClient

func NewBiRPCInternalClient(serverConn BiRPCServer) *BiRPCInternalClient

func (*BiRPCInternalClient) Call

func (clnt *BiRPCInternalClient) Call(ctx *context.Context, serviceMethod string, args any, reply any) error

Part of birpc.ClientConnector interface

func (*BiRPCInternalClient) SetClientConn

func (clnt *BiRPCInternalClient) SetClientConn(clntConn birpc.ClientConnector)

Used in case when clientConn is not available at init time (eg: SMGAsterisk who needs the biRPCConn at initialization)

type BiRPCServer

type BiRPCServer interface {
	Call(*context.Context, string, any, any) error // So we can use it also as birpc.ClientConnector
	CallBiRPC(birpc.ClientConnector, string, any, any) error
}

Interface which the server needs to work as BiRPCServer

type CDRsFilter

type CDRsFilter 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
	OrderIDStart           *int64            // Export from this order identifier
	OrderIDEnd             *int64            // Export smaller than this order identifier
	SetupTimeStart         *time.Time        // Start of interval, bigger or equal than configured
	SetupTimeEnd           *time.Time        // End interval, smaller than setupTime
	AnswerTimeStart        *time.Time        // Start of interval, bigger or equal than configured
	AnswerTimeEnd          *time.Time        // End interval, smaller than answerTime
	CreatedAtStart         *time.Time        // Start of interval, bigger or equal than configured
	CreatedAtEnd           *time.Time        // End interval, smaller than
	UpdatedAtStart         *time.Time        // Start of interval, bigger or equal than configured
	UpdatedAtEnd           *time.Time        // End interval, smaller than
	MinUsage               string            // Start of the usage interval (>=)
	MaxUsage               string            // End of the usage interval (<)
	MinCost                *float64          // Start of the cost interval (>=)
	MaxCost                *float64          // End of the usage interval (<)
	Unscoped               bool              // Include soft-deleted records in results
	Count                  bool              // If true count the items instead of returning data
	OrderBy                string            // Can be ordered by OrderID,AnswerTime,SetupTime,Cost,Usage
	Paginator
}

CDRsFilter is a filter used to get records out of storDB

func (*CDRsFilter) Prepare added in v0.10.2

func (fltr *CDRsFilter) Prepare()

Prepare will sort all the slices in order to search more faster

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
	Time   *time.Time // event time
	Event  map[string]any
}

CGREvent is a generic event processed by CGR services

func (*CGREvent) CheckMandatoryFields

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

func (*CGREvent) Clone

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

func (*CGREvent) ExtractArgs

func (ev *CGREvent) ExtractArgs(dispatcherFlag, consumeSupplierPaginator bool) (ca ExtractedArgs)

ExtractArgs extracts the ArgDispatcher and SupplierPaginator from the received event

func (*CGREvent) FieldAsDuration

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

FieldAsDuration returns a field as Duration instance

func (*CGREvent) FieldAsFloat64

func (ev *CGREvent) FieldAsFloat64(fldName string) (f float64, err error)

FieldAsFloat64 returns a field as float64 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) TenantID

func (ev *CGREvent) TenantID() string

type CGREventWithArgDispatcher

type CGREventWithArgDispatcher struct {
	*CGREvent
	*ArgDispatcher
}

func NewCGREventWithArgDispatcher

func NewCGREventWithArgDispatcher() *CGREventWithArgDispatcher

func (*CGREventWithArgDispatcher) Clone

type CGREvents

type CGREvents struct {
	Tenant string
	ID     string
	Time   *time.Time // event time
	Events []map[string]any
}

CGREvents is a group of generic events processed by CGR services ie: derived CDRs

type CacheFileInfo

type CacheFileInfo struct {
	Encoding string
	LoadInfo *LoadInstance
}

type CacheKeys

type CacheKeys struct {
}

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 NewCgrIORecordWriter

func NewCgrIORecordWriter(w io.Writer) *CgrIORecordWriter

NewCgrIORecordWriter 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 CgrRecordWriter

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

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

type ConcReqs added in v0.10.2

type ConcReqs struct {
	// contains filtered or unexported fields
}
var ConReqs *ConcReqs

func NewConReqs added in v0.10.2

func NewConReqs(reqs int, strategy string) *ConcReqs

func (*ConcReqs) Allocate added in v0.10.2

func (cR *ConcReqs) Allocate() (err error)

func (*ConcReqs) Deallocate added in v0.10.2

func (cR *ConcReqs) Deallocate()

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 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 NewRoundConverter

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

type DataConverters

type DataConverters []DataConverter

DataConverters groups together multiple converters, executing optimized conversions

func (DataConverters) ConvertString

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

ConvertString converts from and to string

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
	RemoteHost() net.Addr
}

DataProvider is a data source from multiple formats

type DestinationRate

type DestinationRate struct {
	DestinationId    string // The destination identity
	RateId           string // The rate identity
	Rate             *TPRate
	RoundingMethod   string
	RoundingDecimals int
	MaxCost          float64
	MaxCostStrategy  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 {
	DurationTime time.Duration
}

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 ExportedFileCdrs

type ExportedFileCdrs struct {
	ExportedFilePath          string            // Full path to the newly generated export file
	TotalRecords              int               // Number of CDRs to be exported
	TotalCost                 float64           // Sum of all costs in exported CDRs
	FirstOrderId, LastOrderId int64             // The order id of the last exported CDR
	ExportedCgrIds            []string          // List of successfully exported cgrids in the file
	UnexportedCgrIds          map[string]string // Map of errored CDRs, map key is cgrid, value will be the error string
}

type ExportedTPStats

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

type ExtractedArgs

type ExtractedArgs struct {
	ArgDispatcher     *ArgDispatcher
	SupplierPaginator *Paginator
}

ExtractedArgs stores the extracted arguments from CGREvent

type FieldMultiplyFactor

type FieldMultiplyFactor map[string]float64

FieldMultiplyFactor defines multiply factors for different field values original defined for CDRE component

func (FieldMultiplyFactor) Clone

func (fmp FieldMultiplyFactor) Clone() (cln FieldMultiplyFactor)

type FlagsWithParams

type FlagsWithParams map[string][]string

FlagsWithParams should store a list of profiles for each subsystem

func FlagsWithParamsFromSlice

func FlagsWithParamsFromSlice(s []string) (FlagsWithParams, error)

FlagsWithParamsFromSlice construct a FlagsWithParams from the given slice

func (FlagsWithParams) GetBool

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

GetBool returns the flag as boolean

func (FlagsWithParams) HasKey

func (fWp FlagsWithParams) HasKey(key string) (has bool)

HasKey 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 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 FullPath added in v0.10.1

type FullPath struct {
	PathItems PathItems
	Path      string
}

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

type GetCostOnRatingPlansArgs added in v0.10.3

type GetCostOnRatingPlansArgs struct {
	Account       string
	Subject       string
	Destination   string
	Tenant        string
	SetupTime     time.Time
	Usage         time.Duration
	RatingPlanIDs []string
	*ArgDispatcher
}

type GetFilterIndexesArg

type GetFilterIndexesArg struct {
	CacheID      string
	ItemIDPrefix string
	FilterType   string
	FldNameVal   map[string]string
}

type GetMaxSessionTimeOnAccountsArgs added in v0.10.3

type GetMaxSessionTimeOnAccountsArgs struct {
	Subject     string
	Destination string
	Tenant      string
	SetupTime   time.Time
	Usage       time.Duration
	AccountIDs  []string
	*ArgDispatcher
}

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 (h HierarchyPath) AsString(sep string, prefix bool) string

type IP2HexConverter added in v0.10.2

type IP2HexConverter struct{}

HexConvertor will round floats

func (*IP2HexConverter) Convert added in v0.10.2

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

type Int64Slice

type Int64Slice []int64

Sortable Int64Slice

func (Int64Slice) Len

func (slc Int64Slice) Len() int

func (Int64Slice) Less

func (slc Int64Slice) Less(i, j int) bool

func (Int64Slice) Swap

func (slc Int64Slice) Swap(i, j int)

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 {
	SetSyslog(log *syslog.Writer)
	SetLogLevel(level int)
	GetSyslog() *syslog.Writer
	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 (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(nesteed bool) (keys []string)

GetKeys returns all the keys from map

func (MapStorage) RemoteHost added in v0.10.2

func (ms MapStorage) RemoteHost() net.Addr

RemoteHost is part of dataStorage interface

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 MatchFilterIndexArg

type MatchFilterIndexArg struct {
	CacheID      string
	ItemIDPrefix string
	FilterType   string
	FieldName    string
	FieldVal     string
}

type MethodParameters

type MethodParameters struct {
	Method     string
	Parameters any
}

type MetricWithFilters

type MetricWithFilters struct {
	FilterIDs []string
	MetricID  string
}

MetricWithFilters is used in TPStatProfile

type MonthDays

type MonthDays []int

Defines month days series

func (MonthDays) Contains

func (md MonthDays) Contains(monthDay int) (result bool)

Return true if the specified date is inside the series

func (MonthDays) Equals

func (md MonthDays) Equals(oMD MonthDays) bool

Equals implies that MonthDays are already sorted

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) Serialize

func (md MonthDays) Serialize(sep string) string

Dumps the month days in a serialized string, similar to the one parsed

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) Contains

func (m Months) Contains(month time.Month) (result bool)

Return true if the specified date is inside the series

func (Months) Equals

func (m Months) Equals(oM Months) bool

Equals implies that Months are already sorted

func (Months) IsComplete

func (m Months) IsComplete() bool

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) Serialize

func (m Months) Serialize(sep string) string

Dumps the months in a serialized string, similar to the one parsed

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 NMData added in v0.10.1

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

NMData most basic NM structure

func NewNMData added in v0.10.1

func NewNMData(val any) *NMData

NewNMData returns the interface wraped in NMInterface struture

func (*NMData) Empty added in v0.10.1

func (nmi *NMData) Empty() bool

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

func (*NMData) Field added in v0.10.1

func (nmi *NMData) Field(path PathItems) (val NMInterface, err error)

Field is not implemented only used in order to implement the NM interface

func (*NMData) Interface added in v0.10.1

func (nmi *NMData) Interface() any

Interface returns the wraped interface

func (*NMData) Len added in v0.10.1

func (nmi *NMData) Len() int

Len is not implemented only used in order to implement the NM interface

func (*NMData) Remove added in v0.10.1

func (nmi *NMData) Remove(path PathItems) (err error)

Remove is not implemented only used in order to implement the NM interface

func (*NMData) Set added in v0.10.1

func (nmi *NMData) Set(path PathItems, val NMInterface) (addedNew bool, err error)

Set sets the wraped interface when the path is empty This behaivior is in order to modify the wraped interface witout aserting the type of the NMInterface

func (*NMData) String added in v0.10.1

func (nmi *NMData) String() string

func (*NMData) Type added in v0.10.1

func (nmi *NMData) Type() NMType

Type returns the type of the NM interface

type NMInterface added in v0.10.1

type NMInterface interface {
	String() string
	Interface() any
	Field(path PathItems) (val NMInterface, err error)
	Set(path PathItems, val NMInterface) (addedNew bool, err error)
	Remove(path PathItems) (err error)
	Type() NMType
	Empty() bool
	Len() int
}

NMInterface the basic interface

type NMSlice added in v0.10.1

type NMSlice []NMInterface

NMSlice is the basic slice of NM interface

func (NMSlice) Empty added in v0.10.1

func (nms NMSlice) Empty() bool

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

func (*NMSlice) Field added in v0.10.1

func (nms *NMSlice) Field(path PathItems) (val NMInterface, err error)

Field returns the item on the given path for NMSlice only the Index field is considered

func (*NMSlice) Interface added in v0.10.1

func (nms *NMSlice) Interface() any

Interface returns itself

func (*NMSlice) Len added in v0.10.1

func (nms *NMSlice) Len() int

Len returns the length of the slice

func (*NMSlice) Remove added in v0.10.1

func (nms *NMSlice) Remove(path PathItems) (err error)

Remove removes the item for the given index

func (*NMSlice) Set added in v0.10.1

func (nms *NMSlice) Set(path PathItems, val NMInterface) (addedNew bool, err error)

Set sets the value for the given index

func (*NMSlice) String added in v0.10.1

func (nms *NMSlice) String() (out string)

func (NMSlice) Type added in v0.10.1

func (nms NMSlice) Type() NMType

Type returns the type of the NM slice

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 NavigableMap2 map[string]NMInterface

NavigableMap2 is the basic map of NM interface

func (nm NavigableMap2) Empty() bool

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

func (nm NavigableMap2) Field(path PathItems) (val NMInterface, err error)

Field returns the item on the given path

func (nm NavigableMap2) FieldAsInterface(fldPath []string) (str any, err error)

FieldAsInterface returns the interface at the path Is used by AgentRequest FieldAsInterface

func (nm NavigableMap2) FieldAsString(fldPath []string) (str string, err error)

FieldAsString returns the string at the path Used only to implement the DataProvider interface

func (nm NavigableMap2) Interface() any

Interface returns itself

func (nm NavigableMap2) Len() int

Len returns the length of the map

func (NavigableMap2) RemoteHost() net.Addr

RemoteHost is part of dataStorage interface

func (nm NavigableMap2) Remove(path PathItems) (err error)

Remove removes the item for the given path

func (nm NavigableMap2) Set(path PathItems, val NMInterface) (added bool, err error)

Set sets the value for the given path

func (nm NavigableMap2) String() (out string)
func (nm NavigableMap2) Type() NMType

Type returns the type of the NM map

type NavigableMapper interface {
	AsNavigableMap() NavigableMap2
}

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 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]) 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]) 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 NavigableMap2 but keeps the order of fields

func NewOrderedNavigableMap added in v0.10.1

func NewOrderedNavigableMap() *OrderedNavigableMap

NewOrderedNavigableMap initializates a structure of OrderedNavigableMap with a NavigableMap2

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 PathItems) (val NMInterface, err error)

Field returns the item on the given path

func (*OrderedNavigableMap) FieldAsInterface added in v0.10.1

func (onm *OrderedNavigableMap) FieldAsInterface(fldPath []string) (str 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 thevalue 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 []PathItems)

GetOrder returns the elements order as a slice use this only for testing

func (*OrderedNavigableMap) Interface added in v0.10.1

func (onm *OrderedNavigableMap) Interface() any

Interface returns navigble map that's inside

func (OrderedNavigableMap) Len added in v0.10.1

func (onm OrderedNavigableMap) Len() int

Len returns the length of the map

func (OrderedNavigableMap) RemoteHost added in v0.10.1

func (OrderedNavigableMap) RemoteHost() net.Addr

RemoteHost is part of dataStorage interface

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 NMInterface) (addedNew bool, 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

func (*OrderedNavigableMap) String added in v0.10.1

func (onm *OrderedNavigableMap) String() string

String returns the map as json string

func (*OrderedNavigableMap) Type added in v0.10.1

func (onm *OrderedNavigableMap) Type() NMType

Type returns the type of the NM map

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)

}

Paginate stuff around items returned

func (*Paginator) PaginateStringSlice

func (pgnt *Paginator) PaginateStringSlice(in []string) (out []string)

type PaginatorWithSearch

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

type PathItem added in v0.10.1

type PathItem struct {
	Field string
	Index *int
}

PathItem used by the NM interface to store the path information

func (PathItem) Clone added in v0.10.1

func (p PathItem) Clone() (c PathItem)

Clone creates a copy

func (PathItem) Equal added in v0.10.1

func (p PathItem) Equal(p2 PathItem) bool

Equal returns true if p==p2

func (PathItem) String added in v0.10.1

func (p PathItem) String() (out string)

type PathItemElement added in v0.10.1

type PathItemElement struct {

	// The value stored with this element.
	Value PathItems
	// 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 PathItems, 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 PathItems, 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 PathItems) *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 PathItems) *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) PathItems

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 PathItems added in v0.10.1

type PathItems []PathItem

PathItems a list of PathItem used to describe the path to an item from a NavigableMap

func NewPathItems added in v0.10.2

func NewPathItems(path []string) (pItms PathItems)

NewPathItems returns the computed PathItems out of slice one

func (PathItems) Clone added in v0.10.1

func (path PathItems) Clone() (c PathItems)

Clone creates a copy

func (PathItems) String added in v0.10.1

func (path PathItems) String() (out string)

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

func (*RPCCDRsFilter) AsCDRsFilter

func (fltr *RPCCDRsFilter) AsCDRsFilter(timezone string) (cdrFltr *CDRsFilter, err error)

type RPCCDRsFilterWithArgDispatcher

type RPCCDRsFilterWithArgDispatcher struct {
	*RPCCDRsFilter
	*ArgDispatcher
	*TenantArg
}

type RSRField

type RSRField struct {
	Id    string // Identifier
	Rules string // Rules container holding the string rules to be able to restore it after DB

	RSRules []*ReSearchReplace // Rules to use when processing field value
	// contains filtered or unexported fields
}

func NewRSRField

func NewRSRField(fldStr string) (fld *RSRField, err error)

func NewRSRFieldMustCompile

func NewRSRFieldMustCompile(fldStr string) (rsrFld *RSRField)

func (*RSRField) Compile

func (rsrf *RSRField) Compile() error

Compile parses Rules string and repopulates other fields

func (*RSRField) IsCompiled

func (rsrf *RSRField) IsCompiled() bool

IsCompiled finds out whether this RSRField was already parsed or RAW state

func (*RSRField) IsStatic

func (rsrf *RSRField) IsStatic() bool

IsStatic detects if a RSRField is a static value

func (*RSRField) Parse

func (rsrf *RSRField) Parse(value any) (out string, err error)

Parse will parse the value out considering converters and filters

func (*RSRField) RegexpMatched

func (rsrf *RSRField) RegexpMatched() bool

RegexpMatched will investigate whether we had a regexp match through the rules

type RSRFields

type RSRFields []*RSRField

func ParseRSRFields

func ParseRSRFields(fldsStr, sep string) (RSRFields, error)

Parses list of RSRFields, used for example as multiple filters in derived charging

func ParseRSRFieldsFromSlice

func ParseRSRFieldsFromSlice(flds []string) (RSRFields, error)

func ParseRSRFieldsMustCompile

func ParseRSRFieldsMustCompile(fldsStr, sep string) RSRFields

func (RSRFields) Compile

func (flds RSRFields) Compile() (err error)

func (RSRFields) Id

func (flds RSRFields) Id() string

Return first Id of the rsrFields, used in cdre

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) 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 RateSlot

type RateSlot struct {
	ConnectFee         float64 // ConnectFee applied once the call is answered
	Rate               float64 // Rate applied
	RateUnit           string  //  Number of billing units this rate applies to
	RateIncrement      string  // This rate will apply in increments of duration
	GroupIntervalStart string  // Group position
	// contains filtered or unexported fields
}

func NewRateSlot

func NewRateSlot(connectFee, rate float64, rateUnit, rateIncrement, grpInterval string) (*RateSlot, error)

Needed so we make sure we always use SetDurations() on a newly created value

func (*RateSlot) GroupIntervalStartDuration

func (rs *RateSlot) GroupIntervalStartDuration() time.Duration

func (*RateSlot) RateIncrementDuration

func (rs *RateSlot) RateIncrementDuration() time.Duration

func (*RateSlot) RateUnitDuration

func (rs *RateSlot) RateUnitDuration() time.Duration

func (*RateSlot) SetDurations

func (rs *RateSlot) SetDurations() error

Used to set the durations we need out of strings

type RatingPlanCostArg

type RatingPlanCostArg struct {
	RatingPlanIDs []string
	Destination   string
	SetupTime     string
	Usage         string
	*ArgDispatcher
}

type ReSearchReplace

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

Regexp Search/Replace, used for example for field formatting

func (*ReSearchReplace) Process

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

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 RpcParams

type RpcParams struct {
	Object   any
	InParam  any
	OutParam any
}

func GetRpcParams

func GetRpcParams(method string) (*RpcParams, error)

type SMCostFilter

type SMCostFilter struct {
	CGRIDs         []string
	NotCGRIDs      []string
	RunIDs         []string
	NotRunIDs      []string
	OriginHosts    []string
	NotOriginHosts []string
	OriginIDs      []string
	NotOriginIDs   []string
	CostSources    []string
	NotCostSources []string
	Usage          UsageInterval
	CreatedAt      TimeInterval
}

func AppendToSMCostFilter

func AppendToSMCostFilter(smcFilter *SMCostFilter, fieldType, fieldName string,
	values []string, timezone string) (smcf *SMCostFilter, err error)

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewServer

func NewServer() (s *Server)

func (*Server) BiRPCRegisterName

func (s *Server) BiRPCRegisterName(name string, rcv any)

Registers a new BiJsonRpc name

func (*Server) BiRPCUnregisterName added in v0.10.3

func (s *Server) BiRPCUnregisterName(name string)

func (*Server) RegisterHttpFunc

func (s *Server) RegisterHttpFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

func (*Server) RegisterHttpHandler

func (s *Server) RegisterHttpHandler(pattern string, handler http.Handler)

func (*Server) RegisterProfiler

func (s *Server) RegisterProfiler(addr string)

func (*Server) RpcRegister

func (s *Server) RpcRegister(rcvr any)

func (*Server) RpcRegisterName

func (s *Server) RpcRegisterName(name string, rcvr any)

func (*Server) ServeBiJSON

func (s *Server) ServeBiJSON(addr string, onConn, onDis func(birpc.ClientConnector)) (err error)

ServeBiJSON create a gorutine to listen and serve as BiRPC server

func (*Server) ServeGOB

func (s *Server) ServeGOB(addr string, exitChan chan bool)

func (*Server) ServeGOBTLS

func (s *Server) ServeGOBTLS(addr, serverCrt, serverKey, caCert string,
	serverPolicy int, serverName string, exitChan chan bool)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(addr string, jsonRPCURL string, wsRPCURL string,
	useBasicAuth bool, userList map[string]string, exitChan chan bool)

func (*Server) ServeHTTPTLS

func (s *Server) ServeHTTPTLS(addr, serverCrt, serverKey, caCert string, serverPolicy int,
	serverName string, jsonRPCURL string, wsRPCURL string,
	useBasicAuth bool, userList map[string]string, exitChan chan bool)

func (*Server) ServeJSON

func (s *Server) ServeJSON(addr string, exitChan chan bool)

func (*Server) ServeJSONTLS

func (s *Server) ServeJSONTLS(addr, serverCrt, serverKey, caCert string,
	serverPolicy int, serverName string, exitChan chan bool)

func (*Server) SetDispatched

func (s *Server) SetDispatched()

func (*Server) StopBiRPC

func (s *Server) StopBiRPC()

StopBiRPC stops the go rutine create with ServeBiJSON

type SessionFilter

type SessionFilter struct {
	Limit   *int
	Filters []string
	Tenant  string
	*ArgDispatcher
}

type SetFilterIndexesArg

type SetFilterIndexesArg struct {
	CacheID      string
	ItemIDPrefix string
	Indexes      map[string]StringMap
}

type StdLogger

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

Logs to standard output

func (*StdLogger) Alert

func (sl *StdLogger) Alert(m string) (err error)

Alert logs to syslog 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 syslog with critical level

func (*StdLogger) Debug

func (sl *StdLogger) Debug(m string) (err error)

Debug logs to syslog with debug level

func (*StdLogger) Emerg

func (sl *StdLogger) Emerg(m string) (err error)

Emerg logs to syslog with emergency level

func (*StdLogger) Err

func (sl *StdLogger) Err(m string) (err error)

Err logs to syslog with error level

func (*StdLogger) GetSyslog

func (sl *StdLogger) GetSyslog() *syslog.Writer

GetSyslog returns the logger for the server

func (*StdLogger) Info

func (sl *StdLogger) Info(m string) (err error)

Info logs to syslog with info level

func (*StdLogger) Notice

func (sl *StdLogger) Notice(m string) (err error)

Notice logs to syslog with notice level

func (*StdLogger) SetLogLevel

func (sl *StdLogger) SetLogLevel(level int)

SetLogLevel changes the log level

func (*StdLogger) SetSyslog

func (sl *StdLogger) SetSyslog(l *syslog.Writer)

SetSyslog sets the logger for the server

func (*StdLogger) Warning

func (sl *StdLogger) Warning(m string) (err error)

Warning logs to syslog 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 StringMap

type StringMap map[string]bool

func NewStringMap

func NewStringMap(s ...string) StringMap

func ParseStringMap

func ParseStringMap(s string) StringMap

func StringMapFromSlice

func StringMapFromSlice(s []string) StringMap

func StringMapPointer

func StringMapPointer(sm StringMap) *StringMap

func (StringMap) Clone

func (sm StringMap) Clone() StringMap

func (StringMap) Copy

func (sm StringMap) Copy(o StringMap)

func (StringMap) Equal

func (sm StringMap) Equal(om StringMap) bool

func (StringMap) GetOne

func (sm StringMap) GetOne() string

func (StringMap) HasKey

func (sm StringMap) HasKey(key string) (has bool)

func (StringMap) Includes

func (sm StringMap) Includes(om StringMap) bool

func (StringMap) IsEmpty

func (sm StringMap) IsEmpty() bool

func (StringMap) Join

func (sm StringMap) Join(mps ...StringMap)

func (StringMap) Slice

func (sm StringMap) Slice() []string

func (StringMap) String

func (sm StringMap) String() string

type StringSet

type StringSet map[string]struct{}

StringSet will manage data within a set

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) 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

type TPAccountActions

type TPAccountActions struct {
	TPid             string // Tariff plan id
	LoadId           string // LoadId, used to group actions on a load
	Tenant           string // Tenant's Id
	Account          string // Account name
	ActionPlanId     string // Id of ActionPlan profile to use
	ActionTriggersId string // Id of ActionTriggers profile to use
	AllowNegative    bool
	Disabled         bool
}

func (*TPAccountActions) GetId

func (aa *TPAccountActions) GetId() string

func (*TPAccountActions) KeyId

func (aa *TPAccountActions) KeyId() string

Returns the id used in some nosql dbs (eg: redis)

func (*TPAccountActions) SetAccountActionsId

func (aa *TPAccountActions) SetAccountActionsId(id string) error

type TPAction

type TPAction struct {
	Identifier      string // Identifier mapped in the code
	BalanceId       string // Balance identification string (account scope)
	BalanceUuid     string // Balance identification string (global scope)
	BalanceType     string // Type of balance the action will operate on
	Units           string // Number of units to add/deduct
	ExpiryTime      string // Time when the units will expire
	Filter          string // The condition on balances that is checked before the action
	TimingTags      string // Timing when balance is active
	DestinationIds  string // Destination profile id
	RatingSubject   string // Reference a rate subject defined in RatingProfiles
	Categories      string // category filter for balances
	SharedGroups    string // Reference to a shared group
	BalanceWeight   string // Balance weight
	ExtraParameters string
	BalanceBlocker  string
	BalanceDisabled string
	Weight          float64 // Action's weight
}

type TPActionPlan

type TPActionPlan struct {
	TPid       string            // Tariff plan id
	ID         string            // ActionPlan id
	ActionPlan []*TPActionTiming // Set of ActionTiming bindings this profile will group
}

type TPActionTiming

type TPActionTiming struct {
	ActionsId string  // Actions id
	TimingId  string  // Timing profile id
	Weight    float64 // Binding's weight
}

type TPActionTrigger

type TPActionTrigger struct {
	Id                    string  // group id
	UniqueID              string  // individual id
	ThresholdType         string  // This threshold type
	ThresholdValue        float64 // Threshold
	Recurrent             bool    // reset executed flag each run
	MinSleep              string  // Minimum duration between two executions in case of recurrent triggers
	ExpirationDate        string  // Trigger expiration
	ActivationDate        string  // Trigger activation
	BalanceId             string  // The id of the balance in the account
	BalanceType           string  // Type of balance this trigger monitors
	BalanceDestinationIds string  // filter for balance
	BalanceWeight         string  // filter for balance
	BalanceExpirationDate string  // filter for balance
	BalanceTimingTags     string  // filter for balance
	BalanceRatingSubject  string  // filter for balance
	BalanceCategories     string  // filter for balance
	BalanceSharedGroups   string  // filter for balance
	BalanceBlocker        string  // filter for balance
	BalanceDisabled       string  // filter for balance
	ActionsId             string  // Actions which will execute on threshold reached
	Weight                float64 // weight
}

type TPActionTriggers

type TPActionTriggers struct {
	TPid           string             // Tariff plan id
	ID             string             // action trigger id
	ActionTriggers []*TPActionTrigger // Set of triggers grouped in this profile
}

type TPActions

type TPActions struct {
	TPid    string      // Tariff plan id
	ID      string      // Actions id
	Actions []*TPAction // Set of actions this Actions profile will perform
}

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
	Path      string
	Type      string
	Value     string
}

TPAttribute is used in TPAttributeProfile

type TPAttributeProfile

type TPAttributeProfile struct {
	TPid               string
	Tenant             string
	ID                 string
	FilterIDs          []string
	ActivationInterval *TPActivationInterval // Time when this limit becomes active and expires
	Contexts           []string              // bind this TPAttribute to multiple context
	Attributes         []*TPAttribute
	Blocker            bool
	Weight             float64
}

TPAttributeProfile is used in APIs to manage remotely offline AttributeProfile

type TPChargerProfile

type TPChargerProfile struct {
	TPid               string
	Tenant             string
	ID                 string
	FilterIDs          []string
	ActivationInterval *TPActivationInterval // Time when this limit becomes active and expires
	RunID              string
	AttributeIDs       []string
	Weight             float64
}

TPChargerProfile is used in APIs to manage remotely offline ChargerProfile

type TPDestination

type TPDestination struct {
	TPid     string   // Tariff plan id
	ID       string   // Destination id
	Prefixes []string // Prefixes attached to this destination
}

TPDestination represents one destination in storDB

type TPDestinationRate

type TPDestinationRate struct {
	TPid             string             // Tariff plan id
	ID               string             // DestinationRate profile id
	DestinationRates []*DestinationRate // Set of destinationid-rateid bindings
}

type TPDispatcherHost

type TPDispatcherHost struct {
	TPid   string
	Tenant string
	ID     string
	Conns  []*TPDispatcherHostConn
}

TPDispatcherHost is used in APIs to manage remotely offline DispatcherHost

type TPDispatcherHostConn

type TPDispatcherHostConn struct {
	Address   string
	Transport string
	TLS       bool
}

TPDispatcherHostConn is used in TPDispatcherHost

type TPDispatcherHostProfile

type TPDispatcherHostProfile struct {
	ID        string
	FilterIDs []string
	Weight    float64 // applied in case of multiple connections need to be ordered
	Params    []any   // additional parameters stored for a session
	Blocker   bool    // no connection after this one
}

TPDispatcherHostProfile is used in TPDispatcherProfile

type TPDispatcherProfile

type TPDispatcherProfile struct {
	TPid               string
	Tenant             string
	ID                 string
	Subsystems         []string
	FilterIDs          []string
	ActivationInterval *TPActivationInterval // Time when this limit becomes active and expires
	Strategy           string
	StrategyParams     []any // ie for distribution, set here the pool weights
	Weight             float64
	Hosts              []*TPDispatcherHostProfile
}

TPDispatcherProfile is used in APIs to manage remotely offline DispatcherProfile

type TPDistinctIds

type TPDistinctIds []string

Used to extract ids from stordb

func (TPDistinctIds) String

func (tpdi TPDistinctIds) String() string

type TPFilter

type TPFilter struct {
	Type    string   // Filter type (*string, *timing, *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
	ActivationInterval *TPActivationInterval // Time when this limit becomes active and expires
}

TPFilterProfile is used in APIs to manage remotely offline FilterProfile

type TPRate

type TPRate struct {
	TPid      string      // Tariff plan id
	ID        string      // Rate id
	RateSlots []*RateSlot // One or more RateSlots
}

type TPRatingActivation

type TPRatingActivation struct {
	ActivationTime   string // Time when this profile will become active, defined as unix epoch time
	RatingPlanId     string // Id of RatingPlan profile
	FallbackSubjects string // So we follow the api
}

type TPRatingPlan

type TPRatingPlan struct {
	TPid               string                 // Tariff plan id
	ID                 string                 // RatingPlan profile id
	RatingPlanBindings []*TPRatingPlanBinding // Set of destinationid-rateid bindings
}

type TPRatingPlanBinding

type TPRatingPlanBinding struct {
	DestinationRatesId string  // The DestinationRate identity
	TimingId           string  // The timing identity
	Weight             float64 // Binding priority taken into consideration when more DestinationRates are active on a time slot
	// contains filtered or unexported fields
}

func (*TPRatingPlanBinding) SetTiming

func (self *TPRatingPlanBinding) SetTiming(tm *TPTiming)

func (*TPRatingPlanBinding) Timing

func (self *TPRatingPlanBinding) Timing() *TPTiming

type TPRatingProfile

type TPRatingProfile struct {
	TPid                  string                // Tariff plan id
	LoadId                string                // Gives ability to load specific RatingProfile based on load identifier, hence being able to keep history also in stordb
	Tenant                string                // Tenant's Id
	Category              string                // TypeOfRecord
	Subject               string                // Rating subject, usually the same as account
	RatingPlanActivations []*TPRatingActivation // Activate rate profiles at specific time
}

func (*TPRatingProfile) GetId

func (rpf *TPRatingProfile) GetId() string

func (*TPRatingProfile) KeyId

func (rpf *TPRatingProfile) KeyId() string

Used as key in nosql db (eg: redis)

func (*TPRatingProfile) SetRatingProfileID added in v0.10.1

func (rpf *TPRatingProfile) SetRatingProfileID(id string) error

type TPResourceProfile

type TPResourceProfile struct {
	TPid               string
	Tenant             string
	ID                 string // Identifier of this limit
	FilterIDs          []string
	ActivationInterval *TPActivationInterval // Time when this limit becomes active/expires
	UsageTTL           string
	Limit              string // Limit value
	AllocationMessage  string
	Blocker            bool // blocker flag to stop processing on filters matched
	Stored             bool
	Weight             float64  // Weight to sort the ResourceLimits
	ThresholdIDs       []string // Thresholds to check after changing Limit
}

TPResourceProfile is used in APIs to manage remotely offline ResourceProfile

type TPSharedGroup

type TPSharedGroup struct {
	Account       string
	Strategy      string
	RatingSubject string
}

type TPSharedGroups

type TPSharedGroups struct {
	TPid         string
	ID           string
	SharedGroups []*TPSharedGroup
}

type TPStatProfile

type TPStatProfile struct {
	TPid               string
	Tenant             string
	ID                 string
	FilterIDs          []string
	ActivationInterval *TPActivationInterval
	QueueLength        int
	TTL                string
	Metrics            []*MetricWithFilters
	Blocker            bool // blocker flag to stop processing on filters matched
	Stored             bool
	Weight             float64
	MinItems           int
	ThresholdIDs       []string
}

TPStatProfile is used in APIs to manage remotely offline StatProfile

type TPSupplier

type TPSupplier struct {
	ID                 string // SupplierID
	FilterIDs          []string
	AccountIDs         []string
	RatingPlanIDs      []string // used when computing price
	ResourceIDs        []string // queried in some strategies
	StatIDs            []string // queried in some strategies
	Weight             float64
	Blocker            bool
	SupplierParameters string
}

TPSupplier is used in TPSupplierProfile

type TPSupplierProfile

type TPSupplierProfile struct {
	TPid               string
	Tenant             string
	ID                 string
	FilterIDs          []string
	ActivationInterval *TPActivationInterval // Time when this limit becomes active and expires
	Sorting            string
	SortingParameters  []string
	Suppliers          []*TPSupplier
	Weight             float64
}

TPSupplierProfile is used in APIs to manage remotely offline SupplierProfile

type TPThresholdProfile

type TPThresholdProfile struct {
	TPid               string
	Tenant             string
	ID                 string
	FilterIDs          []string
	ActivationInterval *TPActivationInterval // Time when this limit becomes active and expires
	MaxHits            int
	MinHits            int
	MinSleep           string
	Blocker            bool    // blocker flag to stop processing on filters matched
	Weight             float64 // Weight to sort the thresholds
	ActionIDs          []string
	Async              bool
}

TPThresholdProfile is used in APIs to manage remotely offline ThresholdProfile

type TPTiming

type TPTiming struct {
	ID        string
	Years     Years
	Months    Months
	MonthDays MonthDays
	WeekDays  WeekDays
	StartTime string
	EndTime   string
}

func NewTiming

func NewTiming(ID, years, mounths, mounthdays, weekdays, time string) (rt *TPTiming)

type TPTntID

type TPTntID struct {
	TPid   string
	Tenant string
	ID     string
}

type TenantAccount

type TenantAccount struct {
	Tenant, Account string
}

func NewTAFromAccountKey

func NewTAFromAccountKey(accountKey string) (*TenantAccount, error)

type TenantArg

type TenantArg struct {
	Tenant string
}

type TenantArgWithPaginator

type TenantArgWithPaginator struct {
	TenantArg
	Paginator
}

type TenantID

type TenantID struct {
	Tenant string
	ID     string
}

func NewTenantID

func NewTenantID(tntID string) *TenantID

func (*TenantID) TenantID

func (tID *TenantID) TenantID() string

type TenantIDWithArgDispatcher

type TenantIDWithArgDispatcher struct {
	*TenantID
	*ArgDispatcher
}

type TenantIDWithCache

type TenantIDWithCache struct {
	Tenant string
	ID     string
	Cache  *string
}

func (*TenantIDWithCache) TenantID

func (tID *TenantIDWithCache) TenantID() string

type TenantWithArgDispatcher

type TenantWithArgDispatcher struct {
	*TenantArg
	*ArgDispatcher
}

type TimeInterval

type TimeInterval struct {
	Begin *time.Time
	End   *time.Time
}

type UsageInterval

type UsageInterval struct {
	Min *time.Duration
	Max *time.Duration
}

type ValueFormula

type ValueFormula struct {
	Method string
	Params map[string]any
	Static float64
}

for computing a dynamic value for Value field

func ParseBalanceFilterValue

func ParseBalanceFilterValue(tor string, val string) (*ValueFormula, error)

func (*ValueFormula) String

func (vf *ValueFormula) String() string

type WeekDays

type WeekDays []time.Weekday

Defines week days series

func (WeekDays) Contains

func (wd WeekDays) Contains(weekDay time.Weekday) (result bool)

Return true if the specified date is inside the series

func (WeekDays) Equals

func (wd WeekDays) Equals(oWD WeekDays) bool

Equals implies that WeekDays are already sorted

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) Serialize

func (wd WeekDays) Serialize(sep string) string

Dumps the week days in a serialized string, similar to the one parsed

func (WeekDays) Sort

func (wd WeekDays) Sort()

func (WeekDays) Swap

func (wd WeekDays) Swap(i, j int)

type Years

type Years []int

Defines years days series

func (Years) Contains

func (ys Years) Contains(year int) (result bool)

Return true if the specified date is inside the series

func (Years) Equals

func (ys Years) Equals(oYS Years) bool

Equals implies that Years are already sorted

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) Serialize

func (ys Years) Serialize(sep string) string

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