rules

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextKeyAge  = "age"
	ContextKeyCity = "city"
)

Variables

View Source
var (
	ErrEmptyRule                error = fmt.Errorf("empty rule")
	ErrUnknownLogicalOperator   error = fmt.Errorf("unknown logical operator")
	ErrEmptyRuleComparisonValue error = fmt.Errorf("empty rule comparison value")
	ErrMismatchedType           error = fmt.Errorf("mismatched context type")
	ErrUnsupportedType          error = fmt.Errorf("unsupported type")
)

Functions

func AgeEqualsV3

func AgeEqualsV3(age float64) *rulesv1beta3.Atom

age ==

func AgeNotEqualsV3

func AgeNotEqualsV3(age float64) *rulesv1beta3.Atom

age !=

func AgeV3

func AgeV3(op string, age float64) *rulesv1beta3.Atom

func CityEqualsV3

func CityEqualsV3(city string) *rulesv1beta3.Atom

city ==

func CityInV3

func CityInV3(cities ...interface{}) *rulesv1beta3.Atom

func CityV3

func CityV3(op, city string) *rulesv1beta3.Atom

func CtxBuilder

func CtxBuilder() *ctxBuilder

func NewV1Beta3

func NewV1Beta3(rule *rulesv1beta3.Rule, evalCtx EvalContext) *v1beta3

Represents the rules defined in the proto package 'lekko.rules.v1beta3'.

Types

type EvalContext

type EvalContext struct {
	Namespace                  string
	FeatureName                string
	ReferencedConfigToValueMap map[string]*structpb.Value
}

Jump to

Keyboard shortcuts

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