https://github.com/tarantool/cartridge-extensions
https://github.com/tarantool/cartridge-extensions
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tarantool/cartridge-extensions
- Owner: tarantool
- Created: 2020-01-27T12:24:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-24T09:28:22.000Z (over 3 years ago)
- Last Synced: 2025-01-16T19:44:31.511Z (over 1 year ago)
- Language: Lua
- Size: 25.4 KB
- Stars: 2
- Watchers: 25
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## Cartridge-extensions
This module represents new role `extensions` for Cartridge.
All `extensions/*.lua` files will be loaded as Lua modules.
They'll be accessible through
```lua
local mymodule = require('extensions.mymodule')
```
### How to export my functions?
Also `extensions/config.yml` describes how to export those modules in
serverless style.
For now there're two supported types of events:
- `binary`,
- `http`.
HTTP event supports any kind of methods: `GET`, `POST`, `PUT`, etc.
Here is a little example:
```yml
functions:
transfer_money:
module: extensions.banking
handler: transfer_money
events:
- binary:
# It'll assign _G.__transfer_money = banking.transfer_money
path: __transfer_money
get_balance:
module: extensions.banking
handler: http_get_balance
events:
- http:
path: /get_balance
method: GET
```