Skip to content

Commit

Permalink
refactor:
Browse files Browse the repository at this point in the history
- support for packages
- advanced json/yaml/config loader with imports, merges, etc
- extensive validations
- custom exceptions
- improved examples, and initial packages/ directory for reusable packages
  • Loading branch information
joostfaassen committed Jul 8, 2019
1 parent abd3f87 commit 5e247f2
Show file tree
Hide file tree
Showing 47 changed files with 1,043 additions and 416 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
vendor/
.env
autotune.json
exo.config.yaml
17 changes: 9 additions & 8 deletions README.md
Expand Up @@ -5,23 +5,24 @@ Inspired by the trends in Serverless / FaaS / Cloud Functions.

## Features:

* Provides a framework to build, call and test reusable stateless functions (actions).
* Provides a framework to build, call and test reusable, stateless, language agnostic functions (actions).
* A language agnostic (json) format to define `inputs`, `outputs` and `configs` that your actions need.
* A service.json format to list the Exo Actions you'd like to expose.
* Uses JSON Schema to validate all input, output and configs.
* Invokers for your Exo Action, so you can easily call/host them locally or remotely.
* Supports functions implemented in PHP or any other language, including executing external commands.
* "Exo Actions" are bundled into reusable "Exo Packages"
* Configure your Exo instance with a `exo.config.json` file, importing all the packages your app needs.
* Uses JSON Schema to validate every request, response, input, output and config.
* An HTTP end-point server to serve your functions.
* A Console tool to help build, test and debug your Exo functions.

## Examples:

The `example/` directory contains an example service with 2 functions, one implemented in PHP, and one generically executing an external CLI tool.
The `example/` directory contains an example package with 2 functions, one implemented in PHP, and one generically executing an external CLI tool.

To test it out:

cd example/
../bin/exo run example/hello-php/exo.action.json < example/input.example.json
cp .env.dist .env
edit .env # setup your EXO_CONFIG path
bin/exo action example/hello-php -i greeting=Hello -i name=Alice
bin/exo run example/hello-php -i greeting=Hello -i name=Alice

This will call the `hello-php` Action, passing input arguments through stdin.

Expand Down
3 changes: 2 additions & 1 deletion bin/exo
Expand Up @@ -29,6 +29,7 @@ if (file_exists($filename)) {

$application = new Application('Exo CLI', '1.0.0');
$application->setCatchExceptions(true);
$application->add(new \Exo\Console\Command\PackageCommand());
$application->add(new \Exo\Console\Command\ConfigCommand());
$application->add(new \Exo\Console\Command\ActionCommand());
$application->add(new \Exo\Console\Command\RunCommand());
$application->run();
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -14,6 +14,7 @@
"require": {
"php": ">=7.0",
"justinrainbow/json-schema": "^5.0",
"symfony/yaml": "^3.0|^4.0",
"linkorb/boost": "^1.0",
"linkorb/collection": "^1.0",
"symfony/process": "^3.0|^4.0"
Expand Down

0 comments on commit 5e247f2

Please sign in to comment.