started action balance pointer filtering

This commit is contained in:
Radu Ioan Fericean
2016-02-09 16:19:40 +02:00
parent 84f9af6043
commit 7fc0e4ff50
12 changed files with 273 additions and 134 deletions

View File

@@ -273,22 +273,22 @@ type TPActions struct {
}
type TPAction struct {
Identifier string // Identifier mapped in the code
BalanceId string // Balance identification string (account scope)
BalanceType string // Type of balance the action will operate on
Directions string // Balance direction
Units float64 // 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 float64 // Balance weight
Identifier string // Identifier mapped in the code
BalanceId string // Balance identification string (account scope)
BalanceType string // Type of balance the action will operate on
Directions string // Balance direction
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 bool
BalanceDisabled bool
BalanceBlocker string
BalanceDisabled string
Weight float64 // Action's weight
}
@@ -486,14 +486,14 @@ type TPActionTrigger struct {
BalanceType string // Type of balance this trigger monitors
BalanceDirections string // Traffic direction
BalanceDestinationIds string // filter for balance
BalanceWeight float64 // 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 bool // filter for balance
BalanceDisabled bool // filter for balance
BalanceBlocker string // filter for balance
BalanceDisabled string // filter for balance
MinQueuedItems int // Trigger actions only if this number is hit (stats only)
ActionsId string // Actions which will execute on threshold reached
Weight float64 // weight

View File

@@ -91,6 +91,7 @@ const (
ROUNDING_MIDDLE = "*middle"
ROUNDING_DOWN = "*down"
ANY = "*any"
ZERO = "*zero"
ASAP = "*asap"
USERS = "*users"
COMMENT_CHAR = '#'

View File

@@ -337,6 +337,10 @@ func Fib() func() time.Duration {
// Utilities to provide pointers where we need to define ad-hoc
func StringPointer(str string) *string {
if str == ZERO {
str = ""
return &str
}
return &str
}

View File

@@ -74,6 +74,9 @@ func NewStringMap(s ...string) StringMap {
}
func ParseStringMap(s string) StringMap {
if s == ZERO {
return make(StringMap)
}
return StringMapFromSlice(strings.Split(s, INFIELD_SEP))
}