elutils

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 3 Imported by: 9

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{}) (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)

Jump to

Keyboard shortcuts

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