condition

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func Eval

func Eval(condition Interface, ref string, data map[string]interface{}) (bool, error)

Types

type Compare

type Compare struct {
	Eq  interface{}   `json:"eq,omitempty" yaml:"eq,omitempty" hcl:"eq,omitempty"`
	Lt  interface{}   `json:"lt,omitempty" yaml:"lt,omitempty" hcl:"lt,omitempty"`
	Lte interface{}   `json:"lte,omitempty" yaml:"lte,omitempty" hcl:"lte,omitempty"`
	Gt  interface{}   `json:"gt,omitempty" yaml:"gt,omitempty" hcl:"gt,omitempty"`
	Gte interface{}   `json:"gte,omitempty" yaml:"gte,omitempty" hcl:"gte,omitempty"`
	In  []interface{} `json:"in,omitempty" yaml:"in,omitempty" hcl:"in,omitempty"`
}

type Empty

type Empty struct {
}

func (*Empty) Eval

func (c *Empty) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

type EvalCondition

type EvalCondition string

func (*EvalCondition) Eval

func (c *EvalCondition) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

type Interface

type Interface interface {
	Eval(interface{}, map[string]interface{}, error) (bool, error)
}

type NumberCompare

type NumberCompare struct {
	Compare `json:",inline" yaml:",inline" hcl:",inline"`
}

func (*NumberCompare) Eval

func (c *NumberCompare) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

type RegexpMatch

type RegexpMatch struct {
	Regexp string `json:"regexp" yaml:"regexp" hcl:"regexp"`
}

func (*RegexpMatch) Eval

func (c *RegexpMatch) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

type StringCompare

type StringCompare struct {
	Compare `json:",inline" yaml:",inline" hcl:",inline"`
}

func (*StringCompare) Eval

func (c *StringCompare) Eval(ref interface{}, data map[string]interface{}, err error) (bool, error)

Jump to

Keyboard shortcuts

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