Help us shape the future of Go! Take the 2026 Go Developer Survey

intermediate

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InternalFunctions = make(map[string]*InternalFunc)

Functions

func ConvertGoValueToLua

func ConvertGoValueToLua(L *lua.LState, value interface{}) lua.LValue

将 Lua 的 lua.LValue 转换为 Go 的 interface{}

func ConvertGoValueToLuaType

func ConvertGoValueToLuaType(L *lua.LState, t reflect.Type) string

func ConvertLuaValueToGo

func ConvertLuaValueToGo(L *lua.LState, value lua.LValue) interface{}

func ConvertNumericType

func ConvertNumericType(value int64, kind reflect.Kind) interface{}

func Register

func Register(rpc clientrpc.MaliceRPCClient)

func RegisterBuiltinFunc

func RegisterBuiltinFunc(rpc clientrpc.MaliceRPCClient)

func RegisterFunction

func RegisterFunction(name string, fn interface{})

func RegisterGRPCFunc

func RegisterGRPCFunc(rpc clientrpc.MaliceRPCClient)

func RegisterInternalFunc

func RegisterInternalFunc(name string, fn *InternalFunc, callback ImplantCallback) error

RegisterInternalFunc 注册并生成 Lua 定义文件

func WrapFuncForLua

func WrapFuncForLua(fn *InternalFunc) lua.LGFunction

Types

type ImplantCallback

type ImplantCallback func(content *clientpb.TaskContext) (string, error)

type InternalFunc

type InternalFunc struct {
	Name           string
	Raw            interface{}
	Func           func(...interface{}) (interface{}, error)
	FinishCallback ImplantCallback // implant callback
	DoneCallback   ImplantCallback
	ArgTypes       []reflect.Type
	ReturnTypes    []reflect.Type
}

func GetInternalFuncSignature

func GetInternalFuncSignature(fn interface{}) *InternalFunc

获取函数的参数和返回值类型

func WrapInternalFunc

func WrapInternalFunc(fun interface{}) *InternalFunc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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