exprtest

package
v0.0.0-...-e90178e Latest Latest
Warning

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

Go to latest
Published: May 16, 2025 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boolean

func Boolean[T ~bool](b T) expr.Expr

Boolean creates an [Expr] that returns a boolean value.

func Empty

func Empty() expr.Expr

Empty creates an [Expr] that returns a nil value.

func Error

func Error(err error) expr.Expr

Error creates an [Expr] that returns an error.

func Float

func Float[T constraints.Float](f T) expr.Expr

Float creates an [Expr] that returns a float value.

func Integer

func Integer[T constraints.Integer](i T) expr.Expr

Integer creates an [Expr] that returns an integer value.

func Slice

func Slice[T any](s ...T) expr.Expr

Slice creates an [Expr] that returns a slice of values.

func String

func String[T ~string](s T) expr.Expr

String creates an [Expr] that returns a string value.

Types

type Func

type Func func(*expr.Context) (reflect.Value, error)

Func is a function type that implements the expr.Expr interface.

func (Func) Eval

func (f Func) Eval(ctx *expr.Context) (reflect.Value, error)

Eval evaluates the function and returns the result.

Jump to

Keyboard shortcuts

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