https://github.com/deflinhec/runtimelua
A lua framework which base on golang, support Redis pub/sub, ZeroMQ, HTTP, Event and Real-time hot reload.
https://github.com/deflinhec/runtimelua
golang hotreload lua redis zeromq
Last synced: 5 months ago
JSON representation
A lua framework which base on golang, support Redis pub/sub, ZeroMQ, HTTP, Event and Real-time hot reload.
- Host: GitHub
- URL: https://github.com/deflinhec/runtimelua
- Owner: deflinhec
- License: apache-2.0
- Created: 2022-12-30T20:07:16.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T12:54:46.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T19:16:26.175Z (about 2 years ago)
- Topics: golang, hotreload, lua, redis, zeromq
- Language: Go
- Homepage:
- Size: 140 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Lua runtime framework
> A lua framework which base on golang, support Redis pub/sub, ZeroMQ, HTTP, Event and Real-time hot reload.
## Features
* **aes256** - AES-256 encryption and decryption.
* **base64** - Base64 encoding and decoding.
* **json** - JSON encoding and decoding.
* **md5** - MD5 hash funtion.
* **uuid** - UUID generator.
* **bit32** - 32 bit shifting.
* **bit64** - 64 bit shifting.
* **event** - Event module for subscribing loop、delay events.
* **http** - HTTP module for sending Http Request.
* **logger** - Logger module for logging.
* **redis** - Redis module to comminucate with redis sever, support pub/sub.
* **zmq** (Optional build) - ZeroMQ module to create router and dealers.
* **Real-time hot reload** - Support for lua hot reload when files changed.
## Getting Started
A quick demostration of this framework can be found under [example directory](./example).
```shell
cd example && go run main.go
```
When launched you'll see each runtime informations in console output.
> 2023-05-08T14:54:20.449+0200 INFO runtimelua/scripts.go:364 Watching runtime directory {"vm": 0, "path": "/Users/user/runtimelua/example/script"}
> 2023-05-08T14:54:20.450+0200 DEBUG runtimelua/runtime.go:120 Runtime information {"vm": 0, "load": ["table", "os", "io", "string", "math", "coroutine", "package"]}
> 2023-05-08T14:54:20.450+0200 DEBUG runtimelua/runtime.go:123 Runtime information {"vm": 0, "preload": ["runtime", "json", "bit32", "base64", "event", "logger"]}
> 2023-05-08T14:54:20.451+0200 INFO runtimelua/scripts.go:364 Watching runtime directory {"vm": 1, "path": "/Users/user/runtimelua/example/script"}
> 2023-05-08T14:54:20.451+0200 DEBUG runtimelua/runtime.go:120 Runtime information {"vm": 1, "load": ["math", "coroutine", "package", "table", "os", "io", "string"]}
> 2023-05-08T14:54:20.451+0200 DEBUG runtimelua/runtime.go:123 Runtime information {"vm": 1, "preload": ["runtime", "json", "bit32", "base64", "event", "logger"]}
## Building with ZeroMQ support
ZeroMQ require extra libraries dependency, so it's optional.
```shell
go build -tags zmq
```
## Contribute
Contributions are always welcome.
## License
This project is licensed under the [Apache-2 License](./LICENSE).
## :coffee: Donation
If you like my project and also appericate for the effort. Don't hesitate to [buy me a coffee](https://ko-fi.com/deflinhec)😊.