rules

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyCondition = errors.New("rule condition cannot be empty")
	ErrInvalidSyntax  = errors.New("invalid rule syntax")
)

Functions

This section is empty.

Types

type CertRule

type CertRule struct {
	Name            string   `yaml:"name"`
	MinDaysValidity int      `yaml:"minDaysValidity"`
	Tags            []string `yaml:"tags"`
	Notifications   []string `yaml:"notifications"`
}

type Rule

type Rule struct {
	Name          string   `yaml:"name"`
	Condition     string   `yaml:"condition"`
	Tags          []string `yaml:"tags"`
	Notifications []string `yaml:"notifications"`
}

func (Rule) GetNotificationTypes

func (r Rule) GetNotificationTypes() []string

type RuleResult

type RuleResult struct {
	Satisfied bool
	Message   string
	Error     error
}

func EvaluateCertRule

func EvaluateCertRule(rule CertRule, certExpiryTime time.Time) RuleResult

func EvaluateRule

func EvaluateRule(rule Rule, downtime, responseTime time.Duration) RuleResult

Jump to

Keyboard shortcuts

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