types

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 25

Documentation

Overview

Package types contains structs used by to construct ValidationResults.

Index

Constants

View Source
const ErrValidationFailed = "Validation failed with an unexpected error"

ErrValidationFailed is the error message returned when a validation rule fails.

Variables

This section is empty.

Functions

This section is empty.

Types

type SinkType

type SinkType string

SinkType is the type of sink to which a notification should be sent.

const (
	// SinkTypeAlertmanager is an Alertmanager sink.
	SinkTypeAlertmanager SinkType = "alertmanager"

	// SinkTypeSlack is a Slack sink.
	SinkTypeSlack SinkType = "slack"
)

type ValidationResponse

type ValidationResponse struct {
	ValidationRuleResults []*ValidationRuleResult
	ValidationRuleErrors  []error
}

ValidationResponse is the reconciliation output of one or more validation rules by a validator.

func (*ValidationResponse) AddResult

func (v *ValidationResponse) AddResult(vrr *ValidationRuleResult, err error)

AddResult adds a ValidationRuleResult and associated error to a ValidationResponse.

type ValidationRuleResult

type ValidationRuleResult struct {
	Condition *v1alpha1.ValidationCondition
	State     *v1alpha1.ValidationState
}

ValidationRuleResult is the result of the execution of a validation rule by a validator.

func (*ValidationRuleResult) Finalize added in v0.1.11

func (vrr *ValidationRuleResult) Finalize(err error)

Finalize sets the ValidationRuleResult state to ValidationFailed if an non-nil error is provided.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL