expression

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const FuncNameFetch = "fetch"
View Source
const FuncNameLog = "log"
View Source
const FuncNameRun = "run"
View Source
const VarNameContext = "ctx"
View Source
const VarNameScreens = "screens"

Variables

View Source
var Log = func(args ...interface{}) {
	fmt.Fprint(os.Stderr, "EXPRESSION_LOG: ")
	fmt.Fprintln(os.Stderr, args...)
}

Functions

func Precompile

func Precompile(source string) error

func Validate

func Validate(expression string) error

Types

type Result

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

func Run

func Run(ctx context.Context, expression string, ctxVal any) *Result

func (*Result) AsBoolean

func (r *Result) AsBoolean() (bool, error)

func (*Result) AsByteArray

func (r *Result) AsByteArray() ([]byte, error)

func (*Result) AsFloat

func (r *Result) AsFloat() (float64, error)

func (*Result) AsFloatP

func (r *Result) AsFloatP() (*float64, error)

func (*Result) AsString

func (r *Result) AsString() (string, error)

type Screen

type Screen struct {
	PrimaryScreen    VariableScreen   `json:"PrimaryScreen"`
	CurrentScreen    VariableScreen   `json:"CurrentScreen"`
	Screens          []VariableScreen `json:"Screens"`
	SecondaryScreens []VariableScreen `json:"SecondaryScreens"`
}

func SetScreens

func SetScreens(screens []runtime.Screen) Screen

type VariableScreen

type VariableScreen struct {
	Dimension         VariableScreenDimension `json:"Dimension"`
	PhysicalDimension VariableScreenDimension `json:"PhysicalDimension"`
}

type VariableScreenDimension

type VariableScreenDimension struct {
	Width  int `json:"Width"`
	Height int `json:"Height"`
}

Jump to

Keyboard shortcuts

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