Architecture
Diagram¶
%%{init: {'securityLevel': 'loose', 'theme':'base'}}%%
graph TD
K["Controller Entry <br/>(controller)"]
A["Parse CLI <br/>(lama2cmd)"]
B["Parser <br/>(parser)"]
D["Request Executor <br/>(cmdexec)"]
E["Output Format Manager <br/>(outputmanager)"]
F["Error Reporting (TODO)"]
G["Load input & environment vars <br/>(preprocess)"]
H["Request Command Generator <br/>(cmdgen)"]
I["Lama2 Prettifier"]
J["Data Importer (importer)"]
L["Iterate over blocks <br/>(controller)"]
M["Init Javascript processor VM <br/>(cmdexec)"]
N["Execute JS <br/>(cmdexec)"]
P["Variable expansion (JS + env) <br/>(preprocess)"]
A --> G
A --> J
G --> B
H --> D
K --> A
B --> M
M --> L
L --> |Requestor| P
L --> |Processor| N
N --> E
D --> E
B --> F
A --> I
P --> H
L --> L
Description¶
From a high level, how does it work now?
- Read API file
- Create a tree-like structure based on
*gabs.Container
- Initialize Javascript VM for executing JS blocks
- For each block
- If block is JS Processor block
- Execute JS code in VM
- Else if block is Requestor block
- Replace variables with values in the following order
- Try fetch variable from Javascript VM
- If (1) fails, try fetch Local env variable from
l2.env
- Try fetch root env variable from
l2config.env
- Use the processed elements to create an httpie-go request
- Fetch response
- Replace variables with values in the following order
- If block is JS Processor block
- If necessary, write the last transaction to
.json
file