condition

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OperatorMap = map[string]func(interface{}, cty.Value) (bool, ports.InvalidAttribute, error){

	"=":      Equality,
	">":      SuperiorStrict,
	">=":     SuperiorOrEqual,
	"<":      InferiorStrict,
	"<=":     InferiorOrEqual,
	"re":     RegexMatch,
	"in":     Inclusion,
	"not in": NotInclusion,
}

Functions

func Equality

func Equality(attribute interface{}, expectedValue cty.Value) (bool, ports.InvalidAttribute, error)

func Inclusion

func Inclusion(attribute interface{}, expectedValue cty.Value) (bool, ports.InvalidAttribute, error)

func InferiorOrEqual

func InferiorOrEqual(attribute interface{}, expectedValue cty.Value) (bool, ports.InvalidAttribute, error)

func InferiorStrict

func InferiorStrict(attribute interface{}, expectedValue cty.Value) (bool, ports.InvalidAttribute, error)

func NotInclusion

func NotInclusion(attribute interface{}, expectedValue cty.Value) (bool, ports.InvalidAttribute, error)

func RegexMatch

func RegexMatch(attribute interface{}, expectedExpression cty.Value) (bool, ports.InvalidAttribute, error)

func SuperiorOrEqual

func SuperiorOrEqual(attribute interface{}, expectedValue cty.Value) (bool, ports.InvalidAttribute, error)

func SuperiorStrict

func SuperiorStrict(attribute interface{}, expectedValue cty.Value) (bool, ports.InvalidAttribute, error)

Types

type AttributeError

type AttributeError struct {
	ExpectedAttribute interface{}
	ReceivedAttribute interface{}
}

func (AttributeError) Error

func (a AttributeError) Error() string

type Condition

type Condition struct {
	Attribute string
	Operator  string
	Values    cty.Value
}

func (*Condition) Check

func (c *Condition) Check(attributes []interface{}) []ports.InvalidAttribute

func (*Condition) Init

func (c *Condition) Init(block *hcl.Block)

Jump to

Keyboard shortcuts

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