boolevator

package
v0.66.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInternal = errors.New("internal boolevator error")

Functions

func PrepareRegexp added in v0.29.1

func PrepareRegexp(r string) string

PrepareRegexp ensures that:

  • we match the whole string to avoid partial match false positives (e.g. we don't want ".*smh.*" regular expression to match an empty string "")
  • enable Pattern.DOTALL1 alternative in Go because otherwise simply adding ^ and $ will be too restricting, since we actually support multi-line matches
  • enable Pattern.CASE_INSENSITIVE alternative in Go to be compatible with the Cirrus Cloud parser

Types

type Boolevator added in v0.11.0

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

func New added in v0.11.0

func New(opts ...Option) *Boolevator

func (*Boolevator) Eval added in v0.11.0

func (boolevator *Boolevator) Eval(expr string, env map[string]string) (bool, error)

type Function

type Function func(arguments ...interface{}) interface{}

type Option added in v0.11.0

type Option func(*Boolevator)

func WithFunctions added in v0.11.0

func WithFunctions(functions map[string]Function) Option

Jump to

Keyboard shortcuts

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