gmmodule

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//PublicStatusKey 状态主键
	PublicStatusKey = "status"
	//PublicStatusSuccess 成功
	PublicStatusSuccess = "success"
	//PublicStatusFailed 失败
	PublicStatusFailed = "fail"
)

Variables

View Source
var (
	//GlobalLuaState 全局lua域
	GlobalLuaState *lua.LState
)

Functions

func CastParam

func CastParam(kind reflect.Kind, param string) (reflect.Value, error)

CastParam 数据格式转换

func GMInit

func GMInit(H GMHandler, globalVars map[string]interface{}, luapath string)

GMInit 初始化gm指令实现类

func HandleCMD

func HandleCMD(exp string, ip string) (rs interface{})

HandleCMD 指令处理

func LuaLogf

func LuaLogf(format string, v ...interface{})

LuaLogf 打印日志文件

func RegistHander

func RegistHander(r reflect.Value)

RegistHander 注册gm工具类

Types

type BaseGMHandler

type BaseGMHandler struct {
}

BaseGMHandler GM基础工具实现类

func (BaseGMHandler) Lua

func (h BaseGMHandler) Lua(cmd string) interface{}

Lua 执行GM指令

func (BaseGMHandler) LuaScript

func (h BaseGMHandler) LuaScript(fname string, params string) interface{}

LuaScript 执行GM脚本文件

type GMHandler

type GMHandler interface {
	LuaScript(fname string, params string) interface{}
	Lua(cmd string) interface{}
}

GMHandler gm Lua指令实现接口

Jump to

Keyboard shortcuts

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