- Notifications
You must be signed in to change notification settings - Fork1
vlorc/lua-vm
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
简体中文Golang lua minimum project
- bit
- buffer
- crypto
- fs
- hash
- io
- net
- regexp
- store
- http/sock5 proxy
- lua pool
- file system
go get -u github.com/vlorc/lua-vm
- Create Pool
pool.NewLuaPool()
- Preload Script
pool.NewLuaPool().Preload(pool.Source(strings.NewReader("print('hello')")),pool.Value("tobuffer",base.ToBuffer),)
- Use tcp
import ("github.com/vlorc/lua-vm/pool""github.com/vlorc/lua-vm/net/tcp""github.com/vlorc/lua-vm/net/base")funcmain() {p:=pool.NewLuaPool().Preload(pool.Module("net.tcp",tcp.NewTCPFactory(driver.DirectDriver{})),pool.Module("buffer", base.BufferFactory{}),)iferr:=p.DoFile("demo/tcp.lua");nil!=err {println("error: ",err.Error())}}
About
Golang lua virtual machine
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published