Documentation
¶
Index ¶
- type Mapper
- type Predicate
- func AllTrue(conds ...string) Predicate
- func And(preds ...Predicate) Predicate
- func AnyFalse(conds ...string) Predicate
- func ExtPresent(cond string) Predicate
- func ExtTrue(cond string) Predicate
- func IsTrue(cond string) Predicate
- func Not(p Predicate) Predicate
- func Or(preds ...Predicate) Predicate
- func VersionChanged() Predicate
- type Rule
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper struct {
Rules []Rule
}
Mapper applies rules to compute external conditions.
type Predicate ¶
type Predicate func(State) match
Predicate evaluates state and returns match with source.
func ExtPresent ¶
ExtPresent checks if an external condition exists (regardless of status).
func VersionChanged ¶
func VersionChanged() Predicate
VersionChanged checks if version changed flag is set.
type Rule ¶
type Rule struct {
Type string // external condition type name
TrueIf Predicate // set True when matched; source used for Reason/Message
FalseIf Predicate // set False when matched; source used for Reason/Message
OnlyIf Predicate // precondition; skip rule if not matched
Sticky bool // once True, stays True forever
}
Rule defines how to compute an external condition from internal state.
Click to show internal directories.
Click to hide internal directories.