-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from code0-tech/30-action-simplification
Action Simplification
- Loading branch information
Showing
11 changed files
with
210 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Tucana | ||
|
||
This repository is responsible for all gRPC definitions that we use. | ||
|
||
## Setup | ||
|
||
See the setup guide for the following languages. Support for other languages is not planed! | ||
|
||
### Rust | ||
|
||
See: [Crate](https://crates.io/crates/tucana) | ||
|
||
```toml | ||
[dependencies] | ||
tucana = { version = "<version>" } | ||
``` | ||
|
||
To enable additional features:: | ||
|
||
```toml | ||
[dependencies] | ||
tucana = { version = "<version>", features = ["sagittarius", "aquila"] } | ||
``` | ||
|
||
### Ruby | ||
|
||
See: [Gem](https://rubygems.org/gems/tucana) | ||
|
||
```ruby | ||
gem 'tucana', '<version>' | ||
``` | ||
|
||
Don't forget to initialize the required feature: | ||
```ruby | ||
# For Sagittarius | ||
Tucana.load_protocol(:sagittarius) | ||
|
||
# For Aquila | ||
Tucana.load_protocol(:aquila) | ||
``` | ||
|
||
## Project Structure | ||
|
||
The project is organized with services functioning as servers. Each protocol in the Sagittarius folder corresponds to | ||
services that Sagittarius must implement as a server. | ||
|
||
```ascii-tree | ||
. | ||
├── aquila | ||
│ ├── action - Action service (emits events, manages configs, and handles executions) | ||
│ └── execution - Execution service (handles internal execution calls) | ||
├── sagittarius | ||
│ ├── action - Action service (manages logon/logoff requests for action configurations) | ||
│ ├── datatype - DataType service | ||
│ ├── flow - Flow service (handles flow updates) | ||
│ ├── flow_definition - Defines types for flows | ||
│ ├── node - Defines types for nodes | ||
│ └── ping - Ping service (performs life checks) | ||
└── shared | ||
├── datatype_definition - Defines types for data types | ||
├── runtime_function_definition - Defines types for runtime functions | ||
└── translations - Contains translations with country codes and translated messages | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/struct.proto"; | ||
import "runtime_function_definition.proto"; | ||
import "datatype_definition.proto"; | ||
import "translations.proto"; | ||
import "event.proto"; | ||
|
||
option ruby_package = "Tucana::Aquila"; | ||
|
||
package aquila; | ||
|
||
// Event that gets admitted by an action | ||
message Event { | ||
// Id of Event type | ||
string event_type = 1; | ||
// Payload (JSON) of event params | ||
google.protobuf.Value payload = 2; | ||
} | ||
|
||
// Action flow/event configuration | ||
message Configuration { | ||
// Action identifier | ||
string identifier = 1; | ||
// Flow Configuration | ||
repeated shared.RuntimeFunctionDefinition function_definitions = 2; | ||
// Event Configuration | ||
repeated shared.EventType event_types = 3; | ||
// Application Configuration | ||
repeated ActionConfiguration action_configurations = 4; | ||
} | ||
|
||
message ActionConfiguration { | ||
repeated shared.Translation name = 1; | ||
repeated shared.Translation description = 2; | ||
shared.DataType type = 3; | ||
optional google.protobuf.Value default_value = 4; | ||
} | ||
|
||
// Request to execute a request a flow | ||
message ExecutionRequest { | ||
// Execution identifier of execution | ||
string execution_identifier = 1; | ||
// Function identifier of flow to execute | ||
string function_identifier = 2; | ||
// Parameters (JSON) of flow required to execute | ||
google.protobuf.Struct parameters = 3; | ||
} | ||
|
||
// Result from executed flows by an action | ||
message ExecutionResult { | ||
// Identifier of flow to execute | ||
string execution_identifier = 1; | ||
// Result of executed flow | ||
google.protobuf.Value result = 2; | ||
} | ||
|
||
message TransferRequest { | ||
oneof data { | ||
// Configuration of action that will be send to sagittarius | ||
// | ||
// Expected behavior: | ||
// Aquila will abort if the first request is not a configuration | ||
Configuration configuration = 1; | ||
// Event that got admitted | ||
Event event = 2; | ||
// Result of execution that was triggered by a execution request | ||
ExecutionResult result = 3; | ||
} | ||
} | ||
|
||
message TransferResponse { | ||
// Execution request | ||
ExecutionRequest execution = 1; | ||
} | ||
|
||
service ActionTransferService { | ||
// This behavior achieves a bi-directional stream so that both services aren't required to be a server & client on their own | ||
rpc Transfer (stream TransferRequest) returns (stream TransferResponse); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/struct.proto"; | ||
import "translations.proto"; | ||
import "datatype_definition.proto"; | ||
|
||
option ruby_package = "Tucana::Shared"; | ||
|
||
package shared; | ||
|
||
message EventDefinitionSettings { | ||
repeated Translation name = 1; | ||
bool unique = 2; | ||
repeated Translation description = 3; | ||
DataType type = 4; | ||
optional google.protobuf.Value default_value = 5; | ||
} | ||
|
||
message EventDefinition { | ||
repeated EventDefinitionSettings settings = 1; | ||
DataType input_type = 2; | ||
bool editable = 3; | ||
} | ||
|
||
message EventType { | ||
repeated Translation name = 1; | ||
EventDefinition definition = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
syntax = "proto3"; | ||
|
||
import "datatype_definition.proto"; | ||
|
||
option ruby_package = "Tucana::Shared"; | ||
|
||
package shared; | ||
|
||
message RuntimeFunctionDefinition { | ||
string runtime_id = 1; | ||
optional RuntimeParameterDefinitions runtime_parameter_definitions = 2; | ||
optional DataType return_type = 3; | ||
} | ||
|
||
message RuntimeParameterDefinitions { | ||
repeated RuntimeFunctionDefinition parameters = 1; | ||
} | ||
|
||
message RuntimeParameterDefinition { | ||
DataType type = 1; | ||
string name = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters