rules

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package rules contains function for handling rule evaluation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateRules

func ValidateRules(ctx context.Context, scope *common.Scope, rules []*spec.Rule) error

ValidateRules validates the given rules using the given context and scope. If any rules are violated, an error is returned.

func ValidateRulesWithMessage

func ValidateRulesWithMessage(ctx context.Context, scope *common.Scope, rules []*spec.Rule, writer *tabwriter.Writer, preWriteCallBack func())

ValidateRulesWithMessage validates the given rules using the given context and scope. If any rules are violated, the given preWriteCallBack function is called, and then the rule is written to the given writer.

func WriteRule

func WriteRule(writer *tabwriter.Writer, rule *spec.Rule, includeIndex bool, index int)

WriteRule writes a human-readable description of the given rules to the given writer in a 2-column format.

Sometimes we run this in a context where we want to include the index of the rules in the list of rules; in that case, pass includeIndex=true and the index value. If includeIndex is false, then index is ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

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