core

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alphabetical

type Alphabetical struct{}

Alphabetical is a rule that will check an array or object to determine if the values are in order. if the path is to an object, then the value function option 'keyedBy' must be used, to know how to sort the data.

func (Alphabetical) GetSchema

func (a Alphabetical) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Alphabetical rule.

func (Alphabetical) RunRule

func (a Alphabetical) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Alphabetical rule, based on supplied context and a supplied []*yaml.Node slice.

type Blank

type Blank struct {
}

Blank is a pass through function that does nothing. Use this if you want a rig a rule, but don't want to check any logic, the logic is pre or post processed outside the main rule run.

func (Blank) GetSchema

func (b Blank) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Blank rule.

func (Blank) RunRule

func (b Blank) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Blank rule, based on supplied context and a supplied []*yaml.Node slice.

type Casing

type Casing struct {
	// contains filtered or unexported fields
}

Casing is a rule that will check the value of a node to ensure it meets the required casing type.

func (Casing) GetSchema

func (c Casing) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Casing rule.

func (Casing) RunRule

func (c Casing) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Casing rule, based on supplied context and a supplied []*yaml.Node slice.

type Defined

type Defined struct {
}

Defined is a rule that will determine if a field has been set on a node slice.

func (Defined) GetSchema

func (d Defined) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Defined rule.

func (Defined) RunRule

func (d Defined) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Defined rule, based on supplied context and a supplied []*yaml.Node slice.

type Enumeration

type Enumeration struct{}

Enumeration is a rule that will check that a set of values meet the supplied 'values' supplied via functionOptions.

func (Enumeration) GetSchema

func (e Enumeration) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Enumeration rule.

func (Enumeration) RunRule

func (e Enumeration) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Enumeration rule, based on supplied context and a supplied []*yaml.Node slice.

type Falsy

type Falsy struct {
}

Falsy is a rule that will determine if something is seen as 'false' (could be a 0 or missing, or actually 'false')

func (Falsy) GetSchema

func (f Falsy) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Falsy rule.

func (Falsy) RunRule

func (f Falsy) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Falsy rule, based on supplied context and a supplied []*yaml.Node slice.

type Length

type Length struct{}

Length is a rule that will determine if nodes meet a 'min' or 'max' size. It checks arrays, strings and maps.

func (Length) GetSchema

func (l Length) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Length rule.

func (Length) RunRule

func (l Length) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Length rule, based on supplied context and a supplied []*yaml.Node slice.

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

Pattern is a rule that will match or not match (or both) a regular expression.

func (Pattern) GetSchema

func (p Pattern) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Pattern rule.

func (Pattern) RunRule

func (p Pattern) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Pattern rule, based on supplied context and a supplied []*yaml.Node slice.

type Schema

type Schema struct {
}

Schema is a rule that creates a schema check against a field value

func (Schema) GetSchema

func (sch Schema) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OperationParameters rule.

func (Schema) RunRule

func (sch Schema) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Schema function

type Truthy

type Truthy struct {
}

Truthy is a rule that will determine if something is seen as 'true' (could be a 1 or "pizza", or actually 'true')

func (Truthy) GetSchema

func (t Truthy) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Truthy rule.

func (*Truthy) RunRule

func (t *Truthy) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Truthy rule, based on supplied context and a supplied []*yaml.Node slice.

type Undefined

type Undefined struct {
}

Undefined is a rule that will check if a field has not been defined.

func (Undefined) GetSchema

func (u Undefined) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Undefined rule.

func (Undefined) RunRule

func (u Undefined) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Undefined rule, based on supplied context and a supplied []*yaml.Node slice.

type Xor

type Xor struct {
}

Xor is a rule that will check if one property or another has been set, but not both.

func (Xor) GetSchema

func (x Xor) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the Xor rule.

func (Xor) RunRule

func (x Xor) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Xor rule, based on supplied context and a supplied []*yaml.Node slice.

Jump to

Keyboard shortcuts

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