expr

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: MIT Imports: 9 Imported by: 0

README

expr

Boolean expressions evaluator.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builder

func Builder(fields ...BuildField) string

Types

type BuildField

type BuildField func() string

func And

func And(fields ...BuildField) BuildField

func Eq

func Eq(name string, value interface{}) BuildField

func Exists added in v0.3.0

func Exists(name string) BuildField

type Filter

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

func BoolParam

func BoolParam(name string, opts ...ParamOption) *Filter

func EnumParam

func EnumParam(name string, values map[string]int32, opts ...ParamOption) *Filter

func IDParam

func IDParam(name string, opts ...ParamOption) *Filter

func StringParam added in v0.5.0

func StringParam(name string, opts ...ParamOption) *Filter

func TimestampParam added in v0.3.0

func TimestampParam(name string, opts ...ParamOption) *Filter

type Filters

type Filters []*Filter

func (Filters) ApplySQL

func (fs Filters) ApplySQL(q *database.Collection, query string) (*database.Collection, error)

func (Filters) Matcher added in v0.3.0

func (fs Filters) Matcher(query string) (Matcher, error)

type Matcher added in v0.3.0

type Matcher func(value map[string]interface{}) bool

type ParamOption

type ParamOption func(f *Filter)

func Required

func Required() ParamOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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