lua-vm

module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: Apache-2.0

README

Golang lua-vm

简体中文 Golang lua minimum project

License codebeat badge Go Report Card GoDoc Build Status Coverage Status

Library

  • bit
  • buffer
  • crypto
  • fs
  • hash
  • io
  • net
  • regexp
  • store

Features

  • http/sock5 proxy
  • lua pool
  • file system

Installing

go get -u github.com/vlorc/lua-vm

Quick Start

  • Create Pool
pool.NewLuaPool()
  • Preload Script
pool.NewLuaPool().Preload(
		pool.Source(strings.NewReader("print('hello')")),
		pool.Value("tobuffer", base.ToBuffer),
)

Examples

  • Use tcp
import (
    "github.com/vlorc/lua-vm/pool"
    "github.com/vlorc/lua-vm/net/tcp"
    "github.com/vlorc/lua-vm/net/base"
)

func main() {
	p := pool.NewLuaPool().Preload(
		pool.Module("net.tcp", tcp.NewTCPFactory(driver.DirectDriver{})),
		pool.Module("buffer", base.BufferFactory{}),
	)
	if err := p.DoFile("demo/tcp.lua"); nil != err {
		println("error: ", err.Error())
	}
}

Lua Demo

Directories

Path Synopsis
crypto
aes
hash
crc
net
dns
tcp
udp
url

Jump to

Keyboard shortcuts

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