Initial copy in
This commit is contained in:
18
rateclass.go
Normal file
18
rateclass.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package event
|
||||
|
||||
type rateClass struct {
|
||||
grantRate float64
|
||||
criteria map[string]any
|
||||
|
||||
eventRate float64
|
||||
}
|
||||
|
||||
func (rc *rateClass) match(ev *Event) bool {
|
||||
for k, v := range rc.criteria {
|
||||
if ev.Data[k] != v {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user