elutils

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 4 Imported by: 8 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

utilities to embed a language for Golang application

This package is intended to provide some utilities to embed a language in Golang applications. Please see go-epy, go-quickjs, go-wasm, go-elisp.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeValue

func MakeValue(t reflect.Type) reflect.Value

func SetValue

func SetValue(dest reflect.Value, val interface{}) error

Types

type EmbeddingFuncHelper

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

func NewEmbeddingFuncHelper

func NewEmbeddingFuncHelper(funcVarPtr interface{}) (helper *EmbeddingFuncHelper, err error)

func (*EmbeddingFuncHelper) BindEmbeddingFunc

func (h *EmbeddingFuncHelper) BindEmbeddingFunc(goFunc FnGoFunc)

func (*EmbeddingFuncHelper) MakeGoFuncArgs

func (h *EmbeddingFuncHelper) MakeGoFuncArgs(args []reflect.Value) <-chan interface{}

func (*EmbeddingFuncHelper) NumOut

func (h *EmbeddingFuncHelper) NumOut() (nOut int, withLastErr bool)

func (*EmbeddingFuncHelper) ToGolangResults

func (h *EmbeddingFuncHelper) ToGolangResults(res interface{}, isResArray bool, callErr error) (results []reflect.Value)

type FnBindGoFunc added in v0.4.0

type FnBindGoFunc func(fnVarPtr interface{}) FnGoFunc

type FnGetEmbeddingArg

type FnGetEmbeddingArg func(i int) interface{}

type FnGoFunc

type FnGoFunc func(args []reflect.Value) (results []reflect.Value)

type GolangFuncHelper

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

func NewGolangFuncHelper

func NewGolangFuncHelper(funcVar interface{}, name ...string) (helper *GolangFuncHelper, err error)

func NewGolangFuncHelperDirectly added in v0.3.0

func NewGolangFuncHelperDirectly(fnVal reflect.Value, fnType reflect.Type) (helper *GolangFuncHelper)

func (*GolangFuncHelper) CallGolangFunc

func (h *GolangFuncHelper) CallGolangFunc(embeddingFuncArgsNum int, embddingFuncName string, getArg FnGetEmbeddingArg) (val interface{}, err error)

func (*GolangFuncHelper) GetRealName

func (h *GolangFuncHelper) GetRealName() string

Jump to

Keyboard shortcuts

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