Documentation ¶
Overview ¶
Package functions provides custom importable functions for Expr runtimes that may be injected into your Expr runtime environments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSorted ¶
IsSorted provides the isSorted function as an Expr function. It will verify that the provided type is sorted ascending. It supports the following types: - Injected types that support the sort.Interface - []int - []float64 - []string
Usage:
// Inject into your environment. _, err := expr.Compile(`foo`, expr.Env(nil), functions.ExprIsSorted())
Expression:
isSorted([1, 2, 3]) isSorted(["a", "b", "c"]) isSorted([1.0, 2.0, 3.0]) isSorted(myCustomType) // myCustomType must implement sort.Interface
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.