gobridge

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoValueToLua

func GoValueToLua(value interface{}) lua.LValue

GoValueToLua 将 Go 值转换为 Lua 值

func LuaValueToGo

func LuaValueToGo(value lua.LValue) interface{}

LuaValueToGo 将 Lua 值转换为 Go 值

Types

type GoBridgeModule

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

GoBridgeModule gobridge 模块

func NewGoBridgeModule

func NewGoBridgeModule(engine model.Engine) *GoBridgeModule

NewGoBridgeModule 创建 gobridge 模块实例

func (*GoBridgeModule) CallLuaCallback

func (m *GoBridgeModule) CallLuaCallback(funcName string, args ...interface{}) ([]interface{}, error)

CallLuaCallback 从 Go 代码调用已注册的 Lua 回调函数 参数: funcName (string) - 函数名称

args (...interface{}) - 传递给 Lua 函数的参数

返回值: ([]interface{}, error) - Lua 函数的返回值和错误

func (*GoBridgeModule) IsAvailable

func (m *GoBridgeModule) IsAvailable() bool

IsAvailable 返回模块是否可用

func (*GoBridgeModule) Name

func (m *GoBridgeModule) Name() string

Name 返回模块名称

func (*GoBridgeModule) Register

func (m *GoBridgeModule) Register(engine model.Engine) error

Register 向引擎注册模块的方法

Jump to

Keyboard shortcuts

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