-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
28 lines (22 loc) · 914 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package types
import "github.com/spectrocloud-labs/validator/api/v1alpha1"
// ValidationRuleResult is the result of the execution of a validation rule by a validator.
type ValidationRuleResult struct {
Condition *v1alpha1.ValidationCondition
State *v1alpha1.ValidationState
}
// ValidationResponse is the reconciliation output of one or more validation rules by a validator.
type ValidationResponse struct {
ValidationRuleResults []*ValidationRuleResult
ValidationRuleErrors []error
}
// AddResult adds a ValidationRuleResult and associated error to a ValidationResponse.
func (v *ValidationResponse) AddResult(vrr *ValidationRuleResult, err error) {
v.ValidationRuleResults = append(v.ValidationRuleResults, vrr)
v.ValidationRuleErrors = append(v.ValidationRuleErrors, err)
}
type SinkType string
const (
SinkTypeAlertmanager SinkType = "alertmanager"
SinkTypeSlack SinkType = "slack"
)