Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LangEval is a custom GVal evaluator for business rules and facts conditions // It contains all supported custom functions (math, date, dateopendays, etc.) LangEval = gval.NewLanguage( gval.Full(), LangExprMath, LangEvalDate, LangEvalDateOpenDays, LangAdvancedInfix, LangEvalMap, ) // LangExprMath is a custom GVal evaluator for business rules and facts conditions // It contains custom functions related to math LangExprMath = gval.NewLanguage( gval.Full(), gval.Function("length", length), gval.Function("max", max), gval.Function("min", min), gval.Function("sum", sum), gval.Function("average", average), ) // LangEvalDate is a custom GVal evaluator for business rules and facts conditions // It contains custom functions related to date LangEvalDate = gval.NewLanguage( gval.Full(), gval.Function("dayOfWeek", dayOfWeek), gval.Function("day", day), gval.Function("month", month), gval.Function("year", year), gval.Function("startOf", startOf), gval.Function("endOf", endOf), gval.Function("datemillis", dateToMillis), gval.Function("calendar_add", addDurationDays), gval.Function("calendar_delay", delayInDays), gval.Function("truncate_date", truncateDate), gval.Function("extract_from_date", extractFromDate), ) // LangEvalDateOpenDays is a custom GVal evaluator for business rules and facts conditions // It contains custom functions related to date (opendays support) LangEvalDateOpenDays = gval.NewLanguage( gval.Full(), gval.Function("calendar_add_od", addDurationOpenDays), gval.Function("calendar_delay_od", delayInOpenDays), ) // LangAdvancedInfix is a custom Gval evaluator for maps operations LangAdvancedInfix = gval.NewLanguage( gval.Full(), gval.InfixOperator("+", advancedAddition), gval.InfixOperator("-", advancedSubtraction), gval.InfixOperator("*", advancedMultiplication), gval.InfixOperator("/", advancedDivision), ) LangEvalMap = gval.NewLanguage( gval.Full(), gval.Function("flatten_fact", flattenFact), ) )
Functions ¶
func GetDateKeywords ¶
GetDateKeywords return a list of standard date time placeholders
func IsInvalidNumber ¶
func IsInvalidNumber(input interface{}) bool
IsInvalidNumber return true if the input interface is a not valid number
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.