mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
ips: implement NavigableMapper for AllocatedIP
This commit is contained in:
committed by
Dan Christian Bogos
parent
97969bb707
commit
4278d3ed78
@@ -807,6 +807,7 @@ const (
|
||||
MetaFD = "*fd"
|
||||
SortingData = "SortingData"
|
||||
ProfileID = "ProfileID"
|
||||
PoolID = "PoolID"
|
||||
SortedRoutes = "SortedRoutes"
|
||||
MetaMonthly = "*monthly"
|
||||
MetaYearly = "*yearly"
|
||||
|
||||
10
utils/ips.go
10
utils/ips.go
@@ -387,6 +387,16 @@ type AllocatedIP struct {
|
||||
Address netip.Addr
|
||||
}
|
||||
|
||||
// AsNavigableMap implements engine.NavigableMapper.
|
||||
func (ip *AllocatedIP) AsNavigableMap() map[string]*DataNode {
|
||||
return map[string]*DataNode{
|
||||
ProfileID: NewLeafNode(ip.ProfileID),
|
||||
PoolID: NewLeafNode(ip.PoolID),
|
||||
Message: NewLeafNode(ip.Message),
|
||||
Address: NewLeafNode(ip.Address.String()),
|
||||
}
|
||||
}
|
||||
|
||||
// IPAllocations represents IP allocations with usage tracking and TTL management.
|
||||
type IPAllocations struct {
|
||||
Tenant string
|
||||
|
||||
Reference in New Issue
Block a user