Documentation
¶
Index ¶
- func Call(p *pkg.Package, funcName string, params ...any) ([]any, error)
- func LoadPackage(filePath string) (*pkg.Package, error)
- func Parse(source string) (*pkg.Package, error)
- func RegisterFunction(pkgPath string, funcName string, fn reflect.Value)
- func RegisterPackage(pkgPath string, values map[string]reflect.Value, types map[string]reflect.Type)
- func Run(filePath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
Call calls a function named funcName in the given package pkg with the provided parameters values. It returns the results of the function call and an error if any occurred during the call.
func LoadPackage ¶
Loads and builds the Go package located at the specified file path. filePath is the file path to a folder that contains Go files.
func Parse ¶
Parse parses the provided Go source code string and returns a Package representation of it. The source must be valid Go, e.g. main package with a main function. It cannot have external dependencies ; only standard library packages are allowed.
func RegisterFunction ¶
RegisterFunction registers an external function for use within gi-executed code. This function exist to support generated code and is not meant to be used beyond that. The funcName argument should be in the format "FuncName[Type1,Type2,...]" for generic functions, where Type1, Type2, etc. are the type parameters used in the function signature. For non-generic functions, it should simply be "FuncName". The fn argument must be a valid reflect.Value representing a function. Example usage for a generic function: RegisterFunction("slices", "Contains[int]", reflect.ValueOf(func(a []int, b int) bool { /* implementation */ }))
func RegisterPackage ¶
func RegisterPackage(pkgPath string, values map[string]reflect.Value, types map[string]reflect.Type)
RegisterPackage registers an external package with its values and types for use within gi-executed code. This function exist to support generated code and is not meant to be used beyond that.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
genstdlib
command
|
|
|
genstdlib/listpkgs
command
|
|
|
gi
command
|
|
|
treerunner
command
|
|
|
api_call
command
|
|
|
nestedloop
command
|
|
|
pointers
command
|
|
|
remoting
command
|
|
|
script
command
|
|
|
Code generated by cmd/genstdlib/main.go; DO NOT EDIT.
|
Code generated by cmd/genstdlib/main.go; DO NOT EDIT. |
|
internal/perftests/tengobench
command
|
|
|
internal/perftests/walkprofile
command
|
|
