plugin

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LuaScript = "lua"
	TCLScript = "tcl"
	CNAScript = "cna"
	GoPlugin  = "go"
)

Variables

View Source
var (
	MalType = "lua"
)

Functions

func GenerateLuaDefinitionFile

func GenerateLuaDefinitionFile(L *lua.LState, filename string) error

generateLuaDefinitionFile 生成 Lua 函数定义和 Protobuf class 定义文件

func NewLuaVM

func NewLuaVM() *lua.LState

func RegisterAllProtobufMessages

func RegisterAllProtobufMessages(L *lua.LState)

RegisterAllProtobufMessages 注册 implantpb 和 clientpb 中的所有 Protobuf Message

func RegisterProtobufMessage

func RegisterProtobufMessage(L *lua.LState, msgType string, msg proto.Message)

RegisterProtobufMessage 注册 Protobuf message 类型到 Lua

func RegisterProtobufMessageType

func RegisterProtobufMessageType(L *lua.LState)

// 注册 Protobuf Message 的类型和方法

func RegisterProtobufMessagesFromPackage

func RegisterProtobufMessagesFromPackage(L *lua.LState, pkg string)

RegisterProtobufMessagesFromPackage 注册指定包中所有的 Protobuf Message

Types

type MalManiFest

type MalManiFest struct {
	Name         string   `json:"name" yaml:"name"`
	Type         string   `json:"type" yaml:"type"` // lua, tcl
	Author       string   `json:"author" yaml:"author"`
	Version      string   `json:"version" yaml:"version"`
	EntryFile    string   `json:"entry" yaml:"entry"`
	DependModule []string `json:"depend_module" yaml:"depend_modules"`
	DependArmory []string `json:"depend_armory" yaml:"depend_armory"`
}

type Plugin

type Plugin struct {
	*MalManiFest
	Enable  bool
	Content []byte
	Path    string
}

func NewPlugin

func NewPlugin(manifest *MalManiFest) (*Plugin, error)

Jump to

Keyboard shortcuts

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