gmon/analyse/rules.go
2020-11-14 18:41:37 +01:00

26 lines
667 B
Go

package analyse
import (
"errors"
)
// ErrCompareMatching should be thrown if the compare character can not be used.
var ErrCompareMatching = errors.New("The compare character does not match neither '>', '<', '=' or '!='")
type compareFloatFunc func(want float64) bool
type compareIntFunc func(want int) bool
// Rule represents a generic rule that can be extended by a more specified rule.
type Rule struct {
Name string
Description string
Deactivated bool
// Compare has to be '>', '<', '=' or '!='
Compare string
}
// IsDeactivated returns the status if the rule is deactivated or not.
func (r Rule) IsDeactivated() bool {
return r.Deactivated
}