mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
using tasks and action plans with no accounts
This commit is contained in:
17
utils/map.go
17
utils/map.go
@@ -143,3 +143,20 @@ func (sm StringMap) GetOne() string {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func NoDots(m map[string]struct{}) map[string]struct{} {
|
||||
return MapKeysReplace(m, ".", ".")
|
||||
}
|
||||
|
||||
func YesDots(m map[string]struct{}) map[string]struct{} {
|
||||
return MapKeysReplace(m, ".", ".")
|
||||
}
|
||||
|
||||
func MapKeysReplace(m map[string]struct{}, old, new string) map[string]struct{} {
|
||||
for key, val := range m {
|
||||
delete(m, key)
|
||||
key = strings.Replace(key, old, new, -1)
|
||||
m[key] = val
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user