https://github.com/emyasnikov/lua-resty-set
OpenResty framework intended for microservices endpoints.
https://github.com/emyasnikov/lua-resty-set
events lua luajit microservices mysql nginx openresty redis routing
Last synced: about 2 months ago
JSON representation
OpenResty framework intended for microservices endpoints.
- Host: GitHub
- URL: https://github.com/emyasnikov/lua-resty-set
- Owner: emyasnikov
- License: mit
- Created: 2019-08-09T08:08:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T22:24:28.000Z (over 4 years ago)
- Last Synced: 2025-02-08T05:27:59.590Z (3 months ago)
- Topics: events, lua, luajit, microservices, mysql, nginx, openresty, redis, routing
- Language: Lua
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-resty-set
**lua-resty-set** is a library for OpenResty supporting route matching, events, tokens, and some handy database query operations.
## CRUD
**lua-resty-set** supports predefined CRUD endpoints, which can be used to shorted code.
### Create
```lua
example:create('example', function(self) end)
```This matches `POST /example` and reads data to `self.data`.
### Read
```lua
example:read('example', function(self, id) end)
```This matches `GET /example/1`.
### Update
```lua
example:update('example', function(self, id) end)
```This matches `PATCH /example/1` and reads data to `self.data`.
### Delete
```lua
example:delete('example', function(self, id) end)
```And this matches `DELETE /example/1`.
## Routes
```lua
example:route('GET', '/example/(%d+)', function(self, id) end)
```Route function takes method and path with variables in it, like the numerical ID in this case.
## See Also
[lua-resty-route](https://github.com/bungle/lua-resty-route) — Routing library which was inspiration for this project
## Licence
**lua-resty-set** uses MIT License.
```
Copyright (c) 2019 - 2020, Evgenij Myasnikov
All rights reserved.Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```