zgg

package module
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 8 Imported by: 0

README

zgg-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileCode

func CompileCode(code interface{}) (ast.Node, error)

func CompileExpr

func CompileExpr(code interface{}) (ast.Node, error)

func Eval

func Eval(expr interface{}, opts ...ExecOption) (interface{}, error)

func RunCode

func RunCode(code interface{}, opts ...ExecOption) (map[string]interface{}, error)

Types

type ExecOption

type ExecOption interface {
	Apply(*Runner)
}

type ImportFunc added in v1.0.10

type ImportFunc func(*runtime.Context, string, string, string, bool) (runtime.Value, int64, bool)

func (ImportFunc) Apply added in v1.0.10

func (f ImportFunc) Apply(runner *Runner)

type Runner

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

func NewRunner

func NewRunner() *Runner

func (*Runner) Args

func (r *Runner) Args(args ...string) *Runner

func (*Runner) CanEval

func (r *Runner) CanEval(canEval bool) *Runner

func (*Runner) CompileCode

func (r *Runner) CompileCode(code interface{}) (ast.Node, error)

func (*Runner) CompileExpr

func (r *Runner) CompileExpr(code interface{}) (ast.Node, error)

func (*Runner) Eval

func (r *Runner) Eval(expr interface{}) (interface{}, error)

func (*Runner) Filename

func (r *Runner) Filename(filename string) *Runner

func (*Runner) IsDebug

func (r *Runner) IsDebug(isDebug bool) *Runner

func (*Runner) Reset

func (r *Runner) Reset()

func (*Runner) Run

func (r *Runner) Run(code interface{}) (interface{}, error)

func (*Runner) Stderr

func (r *Runner) Stderr(w io.Writer) *Runner

func (*Runner) Stdout

func (r *Runner) Stdout(w io.Writer) *Runner

func (*Runner) Var

func (r *Runner) Var(name string, value interface{}) *Runner

func (*Runner) Workdir

func (r *Runner) Workdir(wd string) *Runner

type Val

type Val struct {
	Value interface{}
}

type Var

type Var struct {
	Name  string
	Value interface{}
}

func (Var) Apply

func (v Var) Apply(runner *Runner)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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