rule

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CelFunctions = []cel.EnvOption{

	absDoubleFunc,
	absIntFunc,

	nowFunc,
}

CelFunctions contains all the custom functions used in the rules

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

func NewBuilder(schema defs.Schema) (*Builder, error)

func (*Builder) Build

func (rb *Builder) Build(rule string) (*Rule, error)

type Rule

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

func New

func New(schema defs.Schema, prg cel.Program) *Rule

func (*Rule) Eval

func (r *Rule) Eval(ctx context.Context, sampleData *data.Data) (bool, error)

Jump to

Keyboard shortcuts

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