From 08d074eaa6c3f68fd9192379e5b4dd8f7fc54563 Mon Sep 17 00:00:00 2001 From: siyul-park Date: Sat, 14 Sep 2024 04:38:34 -0400 Subject: [PATCH] docs: add node documents --- README.md | 92 ++++++------- README_kr.md | 87 ++++++------ cmd/README.md | 18 +-- cmd/README_kr.md | 16 +-- docs/architecture.md | 246 +++++----------------------------- docs/architecture_kr.md | 238 ++++---------------------------- docs/debugging.md | 28 ++-- docs/debugging_kr.md | 6 +- docs/getting_started.md | 18 +-- docs/getting_started_kr.md | 4 +- docs/key_concepts.md | 8 +- docs/key_concepts_kr.md | 2 +- docs/user_extensions.md | 27 ++-- docs/user_extensions_kr.md | 16 ++- driver/README.md | 4 +- driver/README_kr.md | 2 +- ext/README.md | 42 +++++- ext/README_kr.md | 44 +++++- ext/docs/block_node.md | 39 ++++++ ext/docs/block_node_kr.md | 39 ++++++ ext/docs/call_node.md | 27 ++++ ext/docs/call_node_kr.md | 27 ++++ ext/docs/fork_node.md | 23 ++++ ext/docs/fork_node_kr.md | 23 ++++ ext/docs/gateway_node.md | 70 ++++++++++ ext/docs/gateway_node_kr.md | 70 ++++++++++ ext/docs/http_node.md | 49 +++++++ ext/docs/http_node_kr.md | 49 +++++++ ext/docs/if_node.md | 28 ++++ ext/docs/if_node_kr.md | 28 ++++ ext/docs/listener_node.md | 42 ++++++ ext/docs/listener_node_kr.md | 42 ++++++ ext/docs/loop_node.md | 27 ++++ ext/docs/loop_node_kr.md | 27 ++++ ext/docs/merge_node.md | 40 ++++++ ext/docs/merge_node_kr.md | 40 ++++++ ext/docs/native_node.md | 29 ++++ ext/docs/native_node_kr.md | 29 ++++ ext/docs/nop_node.md | 25 ++++ ext/docs/nop_node_kr.md | 25 ++++ ext/docs/print_node.md | 26 ++++ ext/docs/print_node_kr.md | 26 ++++ ext/docs/router_node.md | 51 +++++++ ext/docs/router_node_kr.md | 51 +++++++ ext/docs/scan_node.md | 26 ++++ ext/docs/scan_node_kr.md | 26 ++++ ext/docs/session_node.md | 54 ++++++++ ext/docs/session_node_kr.md | 54 ++++++++ ext/docs/snippet_node.md | 30 +++++ ext/docs/snippet_node_kr.md | 30 +++++ ext/docs/split_node.md | 25 ++++ ext/docs/split_node_kr.md | 25 ++++ ext/docs/sql_node.md | 42 ++++++ ext/docs/sql_node_kr.md | 42 ++++++ ext/docs/switch_node.md | 33 +++++ ext/docs/switch_node_kr.md | 33 +++++ ext/docs/websocket_node.md | 64 +++++++++ ext/docs/websocket_node_kr.md | 64 +++++++++ ext/pkg/control/block.go | 14 +- ext/pkg/control/call.go | 4 +- ext/pkg/control/fork.go | 6 +- ext/pkg/control/if.go | 13 +- ext/pkg/control/loop.go | 8 +- ext/pkg/control/merge.go | 4 +- ext/pkg/control/session.go | 2 +- ext/pkg/control/snippet.go | 4 +- ext/pkg/control/split.go | 2 +- ext/pkg/io/print.go | 2 +- ext/pkg/io/scan.go | 2 +- ext/pkg/io/sql.go | 2 +- ext/pkg/network/gateway.go | 2 +- ext/pkg/network/http.go | 2 +- ext/pkg/network/listener.go | 2 +- ext/pkg/network/websocket.go | 2 +- 74 files changed, 1840 insertions(+), 629 deletions(-) create mode 100644 ext/docs/block_node.md create mode 100644 ext/docs/block_node_kr.md create mode 100644 ext/docs/call_node.md create mode 100644 ext/docs/call_node_kr.md create mode 100644 ext/docs/fork_node.md create mode 100644 ext/docs/fork_node_kr.md create mode 100644 ext/docs/gateway_node.md create mode 100644 ext/docs/gateway_node_kr.md create mode 100644 ext/docs/http_node.md create mode 100644 ext/docs/http_node_kr.md create mode 100644 ext/docs/if_node.md create mode 100644 ext/docs/if_node_kr.md create mode 100644 ext/docs/listener_node.md create mode 100644 ext/docs/listener_node_kr.md create mode 100644 ext/docs/loop_node.md create mode 100644 ext/docs/loop_node_kr.md create mode 100644 ext/docs/merge_node.md create mode 100644 ext/docs/merge_node_kr.md create mode 100644 ext/docs/native_node.md create mode 100644 ext/docs/native_node_kr.md create mode 100644 ext/docs/nop_node.md create mode 100644 ext/docs/nop_node_kr.md create mode 100644 ext/docs/print_node.md create mode 100644 ext/docs/print_node_kr.md create mode 100644 ext/docs/router_node.md create mode 100644 ext/docs/router_node_kr.md create mode 100644 ext/docs/scan_node.md create mode 100644 ext/docs/scan_node_kr.md create mode 100644 ext/docs/session_node.md create mode 100644 ext/docs/session_node_kr.md create mode 100644 ext/docs/snippet_node.md create mode 100644 ext/docs/snippet_node_kr.md create mode 100644 ext/docs/split_node.md create mode 100644 ext/docs/split_node_kr.md create mode 100644 ext/docs/sql_node.md create mode 100644 ext/docs/sql_node_kr.md create mode 100644 ext/docs/switch_node.md create mode 100644 ext/docs/switch_node_kr.md create mode 100644 ext/docs/websocket_node.md create mode 100644 ext/docs/websocket_node_kr.md diff --git a/README.md b/README.md index 1c15451d..af535e51 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,21 @@ ## ๐Ÿ“ Overview -**Uniflow** efficiently manages a wide range of tasks, from short-term jobs to long-term processes. It supports declarative definitions and dynamic modifications of data flows. With [built-in extension capabilities](./ext/README.md), you can easily implement complex workflows and extend functionalities by adding or removing nodes as needed. +**Uniflow** is designed to manage a wide range of tasks, from short-term jobs to long-term processes. It supports declarative workflow definitions and allows for dynamic changes to data flows. With [built-in extensions](./ext/README.md), you can implement complex workflows and add or remove nodes to expand its functionality as needed. -Deliver a personalized experience through your service and continually expand its capabilities. +This system empowers you to deliver customized experiences through your service and continuously enhance its capabilities. ## ๐ŸŽฏ Core Values -- **Performance:** Optimize throughput and minimize latency across diverse environments. -- **Flexibility:** Dynamically modify and adjust workflows in real-time. -- **Extensibility:** Expand system functionality with new components. +- **Performance:** Maximize throughput and minimize latency across various environments. +- **Flexibility:** Modify and adjust workflows in real-time. +- **Extensibility:** Easily extend functionality with new components. ## ๐Ÿš€ Quick Start ### ๐Ÿ› ๏ธ Build and Install -**[Go 1.23](https://go.dev/doc/install)** or higher is required. Follow these steps to build the source code: +To begin, install **[Go 1.23](https://go.dev/doc/install)** or later. Then, follow these steps to build the source code: ```sh git clone https://github.com/siyul-park/uniflow @@ -35,11 +35,11 @@ make init make build ``` -After building, the executable will be located in the `dist` directory. +The executable will be located in the `dist` directory after building. ### โšก Running an Example -To run a basic HTTP request handler example provided in [ping.yaml](./examples/ping.yaml): +To run a basic HTTP request handler example using [ping.yaml](./examples/ping.yaml): ```yaml - kind: listener @@ -68,13 +68,13 @@ To run a basic HTTP request handler example provided in [ping.yaml](./examples/p code: pong ``` -To execute the workflow, use: +To start the workflow, run: ```sh uniflow start --from-nodes example/ping.yaml ``` -Verify it's working by calling the HTTP endpoint: +Verify it's running by calling the HTTP endpoint: ```sh curl localhost:8000/ping @@ -83,18 +83,18 @@ pong# ## โš™๏ธ Configuration -Settings can be configured through the `.uniflow.toml` file or system environment variables. +Settings can be adjusted via the `.uniflow.toml` file or environment variables. -| TOML Key | Environment Variable Key | Example | -|-----------------------|--------------------------|----------------------------| -| `database.url` | `DATABASE.URL` | `mem://` or `mongodb://` | -| `database.name` | `DATABASE.NAME` | - | -| `collection.nodes` | `COLLECTION.NODES` | `nodes` | -| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` | +| TOML Key | Environment Variable Key | Example | +|----------------------|--------------------------|---------------------------| +| `database.url` | `DATABASE.URL` | `mem://` or `mongodb://` | +| `database.name` | `DATABASE.NAME` | - | +| `collection.nodes` | `COLLECTION.NODES` | `nodes` | +| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` | ## ๐Ÿ“Š Benchmark -Here are benchmark results conducted on a **[Contabo](https://contabo.com/)** VPS S SSD (4 cores, 8GB) environment using the [Apache HTTP server benchmarking tool](https://httpd.apache.org/docs/2.4/programs/ab.html). The benchmark measures the performance of the [ping.yaml](./examples/ping.yaml) workflow, consisting of `listener`, `router`, and `snippet` nodes. +The benchmark below was conducted on a **[Contabo](https://contabo.com/)** VPS S SSD (4 cores, 8GB) using the [Apache HTTP benchmarking tool](https://httpd.apache.org/docs/2.4/programs/ab.html). It measures the performance of the [ping.yaml](./examples/ping.yaml) workflow, including `listener`, `router`, and `snippet` nodes. ```sh ab -n 102400 -c 1024 http://127.0.0.1:8000/ping @@ -108,51 +108,51 @@ Server Port: 8000 Document Path: /ping Document Length: 4 bytes Concurrency Level: 1024 -Time taken for tests: 13.760 seconds -Complete requests: 102400 +Time taken for tests: 122.866 seconds +Complete requests: 1024000 Failed requests: 0 -Total transferred: 12288000 bytes -HTML transferred: 409600 bytes -Requests per second: 7441.92 [#/sec] (mean) -Time per request: 137.599 [ms] (mean) -Time per request: 0.134 [ms] (mean, across all concurrent requests) -Transfer rate: 872.10 [Kbytes/sec] received +Total transferred: 122880000 bytes +HTML transferred: 4096000 bytes +Requests per second: 8334.29 [#/sec] (mean) +Time per request: 122.866 [ms] (mean) +Time per request: 0.120 [ms] (mean, across all concurrent requests) +Transfer rate: 976.67 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max -Connect: 0 1 3.1 0 34 -Processing: 0 136 58.2 137 550 -Waiting: 0 135 58.2 137 550 -Total: 0 137 58.0 139 553 +Connect: 0 2 3.8 0 56 +Processing: 0 121 53.4 121 593 +Waiting: 0 120 53.4 121 592 +Total: 0 123 53.3 123 594 Percentage of the requests served within a certain time (ms) - 50% 139 - 66% 162 - 75% 174 - 80% 181 - 90% 202 - 95% 223 - 98% 264 - 99% 295 - 100% 553 (longest request) + 50% 123 + 66% 143 + 75% 155 + 80% 163 + 90% 185 + 95% 207 + 98% 240 + 99% 266 + 100% 594 (longest request) ``` ## ๐Ÿ“š Learn More -- [Getting Started](./docs/getting_started.md): Introduces CLI installation and workflow management. -- [Key Concepts](./docs/key_concepts.md): Explains fundamental concepts like nodes, connections, ports, and packets. -- [Architecture](./docs/architecture.md): Details the process of loading node specifications and executing workflows. -- [Debugging](./docs/debugging.md): Covers how to start a debugging session, set breakpoints, and inspect states for effective debugging. -- [User Extensions](./docs/user_extensions.md): Guides on adding new features and integrating with existing services. +- [Getting Started](./docs/getting_started.md): Learn how to install the CLI and manage workflows. +- [Key Concepts](./docs/key_concepts.md): Understand nodes, connections, ports, and packets. +- [Architecture](./docs/architecture.md): Explore how workflows are executed and node specifications are loaded. +- [Debugging](./docs/debugging.md): Learn how to debug workflows, set breakpoints, and start sessions. +- [User Extensions](./docs/user_extensions.md): Learn to add features and integrate with external services. ## ๐ŸŒ Community and Support - [Discussion Forum](https://github.com/siyul-park/uniflow/discussions): Share questions and feedback. -- [Issue Tracker](https://github.com/siyul-park/uniflow/issues): Submit bug reports and feature requests. +- [Issue Tracker](https://github.com/siyul-park/uniflow/issues): Submit bug reports and request new features. ## ๐Ÿ“œ License -This project is distributed under the [MIT License](./LICENSE). You are free to use, modify, and distribute it under the terms of the license. +This project is released under the [MIT License](./LICENSE). You are free to use, modify, and distribute it as per the terms of the license. diff --git a/README_kr.md b/README_kr.md index 4e59bdd3..6e5d2f7e 100644 --- a/README_kr.md +++ b/README_kr.md @@ -6,25 +6,25 @@ [![check][repo_check_img]][repo_check_url] [![code coverage][go_code_coverage_img]][go_code_coverage_url] -**๊ณ ์„ฑ๋Šฅ๊ณผ ์œ ์—ฐ์„ฑ์„ ๊ฒธ๋น„ํ•œ ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ๋ฒ”์šฉ ์›Œํฌํ”Œ๋กœ์šฐ ์—”์ง„.** +**๋†’์€ ์„ฑ๋Šฅ๊ณผ ๋›ฐ์–ด๋‚œ ์œ ์—ฐ์„ฑ์„ ๊ฒธ๋น„ํ•œ ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ๋ฒ”์šฉ ์›Œํฌํ”Œ๋กœ์šฐ ์—”์ง„.** ## ๐Ÿ“ ๊ฐœ์š” -**Uniflow**๋Š” ๋‹จ๊ธฐ ์ž‘์—…๋ถ€ํ„ฐ ์žฅ๊ธฐ ํ”„๋กœ์„ธ์Šค๊นŒ์ง€ ๋‹ค์–‘ํ•œ ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์„ ์–ธ์ ์œผ๋กœ ์ •์˜ํ•˜๊ณ  ๋™์ ์œผ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, [๋‚ด์žฅ ํ™•์žฅ ๊ธฐ๋Šฅ](./ext/README_kr.md)์„ ํ™œ์šฉํ•˜์—ฌ ๋ณต์žกํ•œ ์›Œํฌํ”Œ๋กœ์šฐ๋„ ์‰ฝ๊ฒŒ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฒŒ๋‹ค๊ฐ€ ํ•„์š”์— ๋”ฐ๋ผ ์ƒˆ๋กœ์šด ๋…ธ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ๊ธฐ์กด ๋…ธ๋“œ๋ฅผ ์ œ๊ฑฐํ•˜์—ฌ ๊ธฐ๋Šฅ์„ ์œ ์—ฐํ•˜๊ฒŒ ํ™•์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +**Uniflow**๋Š” ๋‹จ๊ธฐ ์ž‘์—…๋ถ€ํ„ฐ ์žฅ๊ธฐ ํ”„๋กœ์„ธ์Šค๊นŒ์ง€ ๋‹ค์–‘ํ•œ ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ์›Œํฌํ”Œ๋กœ์šฐ ์—”์ง„์ž…๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์„ ์–ธ์ ์œผ๋กœ ์ •์˜ํ•˜๋ฉฐ, ๋™์  ์ˆ˜์ •์ด ๊ฐ€๋Šฅํ•ด ์—…๋ฌด ์š”๊ตฌ ์‚ฌํ•ญ์— ๋งž๊ฒŒ ์œ ์—ฐํ•˜๊ฒŒ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ, [๊ธฐ๋ณธ ํ™•์žฅ ๊ธฐ๋Šฅ](./ext/README_kr.md)์„ ํ†ตํ•ด ๋ณต์žกํ•œ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ๊ตฌํ˜„ํ•˜๊ณ , ํ•„์š”์— ๋”ฐ๋ผ ์ƒˆ๋กœ์šด ๋…ธ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ์ œ๊ฑฐํ•˜์—ฌ ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -์—ฌ๋Ÿฌ๋ถ„์˜ ์„œ๋น„์Šค์— ๊ฐœ์ธํ™”๋œ ๊ฒฝํ—˜์„ ์ œ๊ณตํ•˜๊ณ , ์ง€์†์ ์œผ๋กœ ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•ด ๋‚˜๊ฐ€์„ธ์š”. +์„œ๋น„์Šค์— ๊ฐœ์ธ ๋งž์ถคํ˜• ๊ฒฝํ—˜์„ ์ œ๊ณตํ•˜๊ณ , ์ง€์†์ ์œผ๋กœ ๋ฐœ์ „์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋ฐ˜์„ ๋งˆ๋ จํ•˜์„ธ์š”. ## ๐ŸŽฏ ํ•ต์‹ฌ ๊ฐ€์น˜ -- **์„ฑ๋Šฅ:** ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ์—์„œ ์ตœ์ ์˜ ์ฒ˜๋ฆฌ๋Ÿ‰๊ณผ ์ตœ์†Œ ์ง€์—ฐ ์‹œ๊ฐ„์„ ์‹คํ˜„ํ•ฉ๋‹ˆ๋‹ค. -- **์œ ์—ฐ์„ฑ:** ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ๋™์ ์œผ๋กœ ์ˆ˜์ •ํ•˜๊ณ  ์‹ค์‹œ๊ฐ„์œผ๋กœ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -- **ํ™•์žฅ์„ฑ:** ์ƒˆ๋กœ์šด ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ†ตํ•ด ์‹œ์Šคํ…œ ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- **์„ฑ๋Šฅ:** ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ์—์„œ ์ตœ๋Œ€์˜ ์ฒ˜๋ฆฌ๋Ÿ‰๊ณผ ์ตœ์†Œ์˜ ์ง€์—ฐ ์‹œ๊ฐ„์„ ๋‹ฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. +- **์œ ์—ฐ์„ฑ:** ์‹ค์‹œ๊ฐ„์œผ๋กœ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์ˆ˜์ •ํ•˜๊ณ  ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- **ํ™•์žฅ์„ฑ:** ์†์‰ฝ๊ฒŒ ์ƒˆ๋กœ์šด ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ## ๐Ÿš€ ๋น ๋ฅธ ์‹œ์ž‘ ### ๐Ÿ› ๏ธ ๋นŒ๋“œ ๋ฐ ์„ค์น˜ -**[Go 1.23](https://go.dev/doc/install)** ์ด์ƒ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๋นŒ๋“œํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฅด์„ธ์š”: +**[Go 1.23](https://go.dev/doc/install)** ์ด์ƒ์„ ์„ค์น˜ํ•œ ํ›„, ์•„๋ž˜ ๋‹จ๊ณ„๋ฅผ ํ†ตํ•ด ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๋นŒ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```sh git clone https://github.com/siyul-park/uniflow @@ -39,7 +39,7 @@ make build ### โšก ์˜ˆ์ œ ์‹คํ–‰ -๊ธฐ๋ณธ์ ์ธ HTTP ์š”์ฒญ ์ฒ˜๋ฆฌ ์˜ˆ์ œ์ธ [ping.yaml](./examples/ping.yaml)์„ ์‹คํ–‰ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค: +๋‹ค์Œ์€ HTTP ์š”์ฒญ ์ฒ˜๋ฆฌ ์˜ˆ์ œ์ธ [ping.yaml](./examples/ping.yaml)์„ ์‹คํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค: ```yaml - kind: listener @@ -68,22 +68,22 @@ make build code: pong ``` -์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‹คํ–‰ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”: +๋‹ค์Œ ๋ช…๋ น์–ด๋กœ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค: ```sh uniflow start --from-nodes example/ping.yaml ``` -์ •์ƒ ์ž‘๋™ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด HTTP ์—”๋“œํฌ์ธํŠธ๋ฅผ ํ˜ธ์ถœํ•ด ๋ณด์„ธ์š”: +์ •์ƒ ์ž‘๋™ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด HTTP ์—”๋“œํฌ์ธํŠธ๋ฅผ ํ˜ธ์ถœํ•˜์„ธ์š”: ```sh curl localhost:8000/ping pong# ``` -## โš™๏ธ ๊ตฌ์„ฑ +## โš™๏ธ ์„ค์ • -ํ™˜๊ฒฝ ์„ค์ •์€ `.uniflow.toml` ํŒŒ์ผ ๋˜๋Š” ์‹œ์Šคํ…œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ํ†ตํ•ด ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +ํ™˜๊ฒฝ ์„ค์ •์€ `.uniflow.toml` ํŒŒ์ผ ๋˜๋Š” ์‹œ์Šคํ…œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ํ†ตํ•ด ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. | TOML ํ‚ค | ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ํ‚ค | ์˜ˆ์‹œ | |----------------------|--------------------------|---------------------------| @@ -94,7 +94,7 @@ pong# ## ๐Ÿ“Š ๋ฒค์น˜๋งˆํฌ -**[Contabo](https://contabo.com/)** VPS S SSD (4์ฝ”์–ด, 8GB) ํ™˜๊ฒฝ์—์„œ ์ˆ˜ํ–‰๋œ ๋ฒค์น˜๋งˆํฌ ๊ฒฐ๊ณผ์ž…๋‹ˆ๋‹ค. [Apache HTTP server benchmarking tool](https://httpd.apache.org/docs/2.4/programs/ab.html)์„ ์‚ฌ์šฉํ•˜์—ฌ `listener`, `router`, `snippet` ๋…ธ๋“œ๋กœ ๊ตฌ์„ฑ๋œ [ping.yaml](./examples/ping.yaml) ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์ธก์ •ํ–ˆ์Šต๋‹ˆ๋‹ค. +๋‹ค์Œ ๋ฒค์น˜๋งˆํฌ๋Š” **[Contabo](https://contabo.com/)** VPS S SSD (4์ฝ”์–ด, 8GB) ํ™˜๊ฒฝ์—์„œ ์ˆ˜ํ–‰๋˜์—ˆ์Šต๋‹ˆ๋‹ค. [Apache HTTP server benchmarking tool](https://httpd.apache.org/docs/2.4/programs/ab.html)์„ ์‚ฌ์šฉํ•˜์—ฌ `listener`, `router`, `snippet` ๋…ธ๋“œ๋กœ ๊ตฌ์„ฑ๋œ [ping.yaml](./examples/ping.yaml) ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ํ…Œ์ŠคํŠธํ–ˆ์Šต๋‹ˆ๋‹ค. ```sh ab -n 102400 -c 1024 http://127.0.0.1:8000/ping @@ -108,51 +108,51 @@ Server Port: 8000 Document Path: /ping Document Length: 4 bytes Concurrency Level: 1024 -Time taken for tests: 13.760 seconds -Complete requests: 102400 +Time taken for tests: 122.866 seconds +Complete requests: 1024000 Failed requests: 0 -Total transferred: 12288000 bytes -HTML transferred: 409600 bytes -Requests per second: 7441.92 [#/sec] (mean) -Time per request: 137.599 [ms] (mean) -Time per request: 0.134 [ms] (mean, across all concurrent requests) -Transfer rate: 872.10 [Kbytes/sec] received +Total transferred: 122880000 bytes +HTML transferred: 4096000 bytes +Requests per second: 8334.29 [#/sec] (mean) +Time per request: 122.866 [ms] (mean) +Time per request: 0.120 [ms] (mean, across all concurrent requests) +Transfer rate: 976.67 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max -Connect: 0 1 3.1 0 34 -Processing: 0 136 58.2 137 550 -Waiting: 0 135 58.2 137 550 -Total: 0 137 58.0 139 553 +Connect: 0 2 3.8 0 56 +Processing: 0 121 53.4 121 593 +Waiting: 0 120 53.4 121 592 +Total: 0 123 53.3 123 594 Percentage of the requests served within a certain time (ms) - 50% 139 - 66% 162 - 75% 174 - 80% 181 - 90% 202 - 95% 223 - 98% 264 - 99% 295 - 100% 553 (longest request) + 50% 123 + 66% 143 + 75% 155 + 80% 163 + 90% 185 + 95% 207 + 98% 240 + 99% 266 + 100% 594 (longest request) ``` -## ๐Ÿ“š ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ +## ๐Ÿ“š ๋” ์•Œ์•„๋ณด๊ธฐ -- [์‹œ์ž‘ํ•˜๊ธฐ](./docs/getting_started_kr.md): CLI ์„ค์น˜ ๋ฐ ์›Œํฌํ”Œ๋กœ์šฐ ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค. -- [ํ•ต์‹ฌ ๊ฐœ๋…](./docs/key_concepts_kr.md): ๋…ธ๋“œ, ์—ฐ๊ฒฐ, ํฌํŠธ, ํŒจํ‚ท ๋“ฑ์˜ ๊ธฐ๋ณธ ๊ฐœ๋…์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. -- [์•„ํ‚คํ…์ฒ˜](./docs/architecture_kr.md): ๋…ธ๋“œ ๋ช…์„ธ ๋กœ๋”ฉ ๋ฐ ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰ ๊ณผ์ •์„ ์ƒ์„ธํžˆ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. -- [๋””๋ฒ„๊น…](./docs/debugging_kr.md): ๋””๋ฒ„๊น… ์„ธ์…˜์„ ์‹œ์ž‘ํ•˜๊ณ , ๋ธŒ๋ ˆ์ดํฌํฌ์ธํŠธ๋ฅผ ์„ค์ •ํ•œ ํ›„, ์ƒํƒœ ์กฐํšŒ๋ฅผ ํ†ตํ•ด ๋””๋ฒ„๊น…ํ•˜๋Š” ๊ณผ์ •์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค. -- [์‚ฌ์šฉ์ž ํ™•์žฅ](./docs/user_extensions_kr.md): ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€ ๋ฐ ๊ธฐ์กด ์„œ๋น„์Šค ํ†ตํ•ฉ ๋ฐฉ๋ฒ•์„ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค. +- [์‹œ์ž‘ํ•˜๊ธฐ](./docs/getting_started_kr.md): CLI ์„ค์น˜ ๋ฐ ์›Œํฌํ”Œ๋กœ์šฐ ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณด์„ธ์š”. +- [ํ•ต์‹ฌ ๊ฐœ๋…](./docs/key_concepts_kr.md): ๋…ธ๋“œ, ์—ฐ๊ฒฐ, ํฌํŠธ, ํŒจํ‚ท ๋“ฑ ์ฃผ์š” ๊ฐœ๋…์„ ์ดํ•ดํ•˜์„ธ์š”. +- [์•„ํ‚คํ…์ฒ˜](./docs/architecture_kr.md): ๋…ธ๋“œ ๋ช…์„ธ ๋กœ๋”ฉ ๋ฐ ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰ ๊ณผ์ •์„ ์‚ดํŽด๋ณด์„ธ์š”. +- [๋””๋ฒ„๊น…](./docs/debugging_kr.md): ์›Œํฌํ”Œ๋กœ์šฐ ๋””๋ฒ„๊น…์„ ํ†ตํ•ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ฐฐ์šฐ์„ธ์š”. +- [์‚ฌ์šฉ์ž ํ™•์žฅ](./docs/user_extensions_kr.md): ์‹œ์Šคํ…œ ํ™•์žฅ ๋ฐ ๊ธฐ์กด ์„œ๋น„์Šค์™€์˜ ํ†ตํ•ฉ ๋ฐฉ๋ฒ•์„ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค. ## ๐ŸŒ ์ปค๋ฎค๋‹ˆํ‹ฐ ๋ฐ ์ง€์› -- [ํ† ๋ก  ํฌ๋Ÿผ](https://github.com/siyul-park/uniflow/discussions): ์งˆ๋ฌธ ๋ฐ ํ”ผ๋“œ๋ฐฑ์„ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -- [์ด์Šˆ ํŠธ๋ž˜์ปค](https://github.com/siyul-park/uniflow/issues): ๋ฒ„๊ทธ ๋ณด๊ณ  ๋ฐ ๊ธฐ๋Šฅ ์š”์ฒญ์„ ์ œ์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- [ํ† ๋ก  ํฌ๋Ÿผ](https://github.com/siyul-park/uniflow/discussions): ์งˆ๋ฌธ ๋ฐ ํ”ผ๋“œ๋ฐฑ์„ ๋‚˜๋ˆŒ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- [์ด์Šˆ ํŠธ๋ž˜์ปค](https://github.com/siyul-park/uniflow/issues): ๋ฒ„๊ทธ๋ฅผ ์‹ ๊ณ ํ•˜๊ฑฐ๋‚˜ ๊ธฐ๋Šฅ ์š”์ฒญ์„ ์ œ์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ## ๐Ÿ“œ ๋ผ์ด์„ผ์Šค -์ด ํ”„๋กœ์ ํŠธ๋Š” [MIT ๋ผ์ด์„ผ์Šค](./LICENSE)์— ๋”ฐ๋ผ ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค. ๋ผ์ด์„ผ์Šค ์กฐ๊ฑด์— ๋”ฐ๋ผ ์ž์œ ๋กญ๊ฒŒ ์‚ฌ์šฉ, ์ˆ˜์ • ๋ฐ ๋ฐฐํฌ๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. +์ด ํ”„๋กœ์ ํŠธ๋Š” [MIT ๋ผ์ด์„ผ์Šค](./LICENSE)์— ๋”ฐ๋ผ ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค. ์ž์œ ๋กญ๊ฒŒ ์‚ฌ์šฉ, ์ˆ˜์ •, ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. @@ -178,4 +178,3 @@ Percentage of the requests served within a certain time (ms) [repo_wiki_faq_url]: https://github.com/siyul-park/uniflow/wiki/FAQ [repo_check_img]: https://github.com/siyul-park/uniflow/actions/workflows/check.yml/badge.svg [repo_check_url]: https://github.com/siyul-park/uniflow/actions/workflows/check.yml -``` diff --git a/cmd/README.md b/cmd/README.md index d5be7d62..9fb6e2db 100644 --- a/cmd/README.md +++ b/cmd/README.md @@ -1,16 +1,16 @@ # ๐Ÿ’ป Command Line Interface (CLI) -Effectively manage the versatile Command Line Interface (CLI) designed for various workflow management tasks. This CLI is provided with the core executable file, including [built-in extensions](../ext/README.md). +Effectively manage your workflows using the versatile Command Line Interface (CLI) designed for a variety of tasks. This CLI is provided as a base executable that includes [built-in extensions](../ext/README.md). ## Configuration -Before executing commands, configure the system using environment variables. You can utilize either the `.uniflow.toml` file or system environment variables. +Before running commands, configure your system using environment variables. You can use either the `.uniflow.toml` file or system environment variables. -| TOML Key | Environment Variable | Example | -|----------------------|----------------------|---------------------------| -| `database.url` | `DATABASE.URL` | `mem://` or `mongodb://` | -| `database.name` | `DATABASE.NAME` | - | -| `collection.nodes` | `COLLECTION.NODES` | `nodes` | -| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` | +| TOML Key | Environment Variable Key | Example | +|-----------------------|----------------------------|----------------------------| +| `database.url` | `DATABASE.URL` | `mem://` or `mongodb://` | +| `database.name` | `DATABASE.NAME` | - | +| `collection.nodes` | `COLLECTION.NODES` | `nodes` | +| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` | -When using [MongoDB](https://www.mongodb.com/), ensure that [change streams](https://www.mongodb.com/docs/manual/changeStreams/) are enabled so the engine can track changes to node specifications. To utilize change streams, set up a [replica set](https://www.mongodb.com/ko-kr/docs/manual/replication/#std-label-replication). +If using [MongoDB](https://www.mongodb.com/), ensure that [Change Streams](https://www.mongodb.com/docs/manual/changeStreams/) are enabled so that the engine can track changes to node specifications. To utilize Change Streams, set up a [Replica Set](https://www.mongodb.com/docs/manual/replication/#std-label-replication). diff --git a/cmd/README_kr.md b/cmd/README_kr.md index d358924d..3540fe3d 100644 --- a/cmd/README_kr.md +++ b/cmd/README_kr.md @@ -1,16 +1,16 @@ # ๐Ÿ’ป ๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค (CLI) -๋‹ค์–‘ํ•œ ์ž‘์—… ํ๋ฆ„ ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•ด ์„ค๊ณ„๋œ ๋‹ค๋ชฉ์  ๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค (CLI)๋ฅผ ํšจ๊ณผ์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜์„ธ์š”. ์ด CLI๋Š” [๋‚ด์žฅ ํ™•์žฅ ๊ธฐ๋Šฅ](../ext/README.md)์„ ํฌํ•จํ•œ ๊ธฐ๋ณธ ์‹คํ–‰ ํŒŒ์ผ๋กœ ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. +๋‹ค์–‘ํ•œ ์ž‘์—… ํ๋ฆ„์„ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์„ค๊ณ„๋œ ๋‹ค๋ชฉ์  ๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค (CLI)๋ฅผ ํšจ๊ณผ์ ์œผ๋กœ ์‚ฌ์šฉํ•˜์„ธ์š”. ์ด CLI๋Š” [๋‚ด์žฅ ํ™•์žฅ ๊ธฐ๋Šฅ](../ext/README.md)์„ ํฌํ•จํ•œ ๊ธฐ๋ณธ ์‹คํ–‰ ํŒŒ์ผ๋กœ ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. ## ๊ตฌ์„ฑ -๋ช…๋ น์„ ์‹คํ–‰ํ•˜๊ธฐ ์ „์— ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‹œ์Šคํ…œ์„ ๊ตฌ์„ฑํ•˜์„ธ์š”. `.uniflow.toml` ํŒŒ์ผ์ด๋‚˜ ์‹œ์Šคํ…œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +๋ช…๋ น์„ ์‹คํ–‰ํ•˜๊ธฐ ์ „์— ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‹œ์Šคํ…œ์„ ๊ตฌ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. `.uniflow.toml` ํŒŒ์ผ์ด๋‚˜ ์‹œ์Šคํ…œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. | TOML ํ‚ค | ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ํ‚ค | ์˜ˆ์‹œ | -|----------------------|----------------------|---------------------------| -| `database.url` | `DATABASE.URL` | `mem://` ๋˜๋Š” `mongodb://` | -| `database.name` | `DATABASE.NAME` | - | -| `collection.nodes` | `COLLECTION.NODES` | `nodes` | -| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` | +|----------------------|--------------------------|----------------------------| +| `database.url` | `DATABASE.URL` | `mem://` ๋˜๋Š” `mongodb://` | +| `database.name` | `DATABASE.NAME` | - | +| `collection.nodes` | `COLLECTION.NODES` | `nodes` | +| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` | -[MongoDB](https://www.mongodb.com/)๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ์—”์ง„์ด ๋…ธ๋“œ ๋ช…์„ธ์˜ ๋ณ€๊ฒฝ์„ ์ถ”์ ํ•  ์ˆ˜ ์žˆ๋„๋ก [๋ณ€๊ฒฝ ์ŠคํŠธ๋ฆผ](https://www.mongodb.com/docs/manual/changeStreams/)์ด ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ณ€๊ฒฝ ์ŠคํŠธ๋ฆผ์„ ์ด์šฉํ•˜๊ธฐ ์œ„ํ•ด [๋ณต์ œ๋ณธ ์„ธํŠธ](https://www.mongodb.com/ko-kr/docs/manual/replication/#std-label-replication)๋ฅผ ํ™œ์šฉํ•˜์„ธ์š”. +[MongoDB](https://www.mongodb.com/)๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ, ์—”์ง„์ด ๋…ธ๋“œ ๋ช…์„ธ์˜ ๋ณ€๊ฒฝ์„ ์ถ”์ ํ•  ์ˆ˜ ์žˆ๋„๋ก [๋ณ€๊ฒฝ ์ŠคํŠธ๋ฆผ](https://www.mongodb.com/docs/manual/changeStreams/)์„ ํ™œ์„ฑํ™”ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ณ€๊ฒฝ ์ŠคํŠธ๋ฆผ์„ ์ด์šฉํ•˜๋ ค๋ฉด [๋ณต์ œ๋ณธ ์„ธํŠธ](https://www.mongodb.com/ko-kr/docs/manual/replication/#std-label-replication)๋ฅผ ์„ค์ •ํ•˜์„ธ์š”. diff --git a/docs/architecture.md b/docs/architecture.md index e0d62cf4..5228176e 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -1,8 +1,8 @@ # ๐Ÿ—๏ธ Architecture -Each node specification declaratively defines the role of each node, and these specifications connect to form workflows. Each workflow is defined within a specific namespace, and each runtime environment executes a single namespace. Namespaces are isolated and cannot reference nodes defined in other namespaces. +Each node specification declaratively defines the role of each node, and these specifications connect to form workflows. Each workflow is defined within a specific namespace, and each runtime environment executes a single namespace. Namespaces are isolated and cannot reference nodes from other namespaces. -```plantext +```text +-------------------------------------------------+ | Workflow A | | +--------------------+ +--------------------+ | @@ -24,15 +24,15 @@ Each node specification declaratively defines the role of each node, and these s +-------------------------------------------------+ ``` -The engine does not enforce the use of specific nodes. All nodes connect to the engine through extensions and can be freely added or removed according to the service needs. +The engine does not enforce specific nodes. Nodes connect to the engine through extensions and can be freely added or removed based on service requirements. -To effectively execute node specifications, two main processesโ€”compilation and runtimeโ€”are employed. These processes help reduce complexity and optimize performance. +To optimize execution, two key processesโ€”compilation and runtimeโ€”are employed. These processes reduce complexity and improve performance. ## Workflow Modification -The engine does not expose an API to users for modifying node specifications. Instead, the engine focuses solely on loading, compiling, and activating nodes to make them executable. +The engine does not expose an API for directly modifying node specifications. Instead, it focuses on loading, compiling, and activating nodes to make them executable. -To modify node specifications, users can update the database using a Command-Line Interface (CLI) or define workflows that provide an HTTP API to modify node specifications. Typically, such workflows are defined in the `system` namespace. +Users can update node specifications by using a Command-Line Interface (CLI) or defining workflows that provide an HTTP API for modifications. Typically, these workflows are defined in the `system` namespace. ```yaml - kind: listener @@ -75,28 +75,28 @@ To modify node specifications, users can update the database using a Command-Lin path: /v1/secrets port: out[7] ports: - out[0]: + out[0]: - name: nodes_create port: in - out[1]: + out[1]: - name: nodes_read port: in - out[2]: + out[2]: - name: nodes_update port: in - out[3]: + out[3]: - name: nodes_delete port: in - out[4]: + out[4]: - name: secrets_create port: in - out[5]: + out[5]: - name: secrets_read port: in - out[6]: + out[6]: - name: secrets_update port: in - out[7]: + out[7]: - name: secrets_delete port: in @@ -118,179 +118,18 @@ To modify node specifications, users can update the database using a Command-Lin }; } -- kind: block - name: nodes_read - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: nodes.read - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: nodes_update - specs: - - kind: snippet - language: cel - code: 'has(self.body) ? self.body : null' - - kind: native - opcode: nodes.update - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: nodes_delete - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: nodes.delete - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - status: 204 - }; - } - -- kind: block - name: secrets_create - specs: - - kind: snippet - language: cel - code: 'has(self.body) ? self.body : null' - - kind: native - opcode: secrets.create - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 201 - }; - } - -- kind: block - name: secrets_read - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: secrets.read - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: secrets_update - specs: - - kind: snippet - language: cel - code: 'has(self.body) ? self.body : null' - - kind: native - opcode: secrets.update - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: secrets_delete - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: secrets.delete - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - status: 204 - }; - } - -- kind: switch - name: catch - matches: - - when: self == "unsupported type" || self == "unsupported value" - port: out[0] - - when: 'true' - port: out[1] - ports: - out[0]: - - name: status_400 - port: in - out[1]: - - name: status_500 - port: in - -- kind: snippet - name: status_400 - language: javascript - code: | - export default function (args) { - return { - body: { - error: args.error() - }, - status: 400 - }; - } - -- kind: snippet - name: status_500 - language: json - code: | - { - "body": { - "error": "Internal Server Error" - }, - "status": 500 - } +# Additional blocks for reading, updating, deleting nodes and secrets ``` -This approach ensures the runtime environment remains stable while allowing flexible system expansion as needed. +This approach ensures runtime stability while allowing flexible system expansion. ## Compilation Process -The loader tracks real-time changes to node specifications and secrets in the database through a change stream. When additions, modifications, or deletions occur, the loader detects these changes and dynamically reloads them from the database. The specifications are then compiled into executable forms using codecs defined in the schema. This process involves caching and optimization to enhance performance. +The loader tracks changes to node specifications and secrets in real-time through a change stream. When additions, modifications, or deletions occur, the loader dynamically reloads the specifications from the database. These specifications are compiled into executable forms using codecs defined in the schema, with caching and optimization to enhance performance. -The compiled nodes are transformed into symbols and stored in a symbol table. The symbol table connects each symbol's ports based on the port connection information defined in the node specifications. +Compiled nodes are transformed into symbols and stored in a symbol table. The symbol table connects each symbol's ports based on the port connection information in the node specifications. -```plantext +```text +--------------------------+ | Database | | +--------------------+ | @@ -299,42 +138,27 @@ The compiled nodes are transformed into symbols and stored in a symbol table. Th | | Node Specification | | | +--------------------+ | +-------------------+ | | Node Specification | |-->| Loader | - | +--------------------+ | | +-------------+ | - +--------------------------+ | | Scheme | | + | +--------------------+ | | +-------------+ | + +--------------------------+ | | Scheme | | +--------------------------+ | | +-------+ | | - | Database | | | | Codec | | |--+ - | +--------+ +--------+ | | | +-------+ | | | - | | Secret | | Secret | |-->| +-------------+ | | - | +--------+ +--------+ | +-------------------+ | - | +--------+ +--------+ | | - | | Secret | | Secret | | | - | +--------+ +--------+ | | - +--------------------------+ | - +-------------------------+ | - | Symbol Table | | - | +--------+ +--------+ | | - | | Symbol | | Symbol |<-----------------------------+ - | +--------+ +--------+ | - | \|/ | - | +--------+ +--------+ | - | | Symbol | | Symbol | | - | +--------+ +--------+ | - +-------------------------+ + | Database | | | | Codec | | | + | +--------+ +--------+ | | | +-------+ | | + | | Secret | | Secret | |-->| +-------------+ | + | +--------+ +--------+ | +-------------------+ + +--------------------------+ ``` -Once all nodes within a workflow are loaded into the symbol table and all ports are connected, the workflow executes load hooks sequentially from internal nodes to external nodes to activate them. Conversely, if a specific node is removed from the symbol table and becomes non-executable, unload hooks are executed in reverse order to deactivate all nodes that reference the affected node. +Once all nodes in a workflow are loaded into the symbol table and ports are connected, load hooks are executed to activate nodes. If a node is removed, unload hooks deactivate dependent nodes. -Any changes to node specifications in the database are propagated to all runtime environments through this process. +Changes in node specifications propagate to all runtime environments. ## Runtime Process -Activated nodes monitor sockets or files and execute workflows. Each node starts by spawning an independent process, isolating its execution flow from other processes. This approach ensures efficient resource management and minimizes impact on other tasks. - -Each node opens ports through processes and creates writers to send packets to connected nodes. The payload of these packets is converted into common types used in the runtime for transmission. +Activated nodes monitor sockets or files and execute workflows. Each node spawns an independent process, isolating its execution flow from other nodes to optimize resource management. -Connected nodes monitor whether a new process has opened the port and create readers accordingly. These readers continuously process waiting packets and pass the processed results to the next node or return them. +Nodes open ports through these processes and create writers to send packets to connected nodes. The payload is converted into common types for transmission. Connected nodes create readers to process waiting packets and pass the results to the next node or return them. -```plantext +```text +-----------------------+ +-----------------------+ | Node A | | Node B | | +-----------------+ | | +-----------------+ | @@ -350,10 +174,10 @@ Connected nodes monitor whether a new process has opened the port and create rea +-----------------------+ +-----------------------+ ``` -A single reader processes and responds to all packets sequentially, and packets sent by writers must be returned as response packets. This mechanism ensures smooth communication between nodes and maintains data consistency and integrity. +Each reader processes packets sequentially and responds. Writers must return packets as responses to ensure smooth node communication and data consistency. -Nodes that execute workflows wait until responses for all sent packets are returned before terminating the process and releasing allocated resources. If an error occurs during packet processing, resulting in an error response, the node logs the error and terminates the process. +Nodes wait for responses to all sent packets before terminating the process and releasing allocated resources. If an error occurs, the node logs the error and terminates. -Upon process termination, the system verifies normal termination and releases all associated resources, including open file descriptors, allocated memory, and database transactions. +Upon process termination, the system releases all associated resources, including open file descriptors, memory, and database transactions. When a parent process terminates, all child processes terminate as well. The parent process typically waits until all child processes have completed. -When a parent process terminates, all derived child processes also terminate. Typically, the parent process waits until all child processes have terminated. +This architecture ensures efficient node communication, data integrity, and stable execution across workflows. diff --git a/docs/architecture_kr.md b/docs/architecture_kr.md index 1aa54266..cbe0f4b6 100644 --- a/docs/architecture_kr.md +++ b/docs/architecture_kr.md @@ -1,8 +1,8 @@ -# ๐Ÿ—๏ธ ์•„ํ‚คํ…์ฒ˜ +### ๐Ÿ—๏ธ ์•„ํ‚คํ…์ฒ˜ -๊ฐ ๋…ธ๋“œ ๋ช…์„ธ๋Š” ๊ฐ ๋…ธ๋“œ์˜ ์—ญํ• ์„ ์„ ์–ธ์ ์œผ๋กœ ์ •์˜ํ•˜๋ฉฐ, ์ด๋Ÿฌํ•œ ๋ช…์„ธ๋“ค์ด ์„œ๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ํ˜•์„ฑํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ์›Œํฌํ”Œ๋กœ์šฐ๋Š” ํŠน์ • ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ์ •์˜๋˜๋ฉฐ, ๊ฐ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์€ ํ•˜๋‚˜์˜ ๋„ค์ž„์ŠคํŽ˜์ด์Šค๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๋„ค์ž„์ŠคํŽ˜์ด์Šค๋Š” ๋‹ค๋ฅธ ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ์ •์˜๋œ ๋…ธ๋“œ๋ฅผ ์ฐธ์กฐํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ๊ฐ๊ฐ ๊ฒฉ๋ฆฌ๋˜์–ด ๊ด€๋ฆฌ๋ฉ๋‹ˆ๋‹ค. +๊ฐ ๋…ธ๋“œ ๋ช…์„ธ๋Š” ๊ฐ ๋…ธ๋“œ์˜ ์—ญํ• ์„ ์„ ์–ธ์ ์œผ๋กœ ์ •์˜ํ•˜๋ฉฐ, ์ด๋Ÿฌํ•œ ๋ช…์„ธ๋“ค์ด ์„œ๋กœ ์—ฐ๊ฒฐ๋˜์–ด ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ํ˜•์„ฑํ•ฉ๋‹ˆ๋‹ค. ์›Œํฌํ”Œ๋กœ์šฐ๋Š” ํŠน์ • ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ์ •์˜๋˜๊ณ , ๊ฐ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์€ ํ•˜๋‚˜์˜ ๋„ค์ž„์ŠคํŽ˜์ด์Šค๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๋„ค์ž„์ŠคํŽ˜์ด์Šค๋Š” ๋‹ค๋ฅธ ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ์ •์˜๋œ ๋…ธ๋“œ๋ฅผ ์ฐธ์กฐํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ๊ฐ ๋„ค์ž„์ŠคํŽ˜์ด์Šค๋Š” ๋…๋ฆฝ์ ์œผ๋กœ ๊ฒฉ๋ฆฌ๋˜์–ด ๊ด€๋ฆฌ๋ฉ๋‹ˆ๋‹ค. -```plantext +```text +-------------------------------------------------+ | Workflow A | | +--------------------+ +--------------------+ | @@ -24,15 +24,11 @@ +-------------------------------------------------+ ``` -์—”์ง„์€ ํŠน์ • ๋…ธ๋“œ์˜ ์‚ฌ์šฉ์„ ๊ฐ•์š”ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  ๋…ธ๋“œ๋Š” ํ™•์žฅ์„ ํ†ตํ•ด ์—”์ง„์— ์—ฐ๊ฒฐ๋˜๋ฉฐ, ์„œ๋น„์Šค์— ๋งž๊ฒŒ ์ž์œ ๋กญ๊ฒŒ ์ถ”๊ฐ€๋˜๊ณ  ์ œ๊ฑฐ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +์—”์ง„์€ ํŠน์ • ๋…ธ๋“œ๋ฅผ ๊ฐ•์ œํ•˜์ง€ ์•Š์œผ๋ฉฐ, ๋ชจ๋“  ๋…ธ๋“œ๋Š” ์„œ๋น„์Šค์— ๋งž๊ฒŒ ์ž์œ ๋กญ๊ฒŒ ์ถ”๊ฐ€๋˜๊ณ  ์ œ๊ฑฐ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. -๋…ธ๋“œ ๋ช…์„ธ๋ฅผ ํšจ๊ณผ์ ์œผ๋กœ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ์ปดํŒŒ์ผ๊ณผ ๋Ÿฐํƒ€์ž„์ด๋ผ๋Š” ๋‘ ๊ฐ€์ง€ ์ฃผ์š” ๊ณผ์ •์„ ๊ฑฐ์นฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋ณต์žก์„ฑ์„ ์ค„์ด๊ณ  ์„ฑ๋Šฅ์„ ์ตœ์ ํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +### ์›Œํฌํ”Œ๋กœ์šฐ ์ˆ˜์ • -## ์›Œํฌํ”Œ๋กœ์šฐ ์ˆ˜์ • - -์—”์ง„์€ ๋…ธ๋“œ ๋ช…์„ธ๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋Š” API๋ฅผ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋…ธ์ถœํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋Œ€์‹ , ์—”์ง„์€ ์˜ค์ง ๋…ธ๋“œ๋ฅผ ๋กœ๋“œํ•˜๊ณ  ์ปดํŒŒ์ผํ•˜์—ฌ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ™œ์„ฑํ™”ํ•˜๋Š” ๋ฐ ์ง‘์ค‘ํ•ฉ๋‹ˆ๋‹ค. - -๋…ธ๋“œ ๋ช…์„ธ๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•  ๊ฒฝ์šฐ, Command-Line Interface(CLI)์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ๋ช…์„ธ๋ฅผ ์—…๋ฐ์ดํŠธํ•˜๊ฑฐ๋‚˜, ๋…ธ๋“œ ๋ช…์„ธ๋ฅผ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋Š” ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์ง์ ‘ ์ •์˜ํ•˜์—ฌ HTTP API๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ ์ด๋Ÿฌํ•œ ์›Œํฌํ”Œ๋กœ์šฐ๋Š” `system` ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ์ •์˜๋ฉ๋‹ˆ๋‹ค. +์—”์ง„์€ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋…ธ๋“œ ๋ช…์„ธ ๋ณ€๊ฒฝ์„ ์œ„ํ•œ API๋ฅผ ์ œ๊ณตํ•˜์ง€ ์•Š์œผ๋ฉฐ, ๋…ธ๋“œ๋ฅผ ๋กœ๋“œํ•˜๊ณ  ์ปดํŒŒ์ผํ•˜์—ฌ ์‹คํ–‰ํ•˜๋Š” ๋ฐ ์ง‘์ค‘ํ•ฉ๋‹ˆ๋‹ค. ๋…ธ๋“œ ๋ช…์„ธ๋ฅผ ์ˆ˜์ •ํ•  ํ•„์š”๊ฐ€ ์žˆ์„ ๋•Œ๋Š” Command-Line Interface(CLI)๋‚˜ ์ง์ ‘ ์ •์˜ํ•œ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ํ†ตํ•ด HTTP API๋กœ ๋ช…์„ธ๋ฅผ ์—…๋ฐ์ดํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์›Œํฌํ”Œ๋กœ์šฐ๋Š” ๋ณดํ†ต `system` ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ์ •์˜๋ฉ๋‹ˆ๋‹ค. ```yaml - kind: listener @@ -117,180 +113,15 @@ status: 201 }; } - -- kind: block - name: nodes_read - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: nodes.read - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: nodes_update - specs: - - kind: snippet - language: cel - code: 'has(self.body) ? self.body : null' - - kind: native - opcode: nodes.update - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: nodes_delete - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: nodes.delete - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - status: 204 - }; - } - -- kind: block - name: secrets_create - specs: - - kind: snippet - language: cel - code: 'has(self.body) ? self.body : null' - - kind: native - opcode: secrets.create - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 201 - }; - } - -- kind: block - name: secrets_read - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: secrets.read - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: secrets_update - specs: - - kind: snippet - language: cel - code: 'has(self.body) ? self.body : null' - - kind: native - opcode: secrets.update - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - body: args, - status: 200 - }; - } - -- kind: block - name: secrets_delete - specs: - - kind: snippet - language: json - code: 'null' - - kind: native - opcode: secrets.delete - - kind: snippet - language: javascript - code: | - export default function (args) { - return { - status: 204 - }; - } - -- kind: switch - name: catch - matches: - - when: self == "unsupported type" || self == "unsupported value" - port: out[0] - - when: 'true' - port: out[1] - ports: - out[0]: - - name: status_400 - port: in - out[1]: - - name: status_500 - port: in - -- kind: snippet - name: status_400 - language: javascript - code: | - export default function (args) { - return { - body: { - error: args.error() - }, - status: 400 - }; - } - -- kind: snippet - name: status_500 - language: json - code: | - { - "body": { - "error": "Internal Server Error" - }, - "status": 500 - } ``` -์ด๋Ÿฌํ•œ ์ ‘๊ทผ ๋ฐฉ์‹์€ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์„ ์•ˆ์ •์ ์œผ๋กœ ์œ ์ง€ํ•˜๋ฉด์„œ๋„ ํ•„์š”์— ๋”ฐ๋ผ ์œ ์—ฐํ•˜๊ฒŒ ์‹œ์Šคํ…œ์„ ํ™•์žฅํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. +์ด ์ ‘๊ทผ ๋ฐฉ์‹์€ ์•ˆ์ •์ ์ธ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์„ ์œ ์ง€ํ•˜๋ฉด์„œ ์‹œ์Šคํ…œ์„ ์œ ์—ฐํ•˜๊ฒŒ ํ™•์žฅํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. -## ์ปดํŒŒ์ผ ๊ณผ์ • +### ์ปดํŒŒ์ผ ๊ณผ์ • -๋กœ๋”๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ๋ณ€๊ฒฝ ์ŠคํŠธ๋ฆผ์„ ํ†ตํ•ด ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋…ธ๋“œ ๋ช…์„ธ์™€ ์‹œํฌ๋ฆฟ์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ถ”์ ํ•ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€, ์ˆ˜์ •, ๋˜๋Š” ์‚ญ์ œ๊ฐ€ ์ด๋ฃจ์–ด์ง€๋ฉด ๋กœ๋”์— ์˜ํ•ด ๊ฐ์ง€๋˜์–ด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ๋™์ ์œผ๋กœ ๋‹ค์‹œ ๋กœ๋“œ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ, ์Šคํ‚ค๋งˆ์— ์ •์˜๋œ ์ฝ”๋ฑ์„ ํ™œ์šฉํ•˜์—ฌ ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ํ˜•ํƒœ๋กœ ์ปดํŒŒ์ผ๋ฉ๋‹ˆ๋‹ค. ์ด ๊ณผ์ •์—์„œ ์บ์‹ฑ๊ณผ ์ตœ์ ํ™”๊ฐ€ ์ˆ˜ํ–‰๋˜์–ด ์„ฑ๋Šฅ์ด ๊ฐœ์„ ๋ฉ๋‹ˆ๋‹ค. +๋กœ๋”๋Š” ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ๋ณ€๊ฒฝ ์ŠคํŠธ๋ฆผ์„ ํ†ตํ•ด ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋…ธ๋“œ ๋ช…์„ธ์™€ ์‹œํฌ๋ฆฟ์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ถ”์ ํ•ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€, ์ˆ˜์ •, ์‚ญ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ๋กœ๋”๋Š” ํ•ด๋‹น ๋ช…์„ธ๋ฅผ ๋‹ค์‹œ ๋กœ๋“œํ•˜๊ณ , ์Šคํ‚ค๋งˆ์— ์ •์˜๋œ ์ฝ”๋ฑ์„ ํ™œ์šฉํ•ด ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ํ˜•ํƒœ๋กœ ์ปดํŒŒ์ผํ•ฉ๋‹ˆ๋‹ค. ์บ์‹ฑ๊ณผ ์ตœ์ ํ™” ๊ณผ์ •๋„ ํ•จ๊ป˜ ์ˆ˜ํ–‰๋˜์–ด ์„ฑ๋Šฅ์„ ๊ฐœ์„ ํ•ฉ๋‹ˆ๋‹ค. -์ปดํŒŒ์ผ๋œ ๋…ธ๋“œ๋Š” ๋ช…์„ธ์™€ ๊ฒฐํ•ฉํ•˜์—ฌ ์‹ฌ๋ณผ๋กœ ๋ณ€ํ™˜๋˜๋ฉฐ, ์‹ฌ๋ณผ ํ…Œ์ด๋ธ”์— ์ €์žฅ๋ฉ๋‹ˆ๋‹ค. ์‹ฌ๋ณผ ํ…Œ์ด๋ธ”์€ ๊ฐ ์‹ฌ๋ณผ์˜ ํฌํŠธ๋ฅผ ๋…ธ๋“œ ๋ช…์„ธ์— ์ •์˜๋œ ํฌํŠธ ์—ฐ๊ฒฐ ์ •๋ณด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค. - -```plantext +```text +--------------------------+ | Database | | +--------------------+ | @@ -299,42 +130,23 @@ | | Node Specification | | | +--------------------+ | +-------------------+ | | Node Specification | |-->| Loader | - | +--------------------+ | | +-------------+ | - +--------------------------+ | | Scheme | | + | +--------------------+ | | +-------------+ | + +--------------------------+ | | Scheme | | +--------------------------+ | | +-------+ | | - | Database | | | | Codec | | |--+ - | +--------+ +--------+ | | | +-------+ | | | - | | Secret | | Secret | |-->| +-------------+ | | - | +--------+ +--------+ | +-------------------+ | - | +--------+ +--------+ | | - | | Secret | | Secret | | | - | +--------+ +--------+ | | - +--------------------------+ | - +-------------------------+ | - | Symbol Table | | - | +--------+ +--------+ | | - | | Symbol | | Symbol |<-----------------------------+ - | +--------+ +--------+ | - | \|/ | - | +--------+ +--------+ | - | | Symbol | | Symbol | | - | +--------+ +--------+ | - +-------------------------+ + | Database | | | | Codec | | | + | +--------+ +--------+ | | | +-------+ | | + | | Secret | | Secret | |-->| +-------------+ | + | +--------+ +--------+ | + +--------------------------+ ``` -์›Œํฌํ”Œ๋กœ์šฐ์— ์†ํ•œ ๋ชจ๋“  ๋…ธ๋“œ๊ฐ€ ์‹ฌ๋ณผ ํ…Œ์ด๋ธ”์— ๋กœ๋“œ๋˜๊ณ  ๋…ธ๋“œ์˜ ๋ชจ๋“  ํฌํŠธ๊ฐ€ ์—ฐ๊ฒฐ๋˜๋ฉด, ์›Œํฌํ”Œ๋กœ์šฐ์˜ ๋‚ด๋ถ€ ๋…ธ๋“œ๋ถ€ํ„ฐ ์™ธ๋ถ€ ๋…ธ๋“œ๊นŒ์ง€ ์ˆœ์ฐจ์ ์œผ๋กœ ๋กœ๋“œ ํ›…์„ ์‹คํ–‰ํ•˜์—ฌ ๋…ธ๋“œ๋ฅผ ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์‹ฌ๋ณผ ํ…Œ์ด๋ธ”์—์„œ ํŠน์ • ๋…ธ๋“œ๊ฐ€ ์ œ๊ฑฐ๋˜์–ด ์‹คํ–‰ํ•  ์ˆ˜ ์—†๋Š” ์ƒํƒœ๊ฐ€ ๋˜๋ฉด, ํ•ด๋‹น ๋…ธ๋“œ๋ฅผ ์ฐธ์กฐํ•˜๋Š” ๋ชจ๋“  ๋…ธ๋“œ๋ฅผ ํ™œ์„ฑํ™”์˜ ์—ญ์ˆœ์œผ๋กœ ์–ธ๋กœ๋“œ ํ›…์„ ์‹คํ–‰ํ•˜์—ฌ ๋น„ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค. - -๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ๋…ธ๋“œ ๋ช…์„ธ๊ฐ€ ๋ณ€๊ฒฝ๋˜๋ฉด, ์ด ๊ณผ์ •์„ ํ†ตํ•ด ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ๋ชจ๋“  ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์— ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค. - -## ๋Ÿฐํƒ€์ž„ ๊ณผ์ • - -ํ™œ์„ฑํ™”๋œ ๋…ธ๋“œ๋Š” ์†Œ์ผ“์ด๋‚˜ ํŒŒ์ผ์„ ๊ฐ์‹œํ•˜๋ฉฐ, ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๋…ธ๋“œ๋Š” ๋…๋ฆฝ์ ์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์‹คํ–‰์„ ์‹œ์ž‘ํ•˜๊ณ , ์‹คํ–‰ ํ๋ฆ„์„ ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค๋กœ๋ถ€ํ„ฐ ๊ฒฉ๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ํ•„์š”ํ•œ ๋ฆฌ์†Œ์Šค๋ฅผ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜์—ฌ ๋‹ค๋ฅธ ์ž‘์—…์— ์˜ํ–ฅ์„ ๋ฏธ์น˜์ง€ ์•Š๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. +์ปดํŒŒ์ผ๋œ ๋…ธ๋“œ๋Š” ์‹ฌ๋ณผ ํ…Œ์ด๋ธ”์— ์ €์žฅ๋˜์–ด, ๊ฐ ์‹ฌ๋ณผ์ด ์ •์˜๋œ ํฌํŠธ์— ๋”ฐ๋ผ ์—ฐ๊ฒฐ๋ฉ๋‹ˆ๋‹ค. ์›Œํฌํ”Œ๋กœ์šฐ์˜ ๋ชจ๋“  ๋…ธ๋“œ๊ฐ€ ์‹ฌ๋ณผ ํ…Œ์ด๋ธ”์— ๋กœ๋“œ๋˜๋ฉด, ๋…ธ๋“œ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ธฐ ์œ„ํ•œ ์ˆœ์ฐจ์  ์ž‘์—…์ด ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ๋…ธ๋“œ๊ฐ€ ์ œ๊ฑฐ๋˜๋ฉด ๋น„ํ™œ์„ฑํ™” ์ž‘์—…๋„ ์ˆœ์ฐจ์ ์œผ๋กœ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. -๊ฐ ๋…ธ๋“œ๋Š” ํ”„๋กœ์„ธ์Šค๋ฅผ ํ†ตํ•ด ํฌํŠธ๋ฅผ ์—ด๊ณ , ๋ผ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์—ฐ๊ฒฐ๋œ ๋‹ค๋ฅธ ๋…ธ๋“œ์—๊ฒŒ ํŒจํ‚ท์„ ์ „์†กํ•ฉ๋‹ˆ๋‹ค. ํŒจํ‚ท์˜ ํŽ˜์ด๋กœ๋“œ๋Š” ๋Ÿฐํƒ€์ž„์—์„œ ์‚ฌ์šฉ๋˜๋Š” ๊ณต์šฉ ํƒ€์ž…์œผ๋กœ ๋ณ€ํ™˜๋˜์–ด ์ „์†ก๋ฉ๋‹ˆ๋‹ค. +### ๋Ÿฐํƒ€์ž„ ๊ณผ์ • -์—ฐ๊ฒฐ๋œ ๋…ธ๋“œ๋Š” ์ƒˆ๋กœ์šด ํ”„๋กœ์„ธ์Šค๊ฐ€ ํ•ด๋‹น ํฌํŠธ๋ฅผ ์—ด์—ˆ๋Š”์ง€๋ฅผ ๊ฐ์‹œํ•˜๋ฉฐ, ๋ฆฌ๋”๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ƒ์„ฑ๋œ ๋ฆฌ๋”๋Š” ๋Œ€๊ธฐ ์ค‘์ธ ํŒจํ‚ท์„ ์ง€์†์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ณ , ์ฒ˜๋ฆฌ๋œ ๊ฒฐ๊ณผ๋ฅผ ๋‹ค์Œ ๋…ธ๋“œ์— ์ „๋‹ฌํ•˜๊ฑฐ๋‚˜ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. +ํ™œ์„ฑํ™”๋œ ๋…ธ๋“œ๋Š” ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‹คํ–‰ํ•˜๋ฉฐ, ๋…๋ฆฝ์ ์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ํ†ตํ•ด ๋ฆฌ์†Œ์Šค๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ  ๋‹ค๋ฅธ ์ž‘์—…์— ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋…ธ๋“œ๋Š” ํ”„๋กœ์„ธ์Šค ๊ฐ„ ํ†ต์‹ ์„ ํ†ตํ•ด ํŒจํ‚ท์„ ์ฃผ๊ณ ๋ฐ›์œผ๋ฉฐ, ํŽ˜์ด๋กœ๋“œ๋Š” ๊ณต์šฉ ํƒ€์ž…์œผ๋กœ ๋ณ€ํ™˜๋˜์–ด ์ „์†ก๋ฉ๋‹ˆ๋‹ค. -```plantext +```text +-----------------------+ +-----------------------+ | Node A | | Node B | | +-----------------+ | | +-----------------+ | @@ -350,10 +162,10 @@ +-----------------------+ +-----------------------+ ``` -ํ•˜๋‚˜์˜ ๋ฆฌ๋”๋Š” ๋ชจ๋“  ํŒจํ‚ท์„ ์ˆœ์ฐจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ณ  ์‘๋‹ตํ•ด์•ผ ํ•˜๋ฉฐ, ๋ผ์ดํ„ฐ๋กœ ์ „์†ก๋œ ํŒจํ‚ท์€ ๋ฐ˜๋“œ์‹œ ์‘๋‹ต ํŒจํ‚ท์œผ๋กœ ๋ฐ˜ํ™˜๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋…ธ๋“œ ๊ฐ„ ํ†ต์‹ ์ด ์›ํ™œํ•˜๊ฒŒ ์ด๋ฃจ์–ด์ง€๊ณ , ๋ฐ์ดํ„ฐ์˜ ์ผ๊ด€์„ฑ๊ณผ ๋ฌด๊ฒฐ์„ฑ์ด ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. +ํ•˜๋‚˜์˜ ๋ฆฌ๋”๋Š” ๋ชจ๋“  ํŒจํ‚ท์„ ์ˆœ์ฐจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ณ , ๋ฐ˜๋“œ์‹œ ๋ผ์ดํ„ฐ๋กœ ์ „์†ก๋œ ํŒจํ‚ท์— ๋Œ€ํ•œ ์‘๋‹ต ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋…ธ๋“œ ๊ฐ„ ํ†ต์‹ ์ด ์›ํ™œํžˆ ์ด๋ฃจ์–ด์ง€๋ฉฐ, ๋ฐ์ดํ„ฐ์˜ ์ผ๊ด€์„ฑ๊ณผ ๋ฌด๊ฒฐ์„ฑ์ด ๋ณด์žฅ๋ฉ๋‹ˆ๋‹ค. -์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‹คํ–‰ํ•œ ๋…ธ๋“œ๋Š” ์ „์†กํ•œ ๋ชจ๋“  ํŒจํ‚ท์˜ ์‘๋‹ต์ด ๋ฐ˜ํ™˜๋  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฐ ํ›„, ํ”„๋กœ์„ธ์Šค๋ฅผ ์ข…๋ฃŒํ•˜๊ณ  ํ• ๋‹น๋œ ๋ฆฌ์†Œ์Šค๋ฅผ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. ํŒจํ‚ท ์ฒ˜๋ฆฌ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ ์˜ค๋ฅ˜ ์‘๋‹ต์ด ๋ฐ˜ํ™˜๋œ ๊ฒฝ์šฐ, ๋…ธ๋“œ๋Š” ํ•ด๋‹น ์˜ค๋ฅ˜๋ฅผ ๊ธฐ๋กํ•˜๊ณ  ํ”„๋กœ์„ธ์Šค๋ฅผ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค. +์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‹คํ–‰ํ•œ ๋…ธ๋“œ๋Š” ์ „์†กํ•œ ๋ชจ๋“  ํŒจํ‚ท์˜ ์‘๋‹ต์„ ๋ฐ›์„ ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ ธ๋‹ค๊ฐ€, ํ”„๋กœ์„ธ์Šค๋ฅผ ์ข…๋ฃŒํ•˜๊ณ  ํ• ๋‹น๋œ ๋ฆฌ์†Œ์Šค๋ฅผ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. ํŒจํ‚ท ์ฒ˜๋ฆฌ ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ด ์˜ค๋ฅ˜ ์‘๋‹ต์ด ๋ฐ˜ํ™˜๋  ๊ฒฝ์šฐ, ๋…ธ๋“œ๋Š” ํ•ด๋‹น ์˜ค๋ฅ˜๋ฅผ ๊ธฐ๋กํ•œ ๋’ค ํ”„๋กœ์„ธ์Šค๋ฅผ ์ข…๋ฃŒํ•ฉ๋‹ˆ๋‹ค. -ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜๋ฉด, ์ •์ƒ ์ข…๋ฃŒ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•œ ํ›„ ์—ด๋ฆฐ ํŒŒ์ผ ๋””์Šคํฌ๋ฆฝํ„ฐ, ํ• ๋‹น๋œ ๋ฉ”๋ชจ๋ฆฌ, ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํŠธ๋žœ์žญ์…˜ ๋“ฑ์„ ๋ชจ๋‘ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. +ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜๋ฉด, ์ •์ƒ ์ข…๋ฃŒ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•˜๊ณ  ์—ด๋ฆฐ ํŒŒ์ผ ๋””์Šคํฌ๋ฆฝํ„ฐ, ํ• ๋‹น๋œ ๋ฉ”๋ชจ๋ฆฌ, ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ํŠธ๋žœ์žญ์…˜ ๋“ฑ์„ ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค. -๋ถ€๋ชจ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜๋ฉด, ํŒŒ์ƒ๋œ ๋ชจ๋“  ์ž์‹ ํ”„๋กœ์„ธ์Šค๋„ ์ข…๋ฃŒ๋ฉ๋‹ˆ๋‹ค. ์ด๋•Œ ๋ถ€๋ชจ ํ”„๋กœ์„ธ์Šค๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ๋ชจ๋‘ ์ข…๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ๋Œ€๊ธฐํ•ฉ๋‹ˆ๋‹ค. +๋ถ€๋ชจ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜๋ฉด, ๊ทธ์— ์˜ํ•ด ํŒŒ์ƒ๋œ ๋ชจ๋“  ์ž์‹ ํ”„๋กœ์„ธ์Šค๋„ ํ•จ๊ป˜ ์ข…๋ฃŒ๋ฉ๋‹ˆ๋‹ค. ์ด๋•Œ ๋ถ€๋ชจ ํ”„๋กœ์„ธ์Šค๋Š” ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ๋ชจ๋‘ ์ข…๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ๋Œ€๊ธฐํ•ฉ๋‹ˆ๋‹ค. \ No newline at end of file diff --git a/docs/debugging.md b/docs/debugging.md index 40996500..7c6766de 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -4,7 +4,7 @@ Using a debugger allows you to trace the execution flow of an application in rea ## Getting Started -To run the debugger, use the `start` command with the `--debug` flag. This command will activate the debugger, allowing you to control the application's execution in detail via the command-line interface. +To start the debugger, use the `start` command with the `--debug` flag. This command activates the debugger and allows you to control the application's execution through the command-line interface. ```sh ./dist/uniflow start --debug @@ -12,11 +12,11 @@ To run the debugger, use the `start` command with the `--debug` flag. This comma ## Commands -While the debugger is running, various commands can be used to efficiently perform debugging tasks. Below is a list of commonly used commands during the debugging process and how to utilize them. +While the debugger is running, you can use various commands to efficiently perform debugging tasks. Below is a list of commonly used commands and their usage. ### Quit -Use this command to exit the debugging session and return to the command line. +Exits the debugging session and returns to the command line. ```sh (debug) quit @@ -26,7 +26,7 @@ This command can also be shortened to `q`. ### Break -You can set breakpoints to stop code execution at specific points. This allows you to inspect the system state during execution and diagnose issues. +Sets breakpoints to stop code execution at specific points, allowing you to inspect the system state and diagnose issues. ```sh (debug) break # Set a breakpoint on all symbols @@ -38,7 +38,7 @@ This command can also be shortened to `b`. ### Continue -Use this command to resume execution from a breakpoint. The program will continue running until it reaches the next breakpoint. +Resumes execution from a breakpoint. The program will continue running until it reaches the next breakpoint. ```sh (debug) continue @@ -48,7 +48,7 @@ This command can also be shortened to `c`. ### Delete -This command deletes set breakpoints. Each breakpoint has a unique ID, which you can use to delete a specific breakpoint. +Deletes set breakpoints. Each breakpoint has a unique ID, which you can use to delete a specific breakpoint. ```sh (debug) delete # Delete the current breakpoint @@ -59,7 +59,7 @@ This command can also be shortened to `d`. ### Breakpoints -This command lists all currently set breakpoints. It allows you to check the location and status of each breakpoint. +Lists all currently set breakpoints, showing their locations and statuses. ```sh (debug) breakpoints @@ -69,7 +69,7 @@ This command can also be shortened to `bps`. ### Breakpoint -To view detailed information about a specific breakpoint, use this command. You can query the status of a breakpoint using its ID. +Views detailed information about a specific breakpoint. You can query the status of a breakpoint using its ID. ```sh (debug) breakpoint # View details of the current breakpoint @@ -80,7 +80,7 @@ This command can also be shortened to `bp`. ### Symbols -This command lists all currently available symbols. Symbols represent nodes running at runtime, and this command allows you to view the entire list of symbols. +Lists all currently available symbols. Symbols represent nodes running at runtime. ```sh (debug) symbols @@ -90,7 +90,7 @@ This command can also be shortened to `sbs`. ### Symbol -To view detailed information about a specific symbol, use this command. By entering the symbol's ID or name, you can check its status and related information. +Views detailed information about a specific symbol. Enter the symbol's ID or name to check its status and related information. ```sh (debug) symbol # View details of the current symbol @@ -101,7 +101,7 @@ This command can also be shortened to `sb`. ### Processes -This command lists all currently running processes. Use it to check the status of processes operating within the system. +Lists all currently running processes, showing their status. ```sh (debug) processes @@ -111,7 +111,7 @@ This command can also be shortened to `procs`. ### Process -To view detailed information about a specific process, use this command. You can check the status and related information of a process by using its ID. +Views detailed information about a specific process. Use the process's ID to check its status and related information. ```sh (debug) process # View details of the current process @@ -122,7 +122,7 @@ This command can also be shortened to `proc`. ### Frames -This command lists all currently active frames. Frames represent a specific execution state of the code, and this command allows you to view the status of the frames being processed. +Lists all currently active frames. Frames represent a specific execution state of the code. ```sh (debug) frames # View frame information of the current process @@ -133,7 +133,7 @@ This command can also be shortened to `frms`. ### Frame -To view detailed information about the current frame, use this command. It allows you to closely inspect the state of the frame that is currently executing. +Views detailed information about the current frame, allowing you to closely inspect its state. ```sh (debug) frame diff --git a/docs/debugging_kr.md b/docs/debugging_kr.md index aa94f0e6..55b83290 100644 --- a/docs/debugging_kr.md +++ b/docs/debugging_kr.md @@ -12,7 +12,7 @@ ## ๋ช…๋ น์–ด -๋””๋ฒ„๊ฑฐ๊ฐ€ ์‹คํ–‰ ์ค‘์ผ ๋•Œ, ๋‹ค์–‘ํ•œ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๋””๋ฒ„๊น… ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜๋Š” ๋””๋ฒ„๊น… ๊ณผ์ •์—์„œ ์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” ์ฃผ์š” ๋ช…๋ น์–ด์™€ ๊ทธ ํ™œ์šฉ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. +๋””๋ฒ„๊ฑฐ๊ฐ€ ์‹คํ–‰ ์ค‘์ผ ๋•Œ, ๋‹ค์–‘ํ•œ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๋””๋ฒ„๊น… ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜๋Š” ์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” ๋ช…๋ น์–ด์™€ ๊ทธ ํ™œ์šฉ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ### Quit @@ -72,7 +72,7 @@ ํŠน์ • ๋ธŒ๋ ˆ์ดํฌํฌ์ธํŠธ์˜ ์„ธ๋ถ€ ์ •๋ณด๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด ์ด ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋ธŒ๋ ˆ์ดํฌํฌ์ธํŠธ์˜ ID๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ํ•ด๋‹น ๋ธŒ๋ ˆ์ดํฌํฌ์ธํŠธ์˜ ์ƒํƒœ๋ฅผ ์กฐํšŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ```sh -(debug) breakpoint # ํ˜„์žฌ ๋ธŒ๋ ˆ์ดํฌํฌ์ธํŠธ์˜ ์„ธ๋ถ€ ์ •๋ณด ์กฐํšŒ +(debug) breakpoint # ํ˜„์žฌ ๋ธŒ๋ ˆ์ดํฌํฌ์ธํŠธ์˜ ์„ธ๋ถ€ ์ •๋ณด ์กฐํšŒ (debug) breakpoint # ํŠน์ • ๋ธŒ๋ ˆ์ดํฌํฌ์ธํŠธ์˜ ์„ธ๋ถ€ ์ •๋ณด ์กฐํšŒ ``` @@ -139,4 +139,4 @@ (debug) frame ``` -์ด ๋ช…๋ น์–ด๋Š” `frm`๋กœ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +์ด ๋ช…๋ น์–ด๋Š” `frm`์œผ๋กœ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. diff --git a/docs/getting_started.md b/docs/getting_started.md index d1d3bf4c..5a640ade 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -1,14 +1,14 @@ # ๐Ÿš€ Getting Started -This guide provides detailed instructions on how to install, configure, and manage workflows using the [Command Line Interface (CLI)](../cmd/README.md). It covers the entire process from installation to workflow control and configuration. +This guide provides detailed instructions on installing, configuring, and managing workflows using the [Command Line Interface (CLI)](../cmd/README.md). It covers the entire process from installation to workflow control and configuration. ## Installing from Source -To begin, you need to set up the [CLI](../cmd/README.md) along with the [built-in extensions](../ext/README.md). Before starting the installation, ensure that [Go 1.23](https://go.dev/doc/install) or higher is installed on your system. +To begin, set up the [CLI](../cmd/README.md) along with the [built-in extensions](../ext/README.md). Before starting the installation, ensure that [Go 1.23](https://go.dev/doc/install) or higher is installed on your system. ### Cloning the Repository -To clone the source code, run the following command: +To clone the source code, run: ```sh git clone https://github.com/siyul-park/uniflow @@ -22,7 +22,7 @@ cd uniflow ### Installing Dependencies and Building -To install dependencies and build the project, execute the following commands: +To install dependencies and build the project, execute: ```sh make init @@ -33,7 +33,7 @@ Once the build is complete, the executable will be located in the `dist` folder. ### Configuration -You can flexibly modify settings via the `.uniflow.toml` file or system environment variables. Key configuration options include: +You can modify settings flexibly via the `.uniflow.toml` file or system environment variables. Key configuration options include: | TOML Key | Environment Variable Key | Example | |-----------------------|----------------------------|----------------------------| @@ -42,7 +42,7 @@ You can flexibly modify settings via the `.uniflow.toml` file or system environm | `collection.nodes` | `COLLECTION.NODES` | `nodes` | | `collection.secrets` | `COLLECTION.SECRETS` | `secrets` | -If using [MongoDB](https://www.mongodb.com/), enable [Change Streams](https://www.mongodb.com/docs/manual/changeStreams/) so that the engine can track node specifications and secret changes. This requires setting up a [Replica Set](https://www.mongodb.com/docs/manual/replication/). +If using [MongoDB](https://www.mongodb.com/), enable [Change Streams](https://www.mongodb.com/docs/manual/changeStreams/) to allow the engine to track node specifications and secret changes. This requires setting up a [Replica Set](https://www.mongodb.com/docs/manual/replication/). ## Uniflow @@ -50,7 +50,7 @@ If using [MongoDB](https://www.mongodb.com/), enable [Change Streams](https://ww ### Start -The `start` command initiates the runtime with node specifications for a specific namespace. The basic usage is as follows: +The `start` command initiates the runtime with node specifications for a specific namespace. Basic usage is as follows: ```sh ./dist/uniflow start --namespace default @@ -68,7 +68,7 @@ To provide initial secrets, use the `--from-secrets` flag: ./dist/uniflow start --namespace default --from-secrets examples/secrets.yaml ``` -This command will execute all node specifications for the specified namespace. If no namespace is specified, the `default` namespace is used. +This command executes all node specifications for the specified namespace. If no namespace is specified, the `default` namespace is used. ## Uniflowctl @@ -124,7 +124,7 @@ This command displays all node specifications or secrets for the specified names ## HTTP API Integration -To modify node specifications through the HTTP API, you need to set up a workflow that exposes this functionality. You can use the `native` node included in the [basic extensions](../ext/README.md): +To modify node specifications through the HTTP API, set up a workflow that exposes this functionality. You can use the `native` node included in the [basic extensions](../ext/README.md): ```yaml kind: native diff --git a/docs/getting_started_kr.md b/docs/getting_started_kr.md index c2bcbdde..103cbf1a 100644 --- a/docs/getting_started_kr.md +++ b/docs/getting_started_kr.md @@ -1,10 +1,10 @@ # ๐Ÿš€ ์‹œ์ž‘ํ•˜๊ธฐ -์ด ์•ˆ๋‚ด์„œ๋Š” [๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค(CLI)](../cmd/README_kr.md)๋ฅผ ์„ค์น˜ํ•˜๊ณ  ๊ตฌ์„ฑํ•˜๋ฉฐ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ž์„ธํžˆ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜์—์„œ๋ถ€ํ„ฐ ์›Œํฌํ”Œ๋กœ์šฐ ์ œ์–ด ๋ฐ ์„ค์ •๊นŒ์ง€์˜ ์ „๋ฐ˜์ ์ธ ๊ณผ์ •์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค. +์ด ์•ˆ๋‚ด์„œ๋Š” [๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค(CLI)](../cmd/README_kr.md)๋ฅผ ์„ค์น˜ํ•˜๊ณ  ๊ตฌ์„ฑํ•˜๋ฉฐ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ž์„ธํžˆ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜๋ถ€ํ„ฐ ์›Œํฌํ”Œ๋กœ์šฐ ์ œ์–ด ๋ฐ ์„ค์ •๊นŒ์ง€์˜ ์ „๋ฐ˜์ ์ธ ๊ณผ์ •์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค. ## ์†Œ์Šค์—์„œ ์„ค์น˜ํ•˜๊ธฐ -๋จผ์ € [๋‚ด์žฅ๋œ ํ™•์žฅ ๊ธฐ๋Šฅ](../ext/README_kr.md)๊ณผ ํ•จ๊ป˜ ์ œ๊ณต๋˜๋Š” [CLI](../cmd/README_kr.md)๋ฅผ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— ์‹œ์Šคํ…œ์— [Go 1.23](https://go.dev/doc/install) ์ด์ƒ์ด ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”. +๋จผ์ € [๊ธฐ๋ณธ ํ™•์žฅ ๊ธฐ๋Šฅ](../ext/README_kr.md)๊ณผ ํ•จ๊ป˜ ์ œ๊ณต๋˜๋Š” [CLI](../cmd/README_kr.md)๋ฅผ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— ์‹œ์Šคํ…œ์— [Go 1.23](https://go.dev/doc/install) ์ด์ƒ์ด ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”. ### ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ํด๋ก  diff --git a/docs/key_concepts.md b/docs/key_concepts.md index 3a7676cf..c661d905 100644 --- a/docs/key_concepts.md +++ b/docs/key_concepts.md @@ -28,9 +28,9 @@ env: - `id`: A unique identifier in UUID format. UUID V7 is recommended. - `kind`: Specifies the type of node. This example is a `listener`. Additional fields may vary based on the node type. -- `namespace`: The namespace to which the node belongs, default is `default`. +- `namespace`: The namespace to which the node belongs; the default is `default`. - `name`: The name of the node, which must be unique within the namespace. -- `annotations`: Additional metadata about the node. It can include user-defined key-value pairs like description and version. +- `annotations`: Additional metadata about the node, including user-defined key-value pairs like description and version. - `protocol`: Specifies the protocol used by the listener. This field is required for `listener` nodes. - `port`: Specifies the port used by the listener. This field is required for `listener` nodes. - `ports`: Defines the connection scheme of ports. `out` defines an output port named `proxy`, which connects to the `in` port of another node. @@ -51,9 +51,9 @@ data: ``` - `id`: A unique identifier in UUID format. UUID V7 is recommended. -- `namespace`: The namespace to which the secret belongs, default is `default`. +- `namespace`: The namespace to which the secret belongs; the default is `default`. - `name`: The name of the secret, which must be unique within the namespace. -- `annotations`: Additional metadata about the secret. It can include user-defined key-value pairs like description and version. +- `annotations`: Additional metadata about the secret, including user-defined key-value pairs like description and version. - `data`: Contains the secret data in key-value pairs. ## Node diff --git a/docs/key_concepts_kr.md b/docs/key_concepts_kr.md index 80e5d5b3..5380e595 100644 --- a/docs/key_concepts_kr.md +++ b/docs/key_concepts_kr.md @@ -27,7 +27,7 @@ env: ``` - `id`: UUID ํ˜•์‹์˜ ๊ณ ์œ  ์‹๋ณ„์ž์ž…๋‹ˆ๋‹ค. UUID V7์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. -- `kind`: ๋…ธ๋“œ์˜ ์ข…๋ฅ˜๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๋…ธ๋“œ์˜ ์ข…๋ฅ˜์— ๋”ฐ๋ผ ์ถ”๊ฐ€ ํ•„๋“œ๊ฐ€ ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค. +- `kind`: ๋…ธ๋“œ์˜ ์ข…๋ฅ˜๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๋…ธ๋“œ ์ข…๋ฅ˜์— ๋”ฐ๋ผ ์ถ”๊ฐ€ ํ•„๋“œ๊ฐ€ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. - `namespace`: ๋…ธ๋“œ๊ฐ€ ์†ํ•œ ๋„ค์ž„์ŠคํŽ˜์ด์Šค๋ฅผ ์ง€์ •ํ•˜๋ฉฐ, ๊ธฐ๋ณธ๊ฐ’์€ `default`์ž…๋‹ˆ๋‹ค. - `name`: ๋…ธ๋“œ์˜ ์ด๋ฆ„์„ ์ง€์ •ํ•˜๋ฉฐ, ๋™์ผํ•œ ๋„ค์ž„์ŠคํŽ˜์ด์Šค ๋‚ด์—์„œ ๊ณ ์œ ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. - `annotations`: ๋…ธ๋“œ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์ž…๋‹ˆ๋‹ค. ์„ค๋ช…, ๋ฒ„์ „ ๋“ฑ ์‚ฌ์šฉ์ž ์ •์˜ ํ‚ค-๊ฐ’ ์Œ์„ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. diff --git a/docs/user_extensions.md b/docs/user_extensions.md index f42b6c74..3a1b556c 100644 --- a/docs/user_extensions.md +++ b/docs/user_extensions.md @@ -1,11 +1,10 @@ - # ๐Ÿ”ง User Extensions This guide explains how to extend your service and integrate it into the runtime environment. ## Development Environment Setup -First, initialize the [Go](https://go.dev) module and download the necessary dependencies. +First, initialize the [Go](https://go.dev) module and download the necessary dependencies: ```shell go get github.com/siyul-park/uniflow @@ -15,6 +14,8 @@ go get github.com/siyul-park/uniflow To add new functionality, define the node specification and register the codec that converts this specification into a node. +### Define Node Specification + A node specification implements the `spec.Spec` interface and can be defined using `spec.Meta`: ```go @@ -30,7 +31,9 @@ Define the new node type: const KindText = "text" ``` -Now implement the node that performs the actual work. Use the provided `OneToOneNode` template to receive an input packet, process it, and send an output packet: +### Implement the Node + +Create a node that performs the actual work. Use the `OneToOneNode` template to handle input packets, process them, and send output packets: ```go type TextNode struct { @@ -50,7 +53,7 @@ func NewTextNode(contents string) *TextNode { } ``` -Implement the function that processes packets. This function uses the first return value on success and the second return value on error: +Implement the packet processing function. This function returns the first value on success and the second value on error: ```go func (n *TextNode) action(proc *process.Process, inPck *packet.Packet) (*packet.Packet, *packet.Packet) { @@ -59,7 +62,9 @@ func (n *TextNode) action(proc *process.Process, inPck *packet.Packet) (*packet. } ``` -Write a test to ensure the node works as intended. Send an input packet to the `in` port and verify the output packet contains the `contents`: +### Testing the Node + +Write a test to ensure the node functions correctly. Send an input packet to the `in` port and verify that the output packet contains the expected `contents`: ```go func TestTextNode_SendAndReceive(t *testing.T) { @@ -95,7 +100,7 @@ func TestTextNode_SendAndReceive(t *testing.T) { ### Registering the Schema and Codec -Create a codec that converts the node specification to a node and register it with the schema: +Create a codec that converts the node specification into a node and register it with the schema: ```go func NewTextNodeCodec() scheme.Codec { @@ -124,7 +129,7 @@ scheme, _ := builder.Build() ### Running the Runtime Environment -Pass this schema to the runtime environment to execute workflows that include the extended node: +Pass the schema to the runtime environment to execute workflows that include the extended node: ```go r := runtime.New(runtime.Config{ @@ -141,11 +146,11 @@ r.Listen(ctx) ## Service Integration -There are two ways to integrate the runtime environment into your service. +There are two ways to integrate the runtime environment into your service: ### Continuous Integration -Maintain the runtime environment continuously to respond quickly to external requests. Each runtime environment runs in an independent container, suitable for scenarios requiring continuous workflow execution. +Maintain the runtime environment continuously to respond quickly to external requests. Each runtime environment runs in an independent container, suitable for scenarios requiring continuous workflow execution: ```go func main() { @@ -199,7 +204,7 @@ r := runtime.New(runtime.Config{ }) defer r.Close() -r.Load(ctx) // Load All +r.Load(ctx) // Load all symbols, _ := r.Load(ctx, &spec.Meta{ Name: "main", @@ -214,4 +219,4 @@ in.Link(sb.In(node.PortIn)) payload := types.NewString(faker.Word()) payload, err := port.Call(in, payload) -``` \ No newline at end of file +``` diff --git a/docs/user_extensions_kr.md b/docs/user_extensions_kr.md index 78df2fbf..8dee992d 100644 --- a/docs/user_extensions_kr.md +++ b/docs/user_extensions_kr.md @@ -4,7 +4,7 @@ ## ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ค์ • -๋จผ์ €, [Go](https://go.dev) ๋ชจ๋“ˆ์„ ์ดˆ๊ธฐํ™”ํ•˜๊ณ  ํ•„์š”ํ•œ ์˜์กด์„ฑ์„ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค. +๋จผ์ €, [Go](https://go.dev) ๋ชจ๋“ˆ์„ ์ดˆ๊ธฐํ™”ํ•˜๊ณ  ํ•„์š”ํ•œ ์˜์กด์„ฑ์„ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค: ```shell go get github.com/siyul-park/uniflow @@ -14,6 +14,8 @@ go get github.com/siyul-park/uniflow ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜๋ ค๋ฉด ๋…ธ๋“œ ๋ช…์„ธ๋ฅผ ์ •์˜ํ•˜๊ณ  ์ด๋ฅผ ๋…ธ๋“œ๋กœ ๋ณ€ํ™˜ํ•˜๋Š” ์ฝ”๋ฑ์„ ์Šคํ‚ค๋งˆ์— ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค. +### ๋…ธ๋“œ ๋ช…์„ธ ์ •์˜ + ๋…ธ๋“œ ๋ช…์„ธ๋Š” `spec.Spec` ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๋ฉฐ, `spec.Meta`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```go @@ -29,7 +31,9 @@ type TextNodeSpec struct { const KindText = "text" ``` -์ด์ œ ์‹ค์ œ๋กœ ๋™์ž‘ํ•  ๋…ธ๋“œ๋ฅผ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ์ œ๊ณต๋˜๋Š” `OneToOneNode`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•œ ํ›„ ์ถœ๋ ฅ ํŒจํ‚ท์„ ์ „์†กํ•ฉ๋‹ˆ๋‹ค: +### ๋…ธ๋“œ ๊ตฌํ˜„ + +์‹ค์ œ๋กœ ๋™์ž‘ํ•  ๋…ธ๋“œ๋ฅผ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ์ œ๊ณต๋˜๋Š” `OneToOneNode`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•œ ํ›„ ์ถœ๋ ฅ ํŒจํ‚ท์„ ์ „์†กํ•ฉ๋‹ˆ๋‹ค: ```go type TextNode struct { @@ -58,6 +62,8 @@ func (n *TextNode) action(proc *process.Process, inPck *packet.Packet) (*packet. } ``` +### ๋…ธ๋“œ ํ…Œ์ŠคํŠธ + ๋…ธ๋“œ๊ฐ€ ์˜๋„ํ•œ ๋Œ€๋กœ ์ž‘๋™ํ•˜๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ž…๋ ฅ ํŒจํ‚ท์„ `in` ํฌํŠธ๋กœ ์ „์†กํ•˜๊ณ , ์ถœ๋ ฅ ํŒจํ‚ท์ด `contents`๋ฅผ ํฌํ•จํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค: ```go @@ -144,7 +150,7 @@ r.Listen(ctx) ### ์ง€์†์  ํ†ตํ•ฉ -์™ธ๋ถ€ ์š”์ฒญ์— ์‹ ์†ํ•˜๊ฒŒ ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์„ ์ง€์†์ ์œผ๋กœ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์€ ๋…๋ฆฝ์ ์ธ ์ปจํ…Œ์ด๋„ˆ์—์„œ ์‹คํ–‰๋˜๋ฉฐ, ์ง€์†์ ์ธ ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰์ด ํ•„์š”ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค. +์™ธ๋ถ€ ์š”์ฒญ์— ์‹ ์†ํ•˜๊ฒŒ ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์„ ์ง€์†์ ์œผ๋กœ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์€ ๋…๋ฆฝ์ ์ธ ์ปจํ…Œ์ด๋„ˆ์—์„œ ์‹คํ–‰๋˜๋ฉฐ, ์ง€์†์ ์ธ ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰์ด ํ•„์š”ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค: ```go func main() { @@ -198,7 +204,7 @@ r := runtime.New(runtime.Config{ }) defer r.Close() -r.Load(ctx) // Load All +r.Load(ctx) // ๋ชจ๋“  ์›Œํฌํ”Œ๋กœ์šฐ ๋กœ๋“œ symbols, _ := r.Load(ctx, &spec.Meta{ Name: "main", @@ -213,4 +219,4 @@ in.Link(sb.In(node.PortIn)) payload := types.NewString(faker.Word()) payload, err := port.Call(in, payload) -``` \ No newline at end of file +``` diff --git a/driver/README.md b/driver/README.md index 39754398..155bb737 100644 --- a/driver/README.md +++ b/driver/README.md @@ -1,7 +1,7 @@ # ๐Ÿ”ง Drivers -By using drivers to integrate external storage into the engine, you can ensure high availability, reliability, and security. +Integrating external storage into the engine through drivers ensures high availability, reliability, and security. ## Available Drivers -- **[MongoDB](./mongo)**: MongoDB is a popular NoSQL database known for its flexibility, scalability, and reliability. It supports various data models, including key-value, document, and graph models, meeting a wide range of application requirements. +- **[MongoDB](./mongo)**: MongoDB is a popular NoSQL database renowned for its flexibility, scalability, and reliability. It supports various data models, including key-value, document, and graph models, making it suitable for a wide range of application requirements. diff --git a/driver/README_kr.md b/driver/README_kr.md index b37730b8..9b2c417c 100644 --- a/driver/README_kr.md +++ b/driver/README_kr.md @@ -4,4 +4,4 @@ ## ์ œ๊ณตํ•˜๋Š” ๋“œ๋ผ์ด๋ฒ„ -- **[MongoDB](./mongo)**: MongoDB๋Š” ์œ ์—ฐ์„ฑ, ํ™•์žฅ์„ฑ, ์•ˆ์ •์„ฑ์œผ๋กœ ์œ ๋ช…ํ•œ ์ธ๊ธฐ ์žˆ๋Š” NoSQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์ž…๋‹ˆ๋‹ค. ํ‚ค-๊ฐ’, ๋„ํ๋จผํŠธ, ๊ทธ๋ž˜ํ”„ ๋ชจ๋ธ ๋“ฑ ๋‹ค์–‘ํ•œ ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ์ง€์›ํ•˜์—ฌ ์—ฌ๋Ÿฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์š”๊ตฌ์‚ฌํ•ญ์„ ์ถฉ์กฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- **[MongoDB](./mongo)**: MongoDB๋Š” ์œ ์—ฐ์„ฑ, ํ™•์žฅ์„ฑ, ์•ˆ์ •์„ฑ์œผ๋กœ ์œ ๋ช…ํ•œ ์ธ๊ธฐ ์žˆ๋Š” NoSQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์ž…๋‹ˆ๋‹ค. ํ‚ค-๊ฐ’, ๋„ํ๋จผํŠธ, ๊ทธ๋ž˜ํ”„ ๋ชจ๋ธ ๋“ฑ ๋‹ค์–‘ํ•œ ๋ฐ์ดํ„ฐ ๋ชจ๋ธ์„ ์ง€์›ํ•˜์—ฌ ์—ฌ๋Ÿฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์š”๊ตฌ ์‚ฌํ•ญ์„ ์ถฉ์กฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. diff --git a/ext/README.md b/ext/README.md index 7ebee276..a6df5562 100644 --- a/ext/README.md +++ b/ext/README.md @@ -1,13 +1,45 @@ # ๐Ÿ”ง Built-in Extensions -Built-in extensions efficiently execute short-term tasks and implement a wide range of features. These extensions enhance system performance, streamline workflows, and boost developer productivity. +Built-in extensions enhance system performance and streamline task handling through various functionalities. ## Available Extensions -- **Control**: Manage and control data flow precisely using control statements and loops. With snippets in various languages like CEL, JavaScript, TypeScript, JSON, YAML, complex operations can be handled with ease. +### **Control** -- **IO**: Support interaction with external data sources including databases and perform file I/O operations efficiently. Access the file system, execute database queries, and exchange data with remote servers. +Provides precise control over data flow. -- **Network**: Seamlessly perform network-related tasks including various protocols like HTTP. Manage complex network requests through routing capabilities, handle API calls, perform data transfers, and implement communication protocols efficiently. +- **[Call Node](./docs/call_node.md)**: Processes input packets and distributes results to multiple output ports. Enables reuse of data processing flows. +- **[Block Node](./docs/block_node.md)**: Manages complex data processing flows by sequentially executing multiple sub-nodes. +- **[Fork Node](./docs/fork_node.md)**: Splits data flow asynchronously, allowing for parallel execution of independent tasks. +- **[If Node](./docs/if_node.md)**: Evaluates a condition to route packets to one of two paths based on the condition. +- **[Loop Node](./docs/loop_node.md)**: Divides input packets into multiple sub-packets for iterative processing. Suitable for repeated processing tasks. +- **[Merge Node](./docs/merge_node.md)**: Combines multiple input packets into a single output packet. Merges data from various sources. +- **[NOP Node](./docs/nop_node.md)**: Responds to input packets with an empty packet, used as a terminal node in a data processing flow. +- **[Session Node](./docs/session_node.md)**: Stores and manages process-specific information, maintaining session continuity while the process is active. +- **[Snippet Node](./docs/snippet_node.md)**: Executes code snippets in various programming languages to process input packets, enabling flexible application of complex logic. +- **[Split Node](./docs/split_node.md)**: Divides input packets into multiple packets for processing, based on specified formats, and routes them through different paths. +- **[Switch Node](./docs/switch_node.md)**: Routes input packets to one of several output ports based on specified conditions. -- **System**: Manage and optimize system components. Ensure system stability and operational efficiency through tasks such as system configuration changes, resource monitoring, and performance tuning. +### **IO** + +Facilitates interaction with external data sources. + +- **[Print Node](./docs/print_node.md)**: Outputs input data to a file for debugging or monitoring purposes. +- **[Scan Node](./docs/scan_node.md)**: Scans and extracts data from various input formats. +- **[SQL Node](./docs/sql_node.md)**: Executes SQL queries on relational databases and returns results as packets. Configures database connections and transaction isolation levels. + +### **Network** + +Supports various network protocols for efficient network-related tasks. + +- **[HTTP Node](./docs/http_node.md)**: Processes HTTP requests and returns responses, suitable for web service communication. +- **[WebSocket Node](./docs/websocket_node.md)**: Establishes and manages WebSocket connections, handling message transmission and reception. +- **[Gateway Node](./docs/gateway_node.md)**: Upgrades HTTP connections to WebSocket connections for real-time data communication. +- **[Listener Node](./docs/listener_node.md)**: Receives and processes network requests on specified protocols and ports, functioning as an HTTP server. +- **[Router Node](./docs/router_node.md)**: Routes input packets to multiple output ports based on conditions, including HTTP methods and paths. + +### **System** + +Manages and optimizes system components. + +- **[Native Node](./docs/native_node.md)**: Performs system-level function calls and converts results into packets for return. diff --git a/ext/README_kr.md b/ext/README_kr.md index 0fff46a2..93e5732c 100644 --- a/ext/README_kr.md +++ b/ext/README_kr.md @@ -1,13 +1,45 @@ -# ๐Ÿ”ง ๋‚ด์žฅ ํ™•์žฅ ๊ธฐ๋Šฅ +# ๐Ÿ”ง ๊ธฐ๋ณธ ํ™•์žฅ ๊ธฐ๋Šฅ -๋‚ด์žฅ๋œ ํ™•์žฅ ๊ธฐ๋Šฅ์œผ๋กœ ์งง์€ ๊ธฐ๊ฐ„์ด ๊ฑธ๋ฆฌ๋Š” ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ์‹คํ–‰ํ•˜๊ณ  ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ํ™•์žฅ์œผ๋กœ ์‹œ์Šคํ…œ ์„ฑ๋Šฅ์„ ํ–ฅ์ƒ์‹œํ‚ค๊ณ , ์ž‘์—… ํ๋ฆ„์„ ๊ฐ„์†Œํ™”ํ•˜๋ฉฐ, ๊ฐœ๋ฐœ์ž์˜ ์ƒ์‚ฐ์„ฑ์„ ๊ทน๋Œ€ํ™”ํ•ฉ๋‹ˆ๋‹ค. +๊ธฐ๋ณธ ํ™•์žฅ ๊ธฐ๋Šฅ์„ ํ†ตํ•ด ๋‹ค์–‘ํ•œ ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๊ณ  ์‹œ์Šคํ…œ ์„ฑ๋Šฅ์„ ๊ทน๋Œ€ํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ## ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ํ™•์žฅ ๊ธฐ๋Šฅ -- **Control**: ์ œ์–ด๋ฌธ๊ณผ ๋ฐ˜๋ณต๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์ •๋ฐ€ํ•˜๊ฒŒ ๊ด€๋ฆฌํ•˜๊ณ  ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. CEL, JavaScript, TypeScript, JSON, YAML ๋“ฑ ๋‹ค์–‘ํ•œ ์–ธ์–ด์˜ ์ฝ”๋“œ ์Šค๋‹ˆํŽซ์„ ํ†ตํ•ด ๋ณต์žกํ•œ ์ž‘์—…๋„ ๊ฐ„ํŽธํ•˜๊ฒŒ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +### **Control** -- **IO**: ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐ ํŒŒ์ผ ์ž…์ถœ๋ ฅ ์ž‘์—…์„ ํฌํ•จํ•œ ์™ธ๋ถ€ ๋ฐ์ดํ„ฐ ์†Œ์Šค์™€์˜ ์ƒํ˜ธ์ž‘์šฉ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ํšจ์œจ์ ์œผ๋กœ ์ฝ๊ณ  ์“ฐ๋ฉฐ, ํŒŒ์ผ ์‹œ์Šคํ…œ ์ ‘๊ทผ, ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ฟผ๋ฆฌ ์‹คํ–‰, ์›๊ฒฉ ์„œ๋ฒ„์™€์˜ ๋ฐ์ดํ„ฐ ๊ตํ™˜ ๋“ฑ์„ ๊ฐ„๋‹จํžˆ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์ •๋ฐ€ํ•˜๊ฒŒ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค. -- **Network**: HTTP๋ฅผ ํฌํ•จํ•œ ๋‹ค์–‘ํ•œ ๋„คํŠธ์›Œํฌ ํ”„๋กœํ† ์ฝœ์„ ์ง€์›ํ•˜์—ฌ ๋„คํŠธ์›Œํฌ ๊ด€๋ จ ์ž‘์—…์„ ์›ํ™œํ•˜๊ฒŒ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๋ผ์šฐํŒ… ๊ธฐ๋Šฅ์„ ํ†ตํ•ด ๋ณต์žกํ•œ ๋„คํŠธ์›Œํฌ ์š”์ฒญ์„ ๊ด€๋ฆฌํ•˜๊ณ , API ํ˜ธ์ถœ, ๋ฐ์ดํ„ฐ ์ „์†ก, ํ†ต์‹  ํ”„๋กœํ† ์ฝœ ๊ตฌํ˜„ ๋“ฑ ๋‹ค์–‘ํ•œ ๋„คํŠธ์›Œํฌ ์ž‘์—…์„ ํšจ์œจ์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- **[Call ๋…ธ๋“œ](./docs/call_node_kr.md)**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ์—ฌ๋Ÿฌ ์ถœ๋ ฅ ํฌํŠธ๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์„ ์žฌ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- **[Block ๋…ธ๋“œ](./docs/block_node_kr.md)**: ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์„ ์ฒด๊ณ„์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜๋ฉฐ, ์—ฌ๋Ÿฌ ํ•˜์œ„ ๋…ธ๋“œ๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. +- **[Fork ๋…ธ๋“œ](./docs/fork_node_kr.md)**: ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ๋น„๋™๊ธฐ์ ์œผ๋กœ ๋ถ„๊ธฐ์‹œ์ผœ ๋…๋ฆฝ์ ์ธ ์ž‘์—…์„ ๋ณ‘๋ ฌ๋กœ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. +- **[If ๋…ธ๋“œ](./docs/if_node_kr.md)**: ์ฃผ์–ด์ง„ ์กฐ๊ฑด์„ ํ‰๊ฐ€ํ•˜์—ฌ ํŒจํ‚ท์„ ๋‘ ๊ฒฝ๋กœ๋กœ ๋ถ„๊ธฐํ•ฉ๋‹ˆ๋‹ค. ์กฐ๊ฑด์— ๋”ฐ๋ผ ์ ์ ˆํ•œ ๊ฒฝ๋กœ๋กœ ํŒจํ‚ท์„ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **[Loop ๋…ธ๋“œ](./docs/loop_node_kr.md)**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์—ฌ๋Ÿฌ ํ•˜์œ„ ํŒจํ‚ท์œผ๋กœ ๋‚˜๋ˆ„์–ด ๋ฐ˜๋ณต์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๋ฐ˜๋ณต ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•œ ์ž‘์—…์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค. +- **[Merge ๋…ธ๋“œ](./docs/merge_node_kr.md)**: ์—ฌ๋Ÿฌ ์ž…๋ ฅ ํŒจํ‚ท์„ ํ•˜๋‚˜์˜ ์ถœ๋ ฅ ํŒจํ‚ท์œผ๋กœ ํ†ตํ•ฉํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์–‘ํ•œ ์†Œ์Šค์—์„œ ์ˆ˜์ง‘๋œ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณ‘ํ•ฉํ•˜์—ฌ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. +- **[NOP ๋…ธ๋“œ](./docs/nop_node_kr.md)**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์•„๋ฌด ์ฒ˜๋ฆฌ ์—†์ด ๋น„์–ด ์žˆ๋Š” ํŒจํ‚ท์œผ๋กœ ์‘๋‹ตํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์˜ ๋งˆ์ง€๋ง‰ ๋‹จ๊ณ„์—์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. +- **[Session ๋…ธ๋“œ](./docs/session_node_kr.md)**: ํ”„๋กœ์„ธ์Šค์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์ •๋ณด๋ฅผ ์ €์žฅํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋ฉฐ, ํ”„๋กœ์„ธ์Šค๊ฐ€ ํ™œ์„ฑ ์ƒํƒœ์ธ ๋™์•ˆ ์„ธ์…˜์„ ์ง€์†์ ์œผ๋กœ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค. +- **[Snippet ๋…ธ๋“œ](./docs/snippet_node_kr.md)**: ๋‹ค์–‘ํ•œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋กœ ์ž‘์„ฑ๋œ ์ฝ”๋“œ ์Šค๋‹ˆํŽซ์„ ์‹คํ–‰ํ•˜์—ฌ ์ž…๋ ฅ ํŒจํ‚ท์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๋กœ์ง์„ ์œ ์—ฐํ•˜๊ฒŒ ์ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- **[Split ๋…ธ๋“œ](./docs/split_node_kr.md)**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์—ฌ๋Ÿฌ ๊ฐœ๋กœ ๋‚˜๋ˆ„์–ด ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ง€์ •๋œ ํ˜•์‹์— ๋”ฐ๋ผ ๋ถ„ํ• ํ•˜๊ณ , ๊ฐ ํŒจํ‚ท์„ ๋‹ค์–‘ํ•œ ๊ฒฝ๋กœ๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **[Switch ๋…ธ๋“œ](./docs/switch_node_kr.md)**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์กฐ๊ฑด์— ๋”ฐ๋ผ ์—ฌ๋Ÿฌ ํฌํŠธ ์ค‘ ํ•˜๋‚˜๋กœ ๋ถ„๊ธฐํ•ฉ๋‹ˆ๋‹ค. ์ง€์ •๋œ ์กฐ๊ฑด์„ ํ‰๊ฐ€ํ•˜์—ฌ ์ ์ ˆํ•œ ํฌํŠธ๋กœ ํŒจํ‚ท์„ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. -- **System**: ์‹œ์Šคํ…œ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ  ์ตœ์ ํ™”ํ•ฉ๋‹ˆ๋‹ค. ์‹œ์Šคํ…œ ์„ค์ • ๋ณ€๊ฒฝ, ์ž์› ๋ชจ๋‹ˆํ„ฐ๋ง, ์„ฑ๋Šฅ ํŠœ๋‹ ๋“ฑ์„ ํ†ตํ•ด ์‹œ์Šคํ…œ์„ ์•ˆ์ •์ ์œผ๋กœ ์œ ์ง€ํ•˜๊ณ  ์ตœ์ ์˜ ์ƒํƒœ๋กœ ์šด์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์‹œ์Šคํ…œ์˜ ์•ˆ์ •์„ฑ๊ณผ ํšจ์œจ์„ฑ์„ ๋†’์ด๋Š” ๋ฐ ๊ธฐ์—ฌํ•ฉ๋‹ˆ๋‹ค. +### **IO** + +์™ธ๋ถ€ ๋ฐ์ดํ„ฐ ์†Œ์Šค์™€์˜ ์ƒํ˜ธ์ž‘์šฉ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. + +- **[Print ๋…ธ๋“œ](./docs/print_node_kr.md)**: ์ž…๋ ฅ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ํŒŒ์ผ์— ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๋””๋ฒ„๊น…์ด๋‚˜ ๋ฐ์ดํ„ฐ ํ๋ฆ„ ๋ชจ๋‹ˆํ„ฐ๋ง์— ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. +- **[Scan ๋…ธ๋“œ](./docs/scan_node_kr.md)**: ๋‹ค์–‘ํ•œ ํ˜•์‹์˜ ์ž…๋ ฅ ๋ฐ์ดํ„ฐ๋ฅผ ์Šค์บ”ํ•˜๊ณ  ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”์ถœํ•˜์—ฌ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. +- **[SQL ๋…ธ๋“œ](./docs/sql_node_kr.md)**: ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์™€ ์ƒํ˜ธ์ž‘์šฉํ•˜์—ฌ SQL ์ฟผ๋ฆฌ๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฅผ ํŒจํ‚ท์œผ๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—ฐ๊ฒฐ ๋ฐ ํŠธ๋žœ์žญ์…˜ ๊ฒฉ๋ฆฌ ์ˆ˜์ค€ ์„ค์ •์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. + +### **Network** + +๋‹ค์–‘ํ•œ ๋„คํŠธ์›Œํฌ ํ”„๋กœํ† ์ฝœ์„ ์ง€์›ํ•˜์—ฌ ๋„คํŠธ์›Œํฌ ๊ด€๋ จ ์ž‘์—…์„ ์›ํ™œํ•˜๊ฒŒ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. + +- **[HTTP ๋…ธ๋“œ](./docs/http_node_kr.md)**: HTTP ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ์›น ์„œ๋น„์Šค์™€์˜ ํ†ต์‹ ์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค. +- **[WebSocket ๋…ธ๋“œ](./docs/websocket_node_kr.md)**: WebSocket ์—ฐ๊ฒฐ์„ ์„ค์ •ํ•˜๊ณ  ๋ฉ”์‹œ์ง€๋ฅผ ์†ก์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค. WebSocket ์„œ๋ฒ„์™€์˜ ์—ฐ๊ฒฐ์„ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. +- **[Gateway ๋…ธ๋“œ](./docs/gateway_node_kr.md)**: HTTP ์—ฐ๊ฒฐ์„ WebSocket ์—ฐ๊ฒฐ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜์—ฌ ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ํ†ต์‹ ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. +- **[Listener ๋…ธ๋“œ](./docs/listener_node_kr.md)**: ์ง€์ •๋œ ํ”„๋กœํ† ์ฝœ๊ณผ ํฌํŠธ์—์„œ ๋“ค์–ด์˜ค๋Š” ๋„คํŠธ์›Œํฌ ์š”์ฒญ์„ ์ˆ˜์‹ ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. HTTP ์„œ๋ฒ„ ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. +- **[Router ๋…ธ๋“œ](./docs/router_node_kr.md)**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์กฐ๊ฑด์— ๋”ฐ๋ผ ์—ฌ๋Ÿฌ ์ถœ๋ ฅ ํฌํŠธ๋กœ ๋ผ์šฐํŒ…ํ•ฉ๋‹ˆ๋‹ค. HTTP ๋ฉ”์„œ๋“œ์™€ ๊ฒฝ๋กœ์— ๊ธฐ๋ฐ˜ํ•˜์—ฌ ํŒจํ‚ท์„ ๋ถ„๊ธฐํ•ฉ๋‹ˆ๋‹ค. + +### **System** + +์‹œ์Šคํ…œ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ  ์ตœ์ ํ™”ํ•ฉ๋‹ˆ๋‹ค. + +- **[Native ๋…ธ๋“œ](./docs/native_node_kr.md)**: ์‹œ์Šคํ…œ ๋‚ด๋ถ€์—์„œ ํ•จ์ˆ˜ ํ˜ธ์ถœ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ณ , ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ํŒจํ‚ท์œผ๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. diff --git a/ext/docs/block_node.md b/ext/docs/block_node.md new file mode 100644 index 00000000..45bd891e --- /dev/null +++ b/ext/docs/block_node.md @@ -0,0 +1,39 @@ +# Block Node + +**The Block Node** systematically manages complex data processing flows and executes multiple sub-nodes sequentially. This allows you to organize data processing tasks clearly and efficiently. + +## Specification + +- **specs**: Defines the list of sub-nodes to be executed. Each sub-node handles a specific step in the data processing flow and is executed in sequence. + +## Ports + +- **in**: Passes the input packet to the first sub-node. +- **out**: Outputs the result processed by the last sub-node to the external environment. +- **error**: Sends any errors encountered by the sub-nodes to the external environment. + +## Example + +```yaml +- kind: block + specs: + - kind: snippet + language: javascript + code: | + export default function (args) { + return { + payload: { + method: 'GET', + body: args + } + }; + } + - kind: http + url: https://api.example.com/data + - kind: snippet + language: javascript + code: | + export default function (args) { + return args.body; + } +``` diff --git a/ext/docs/block_node_kr.md b/ext/docs/block_node_kr.md new file mode 100644 index 00000000..422ab1b5 --- /dev/null +++ b/ext/docs/block_node_kr.md @@ -0,0 +1,39 @@ +# Block ๋…ธ๋“œ + +**Block ๋…ธ๋“œ**๋Š” ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์„ ์ฒด๊ณ„์ ์œผ๋กœ ๊ด€๋ฆฌํ•˜๋ฉฐ, ์—ฌ๋Ÿฌ ํ•˜์œ„ ๋…ธ๋“œ๋ฅผ ์ˆœ์ฐจ์ ์œผ๋กœ ์‹คํ–‰ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ์ž‘์—…์„ ๋ช…ํ™•ํ•˜๊ณ  ํšจ์œจ์ ์œผ๋กœ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **specs**: ์‹คํ–‰ํ•  ํ•˜์œ„ ๋…ธ๋“œ์˜ ๋ชฉ๋ก์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ํ•˜์œ„ ๋…ธ๋“œ๋Š” ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์—์„œ ํŠน์ • ๋‹จ๊ณ„๋ฅผ ๋‹ด๋‹นํ•˜๋ฉฐ, ์ˆœ์ฐจ์ ์œผ๋กœ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ฒซ ๋ฒˆ์งธ ํ•˜์œ„ ๋…ธ๋“œ๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **out**: ๋งˆ์ง€๋ง‰ ํ•˜์œ„ ๋…ธ๋“œ์—์„œ ์ฒ˜๋ฆฌ๋œ ๊ฒฐ๊ณผ๋ฅผ ์™ธ๋ถ€๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **error**: ํ•˜์œ„ ๋…ธ๋“œ์—์„œ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์™ธ๋ถ€๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: block + specs: + - kind: snippet + language: javascript + code: | + export default function (args) { + return { + payload: { + method: 'GET', + body: args + } + }; + } + - kind: http + url: https://api.example.com/data + - kind: snippet + language: javascript + code: | + export default function (args) { + return args.body; + } +``` diff --git a/ext/docs/call_node.md b/ext/docs/call_node.md new file mode 100644 index 00000000..5a461065 --- /dev/null +++ b/ext/docs/call_node.md @@ -0,0 +1,27 @@ +# Call Node + +**The Call Node** processes the input packet and delivers the result to multiple output ports. This node allows for the reuse of data processing flows and is useful for modularizing complex tasks. + +## Specification + +- No additional arguments are required. + +## Ports + +- **in**: Processes the input packet. +- **out[0]**: Passes the input packet to the first processing node and outputs the result externally. +- **out[1]**: Passes the result of the first processing node to the second processing node. +- **error**: Sends any errors encountered during processing to the external environment. + +## Example + +```yaml +- kind: call + ports: + out[0]: + - name: origin + port: in + out[1]: + - name: next + port: in +``` diff --git a/ext/docs/call_node_kr.md b/ext/docs/call_node_kr.md new file mode 100644 index 00000000..a156a01c --- /dev/null +++ b/ext/docs/call_node_kr.md @@ -0,0 +1,27 @@ +# Call ๋…ธ๋“œ + +**Call ๋…ธ๋“œ**๋Š” ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ์—ฌ๋Ÿฌ ์ถœ๋ ฅ ํฌํŠธ๋กœ ์ „๋‹ฌํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์„ ํ˜ธ์ถœํ•˜์—ฌ ์žฌ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋ณต์žกํ•œ ์ž‘์—…์„ ๋ชจ๋“ˆํ™”ํ•˜๋Š” ๋ฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- ์ถ”๊ฐ€ ์ธ์ž๋ฅผ ์š”๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. +- **out[0]**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ฒซ ๋ฒˆ์งธ ์ฒ˜๋ฆฌ ๋…ธ๋“œ๋กœ ์ „๋‹ฌํ•˜๊ณ , ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ์™ธ๋ถ€๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **out[1]**: ์ฒซ ๋ฒˆ์งธ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ๋‘ ๋ฒˆ์งธ ์ฒ˜๋ฆฌ ๋…ธ๋“œ๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **error**: ์ฒ˜๋ฆฌ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์™ธ๋ถ€๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: call + ports: + out[0]: + - name: origin + port: in + out[1]: + - name: next + port: in +``` diff --git a/ext/docs/fork_node.md b/ext/docs/fork_node.md new file mode 100644 index 00000000..4afd85a0 --- /dev/null +++ b/ext/docs/fork_node.md @@ -0,0 +1,23 @@ +# Fork Node + +**The Fork Node** provides the capability to asynchronously branch the data processing flow, allowing it to be handled in separate processes. This enables parallel processing and allows independent tasks to be performed without blocking the main flow. + +## Specification + +- No additional arguments are required. + +## Ports + +- **in**: Passes the input packet to a new process and returns an empty packet. +- **out**: Outputs the results processed asynchronously. +- **error**: Sends any errors encountered during processing to the external environment. + +## Example + +```yaml +- kind: fork + ports: + out: + - name: next + port: out +``` diff --git a/ext/docs/fork_node_kr.md b/ext/docs/fork_node_kr.md new file mode 100644 index 00000000..2db36245 --- /dev/null +++ b/ext/docs/fork_node_kr.md @@ -0,0 +1,23 @@ +# Fork ๋…ธ๋“œ + +**Fork ๋…ธ๋“œ**๋Š” ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์„ ๋น„๋™๊ธฐ์ ์œผ๋กœ ๋ถ„๊ธฐํ•˜์—ฌ ๋ณ„๋„์˜ ํ”„๋กœ์„ธ์Šค์—์„œ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ๋ณ‘๋ ฌ ์ฒ˜๋ฆฌ๊ฐ€ ๊ฐ€๋Šฅํ•ด์ง€๋ฉฐ, ๋ฉ”์ธ ํ๋ฆ„์„ ์ฐจ๋‹จํ•˜์ง€ ์•Š๊ณ  ๋…๋ฆฝ์ ์ธ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- ์ถ”๊ฐ€ ์ธ์ž๋ฅผ ์š”๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ƒˆ๋กœ์šด ํ”„๋กœ์„ธ์Šค๋กœ ์ „๋‹ฌํ•˜๊ณ , ๋นˆ ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. +- **out**: ๋น„๋™๊ธฐ์ ์œผ๋กœ ์ฒ˜๋ฆฌ๋œ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **error**: ์ฒ˜๋ฆฌ ๊ณผ์ •์—์„œ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์™ธ๋ถ€๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: fork + ports: + out: + - name: next + port: out +``` diff --git a/ext/docs/gateway_node.md b/ext/docs/gateway_node.md new file mode 100644 index 00000000..cb62ce67 --- /dev/null +++ b/ext/docs/gateway_node.md @@ -0,0 +1,70 @@ +# Gateway Node + +**The Gateway Node** provides the capability to upgrade network protocols to other protocols, primarily converting HTTP connections to WebSocket connections to support real-time data communication. + +## Specification + +- **protocol**: Specifies the protocol to be used. Currently, the supported protocol is `websocket`. +- **timeout**: Sets the timeout duration for the HTTP handshake. (Optional) +- **buffer**: Sets the size of the read and write buffers. (Optional) + +## Ports + +- **io**: Receives HTTP requests and upgrades them to WebSocket connections. + - **method**: HTTP request method (e.g., `GET`, `POST`) + - **scheme**: URL scheme (e.g., `http`, `https`) + - **host**: Request host + - **path**: Request path + - **query**: URL query string parameters + - **protocol**: HTTP protocol version (e.g., `HTTP/1.1`) + - **header**: HTTP headers + - **body**: Request body +- **in**: Sends packets through the WebSocket connection. + - **type**: Type of WebSocket packet + - **data**: Data of the WebSocket packet, which is analyzed and converted to the appropriate format from the raw bytes. +- **out**: Returns packets received through the WebSocket connection. + - **type**: Type of WebSocket packet + - **data**: Data of the WebSocket packet, which is analyzed and converted to the appropriate format from the raw bytes. +- **error**: Returns errors encountered during WebSocket upgrade or data transmission. + +## Example + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: router + port: in + +- kind: router + name: router + routes: + - method: GET + path: /ws + port: out[0] + ports: + out[0]: + - name: gateway + port: io + - name: proxy + port: io + +- kind: gateway + name: gateway + protocol: websocket + ports: + out: + - name: proxy + port: in + +- kind: websocket + name: proxy + url: wss://echo.websocket.org/ + ports: + out: + - name: gateway + port: in +``` diff --git a/ext/docs/gateway_node_kr.md b/ext/docs/gateway_node_kr.md new file mode 100644 index 00000000..e5c79712 --- /dev/null +++ b/ext/docs/gateway_node_kr.md @@ -0,0 +1,70 @@ +# Gateway ๋…ธ๋“œ + +**Gateway ๋…ธ๋“œ**๋Š” ๋„คํŠธ์›Œํฌ ํ”„๋กœํ† ์ฝœ์„ ๋‹ค๋ฅธ ํ”„๋กœํ† ์ฝœ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋ฉฐ, ์ฃผ๋กœ HTTP ์—ฐ๊ฒฐ์„ WebSocket ์—ฐ๊ฒฐ๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ํ†ต์‹ ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **protocol**: ์‚ฌ์šฉํ•  ํ”„๋กœํ† ์ฝœ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ์ง€์›๋˜๋Š” ํ”„๋กœํ† ์ฝœ์€ `websocket`์ž…๋‹ˆ๋‹ค. +- **timeout**: HTTP ํ•ธ๋“œ์…ฐ์ดํฌ์˜ ํƒ€์ž„์•„์›ƒ ๊ธฐ๊ฐ„์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) +- **buffer**: ์ฝ๊ธฐ ๋ฐ ์“ฐ๊ธฐ ๋ฒ„ํผ์˜ ํฌ๊ธฐ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) + +## ํฌํŠธ + +- **io**: HTTP ์š”์ฒญ์„ ์ˆ˜์‹ ํ•˜์—ฌ WebSocket ์—ฐ๊ฒฐ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•ฉ๋‹ˆ๋‹ค. + - **method**: HTTP ์š”์ฒญ ๋ฉ”์„œ๋“œ (์˜ˆ: `GET`, `POST`) + - **scheme**: URL์˜ ์Šคํ‚ด (์˜ˆ: `http`, `https`) + - **host**: ์š”์ฒญ์˜ ํ˜ธ์ŠคํŠธ + - **path**: ์š”์ฒญ์˜ ๊ฒฝ๋กœ + - **query**: URL ์ฟผ๋ฆฌ ๋ฌธ์ž์—ด ํŒŒ๋ผ๋ฏธํ„ฐ + - **protocol**: HTTP ํ”„๋กœํ† ์ฝœ ๋ฒ„์ „ (์˜ˆ: `HTTP/1.1`) + - **header**: HTTP ํ—ค๋” + - **body**: ์š”์ฒญ ๋ณธ๋ฌธ +- **in**: WebSocket ์—ฐ๊ฒฐ์„ ํ†ตํ•ด ํŒจํ‚ท์„ ์†ก์‹ ํ•ฉ๋‹ˆ๋‹ค. + - **type**: WebSocket ํŒจํ‚ท์˜ ํƒ€์ž… + - **data**: WebSocket ํŒจํ‚ท์˜ ๋ฐ์ดํ„ฐ๋กœ, ์›๋ณธ ๋ฐ”์ดํŠธ๋ฅผ ๋ถ„์„ํ•˜์—ฌ ์ ์ ˆํ•œ ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค. +- **out**: WebSocket ์—ฐ๊ฒฐ์„ ํ†ตํ•ด ์ˆ˜์‹ ๋œ ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + - **type**: WebSocket ํŒจํ‚ท์˜ ํƒ€์ž… + - **data**: WebSocket ํŒจํ‚ท์˜ ๋ฐ์ดํ„ฐ๋กœ, ์›๋ณธ ๋ฐ”์ดํŠธ๋ฅผ ๋ถ„์„ํ•˜์—ฌ ์ ์ ˆํ•œ ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค. +- **error**: WebSocket ์—…๊ทธ๋ ˆ์ด๋“œ ๋˜๋Š” ๋ฐ์ดํ„ฐ ์†ก์ˆ˜์‹  ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: router + port: in + +- kind: router + name: router + routes: + - method: GET + path: /ws + port: out[0] + ports: + out[0]: + - name: gateway + port: io + - name: proxy + port: io + +- kind: gateway + name: gateway + protocol: websocket + ports: + out: + - name: proxy + port: in + +- kind: websocket + name: proxy + url: wss://echo.websocket.org/ + ports: + out: + - name: gateway + port: in +``` diff --git a/ext/docs/http_node.md b/ext/docs/http_node.md new file mode 100644 index 00000000..cce0722f --- /dev/null +++ b/ext/docs/http_node.md @@ -0,0 +1,49 @@ +# HTTP Node + +**The HTTP Node** processes HTTP client requests, generates requests to communicate with web services, and returns responses. + +## Specification + +- **url**: Specifies the target URL to send the request to. (Optional) +- **timeout**: Sets the timeout duration for the HTTP request. (Optional) + +## Ports + +- **in**: Receives HTTP requests. + - **method**: HTTP method (e.g., `GET`, `POST`) + - **scheme**: URL scheme (e.g., `http`, `https`) + - **host**: Request host + - **path**: Request path + - **query**: URL query string parameters + - **protocol**: HTTP protocol version (e.g., `HTTP/1.1`) + - **header**: HTTP headers + - **body**: Request body + - **status**: HTTP status code +- **out**: Returns HTTP responses. + - **method**: HTTP method (e.g., `GET`, `POST`) + - **scheme**: URL scheme (e.g., `http`, `https`) + - **host**: Request host + - **path**: Request path + - **query**: URL query string parameters + - **protocol**: HTTP protocol version (e.g., `HTTP/1.1`) + - **header**: HTTP headers + - **body**: Request body + - **status**: HTTP status code +- **error**: Returns errors encountered during request processing. + +## Example + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: proxy + port: in + +- kind: http + name: proxy + url: https://example.com/ +``` diff --git a/ext/docs/http_node_kr.md b/ext/docs/http_node_kr.md new file mode 100644 index 00000000..ba5fae42 --- /dev/null +++ b/ext/docs/http_node_kr.md @@ -0,0 +1,49 @@ +# HTTP ๋…ธ๋“œ + +**HTTP ๋…ธ๋“œ**๋Š” HTTP ํด๋ผ์ด์–ธํŠธ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๊ณ , ์š”์ฒญ์„ ์ƒ์„ฑํ•˜์—ฌ ์›น ์„œ๋น„์Šค์™€ ํ†ต์‹ ํ•œ ํ›„ ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **url**: ์š”์ฒญ์„ ๋ณด๋‚ผ ๋Œ€์ƒ URL์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) +- **timeout**: HTTP ์š”์ฒญ์˜ ํƒ€์ž„์•„์›ƒ ๊ธฐ๊ฐ„์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) + +## ํฌํŠธ + +- **in**: HTTP ์š”์ฒญ์„ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค. + - **method**: HTTP ๋ฉ”์„œ๋“œ (์˜ˆ: `GET`, `POST`) + - **scheme**: URL์˜ ์Šคํ‚ด (์˜ˆ: `http`, `https`) + - **host**: ์š”์ฒญ์˜ ํ˜ธ์ŠคํŠธ + - **path**: ์š”์ฒญ์˜ ๊ฒฝ๋กœ + - **query**: URL ์ฟผ๋ฆฌ ๋ฌธ์ž์—ด ํŒŒ๋ผ๋ฏธํ„ฐ + - **protocol**: HTTP ํ”„๋กœํ† ์ฝœ ๋ฒ„์ „ (์˜ˆ: `HTTP/1.1`) + - **header**: HTTP ํ—ค๋” + - **body**: ์š”์ฒญ ๋ณธ๋ฌธ + - **status**: HTTP ์ƒํƒœ ์ฝ”๋“œ +- **out**: HTTP ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + - **method**: HTTP ๋ฉ”์„œ๋“œ (์˜ˆ: `GET`, `POST`) + - **scheme**: URL์˜ ์Šคํ‚ด (์˜ˆ: `http`, `https`) + - **host**: ์š”์ฒญ์˜ ํ˜ธ์ŠคํŠธ + - **path**: ์š”์ฒญ์˜ ๊ฒฝ๋กœ + - **query**: URL ์ฟผ๋ฆฌ ๋ฌธ์ž์—ด ํŒŒ๋ผ๋ฏธํ„ฐ + - **protocol**: HTTP ํ”„๋กœํ† ์ฝœ ๋ฒ„์ „ (์˜ˆ: `HTTP/1.1`) + - **header**: HTTP ํ—ค๋” + - **body**: ์š”์ฒญ ๋ณธ๋ฌธ + - **status**: HTTP ์ƒํƒœ ์ฝ”๋“œ +- **error**: ์š”์ฒญ ์ฒ˜๋ฆฌ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: proxy + port: in + +- kind: http + name: proxy + url: https://example.com/ +``` diff --git a/ext/docs/if_node.md b/ext/docs/if_node.md new file mode 100644 index 00000000..ee5bdf26 --- /dev/null +++ b/ext/docs/if_node.md @@ -0,0 +1,28 @@ +# If Node + +**The If Node** provides the capability to branch packets based on a given condition, directing them along one of two paths. This node evaluates the condition and executes different data flows depending on the result. + +## Specification + +- **when**: An expression that defines the condition. This expression is written in `Common Expression Language (CEL)`, compiled, and executed. + +## Ports + +- **in**: Receives the input packet and evaluates the condition to determine branching. +- **out[0]**: Passes the packet if the condition is true. +- **out[1]**: Passes the packet if the condition is false. +- **error**: Sends any errors encountered during condition evaluation to the external environment. + +## Example + +```yaml +- kind: if + when: "self.count > 10" + ports: + out[0]: + - name: true_path + port: out + out[1]: + - name: false_path + port: out +``` diff --git a/ext/docs/if_node_kr.md b/ext/docs/if_node_kr.md new file mode 100644 index 00000000..bc6c07e9 --- /dev/null +++ b/ext/docs/if_node_kr.md @@ -0,0 +1,28 @@ +# If ๋…ธ๋“œ + +**If ๋…ธ๋“œ**๋Š” ์ฃผ์–ด์ง„ ์กฐ๊ฑด์— ๋”ฐ๋ผ ํŒจํ‚ท์„ ๋ถ„๊ธฐํ•˜์—ฌ ๋‘ ๊ฐœ์˜ ๊ฒฝ๋กœ ์ค‘ ํ•˜๋‚˜๋กœ ์ „๋‹ฌํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ์กฐ๊ฑด์„ ํ‰๊ฐ€ํ•˜๊ณ , ๊ทธ ๊ฒฐ๊ณผ์— ๋”ฐ๋ผ ๋‹ค๋ฅธ ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **when**: ์กฐ๊ฑด์„ ์ •์˜ํ•˜๋Š” ํ‘œํ˜„์‹์ž…๋‹ˆ๋‹ค. ์ด ํ‘œํ˜„์‹์€ `Common Expression Language (CEL)`๋กœ ์ž‘์„ฑ๋˜์–ด ์ปดํŒŒ์ผ๋˜๊ณ  ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜๊ณ  ์กฐ๊ฑด์„ ํ‰๊ฐ€ํ•˜์—ฌ ๋ถ„๊ธฐํ•ฉ๋‹ˆ๋‹ค. +- **out[0]**: ์กฐ๊ฑด์ด ์ฐธ์ผ ๋•Œ ํŒจํ‚ท์„ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **out[1]**: ์กฐ๊ฑด์ด ๊ฑฐ์ง“์ผ ๋•Œ ํŒจํ‚ท์„ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **error**: ์กฐ๊ฑด ํ‰๊ฐ€ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์™ธ๋ถ€๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: if + when: "self.count > 10" + ports: + out[0]: + - name: true_path + port: out + out[1]: + - name: false_path + port: out +``` diff --git a/ext/docs/listener_node.md b/ext/docs/listener_node.md new file mode 100644 index 00000000..83c505f7 --- /dev/null +++ b/ext/docs/listener_node.md @@ -0,0 +1,42 @@ +# Listener Node + +**The Listener Node** provides the functionality to receive and process network requests on a specified protocol and port. It primarily acts as an HTTP server, handling client requests and returning appropriate responses. + +## Specification + +- **protocol**: Specifies the protocol to handle. Currently, only the `http` protocol is supported. +- **host**: Specifies the host address of the server. (Optional) +- **port**: Sets the port number on which the server will listen. +- **cert**: Sets the TLS certificate for HTTPS use. (Optional) +- **key**: Sets the TLS private key for HTTPS use. (Optional) + +## Ports + +- **out**: Returns packets received via the HTTP connection. + - **method**: HTTP request method (e.g., `GET`, `POST`) + - **scheme**: URL scheme (e.g., `http`, `https`) + - **host**: Request host + - **path**: Request path + - **query**: URL query string parameters + - **protocol**: HTTP protocol version (e.g., `HTTP/1.1`) + - **header**: HTTP headers + - **body**: Request body + - **status**: HTTP status code + +## Example + +```yaml +kind: listener +spec: + protocol: http + host: "localhost" + port: 8080 + cert: | + -----BEGIN CERTIFICATE----- + [certificate data] + -----END CERTIFICATE----- + key: | + -----BEGIN PRIVATE KEY----- + [key data] + -----END PRIVATE KEY----- +``` diff --git a/ext/docs/listener_node_kr.md b/ext/docs/listener_node_kr.md new file mode 100644 index 00000000..5cd66bc2 --- /dev/null +++ b/ext/docs/listener_node_kr.md @@ -0,0 +1,42 @@ +# Listener ๋…ธ๋“œ + +**Listener ๋…ธ๋“œ**๋Š” ์ง€์ •๋œ ํ”„๋กœํ† ์ฝœ๊ณผ ํฌํŠธ์—์„œ ๋„คํŠธ์›Œํฌ ์š”์ฒญ์„ ์ˆ˜์‹ ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ฃผ๋กœ HTTP ์„œ๋ฒ„ ์—ญํ• ์„ ํ•˜๋ฉฐ, ํด๋ผ์ด์–ธํŠธ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ์ ์ ˆํ•œ ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **protocol**: ์ฒ˜๋ฆฌํ•  ํ”„๋กœํ† ์ฝœ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ๋Š” `http` ํ”„๋กœํ† ์ฝœ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. +- **host**: ์„œ๋ฒ„์˜ ํ˜ธ์ŠคํŠธ ์ฃผ์†Œ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) +- **port**: ์„œ๋ฒ„๊ฐ€ ๋ฆฌ์Šจํ•  ํฌํŠธ ๋ฒˆํ˜ธ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. +- **cert**: HTTPS๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ TLS ์ธ์ฆ์„œ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) +- **key**: HTTPS๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ TLS ๋น„๋ฐ€ ํ‚ค๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) + +## ํฌํŠธ + +- **out**: HTTP ์—ฐ๊ฒฐ์„ ํ†ตํ•ด ์ˆ˜์‹ ๋œ ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + - **method**: HTTP ์š”์ฒญ ๋ฉ”์„œ๋“œ (์˜ˆ: `GET`, `POST`) + - **scheme**: URL ์Šคํ‚ด (์˜ˆ: `http`, `https`) + - **host**: ์š”์ฒญ์˜ ํ˜ธ์ŠคํŠธ + - **path**: ์š”์ฒญ์˜ ๊ฒฝ๋กœ + - **query**: URL ์ฟผ๋ฆฌ ๋ฌธ์ž์—ด ํŒŒ๋ผ๋ฏธํ„ฐ + - **protocol**: HTTP ํ”„๋กœํ† ์ฝœ ๋ฒ„์ „ (์˜ˆ: `HTTP/1.1`) + - **header**: HTTP ํ—ค๋” + - **body**: ์š”์ฒญ ๋ณธ๋ฌธ + - **status**: HTTP ์ƒํƒœ ์ฝ”๋“œ + +## ์˜ˆ์‹œ + +```yaml +kind: listener +spec: + protocol: http + host: "localhost" + port: 8080 + cert: | + -----BEGIN CERTIFICATE----- + [certificate data] + -----END CERTIFICATE----- + key: | + -----BEGIN PRIVATE KEY----- + [key data] + -----END PRIVATE KEY----- +``` diff --git a/ext/docs/loop_node.md b/ext/docs/loop_node.md new file mode 100644 index 00000000..b399b90b --- /dev/null +++ b/ext/docs/loop_node.md @@ -0,0 +1,27 @@ +# Loop Node + +**The Loop Node** provides the functionality to split an incoming packet into multiple sub-packets for repeated processing. This is useful in data processing flows where repeated tasks are needed, and it integrates the results of each sub-packet before returning them. + +## Specification + +- No additional arguments are required. + +## Ports + +- **in**: Receives packets from external sources and initiates the repeat operation. If the input is an array, each element is split into sub-packets and processed individually. If the input is not an array, it will be processed only once. +- **out[0]**: Passes the split sub-packets to the first output port. +- **out[1]**: Aggregates the results of all sub-packet processing and passes them to the second output port. +- **error**: Sends any errors encountered during processing to the external environment. + +## Example + +```yaml +- kind: loop + ports: + out[0]: + - name: next + port: out + out[1]: + - name: done + port: out +``` diff --git a/ext/docs/loop_node_kr.md b/ext/docs/loop_node_kr.md new file mode 100644 index 00000000..39591507 --- /dev/null +++ b/ext/docs/loop_node_kr.md @@ -0,0 +1,27 @@ +# Loop ๋…ธ๋“œ + +**Loop ๋…ธ๋“œ**๋Š” ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์—ฌ๋Ÿฌ ํ•˜์œ„ ํŒจํ‚ท์œผ๋กœ ๋ถ„๋ฆฌํ•˜์—ฌ ๋ฐ˜๋ณต์ ์œผ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋ฐ˜๋ณต ์ž‘์—…์ด ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์—์„œ ์œ ์šฉํ•˜๋ฉฐ, ๊ฐ๊ฐ์˜ ํ•˜์œ„ ํŒจํ‚ท์„ ์ฒ˜๋ฆฌํ•œ ํ›„ ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ํ†ตํ•ฉํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- ์ถ”๊ฐ€ ์ธ์ž๋Š” ์š”๊ตฌ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์™ธ๋ถ€์—์„œ ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜์—ฌ ๋ฐ˜๋ณต ์ž‘์—…์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ์ž…๋ ฅ์ด ๋ฐฐ์—ด์ผ ๊ฒฝ์šฐ ๊ฐ ์š”์†Œ๊ฐ€ ํ•˜์œ„ ํŒจํ‚ท์œผ๋กœ ๋ถ„๋ฆฌ๋˜์–ด ๊ฐœ๋ณ„์ ์œผ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค. ๋ฐฐ์—ด์ด ์•„๋‹Œ ๊ฒฝ์šฐ ํ•œ ๋ฒˆ๋งŒ ๋ฐ˜๋ณต๋ฉ๋‹ˆ๋‹ค. +- **out[0]**: ๋ถ„๋ฆฌ๋œ ํ•˜์œ„ ํŒจํ‚ท์„ ์ฒซ ๋ฒˆ์งธ ์ถœ๋ ฅ ํฌํŠธ๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **out[1]**: ๋ชจ๋“  ํ•˜์œ„ ํŒจํ‚ท์˜ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ ๋ชจ์•„ ๋‘ ๋ฒˆ์งธ ์ถœ๋ ฅ ํฌํŠธ๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. +- **error**: ์ฒ˜๋ฆฌ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์™ธ๋ถ€๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: loop + ports: + out[0]: + - name: next + port: out + out[1]: + - name: done + port: out +``` diff --git a/ext/docs/merge_node.md b/ext/docs/merge_node.md new file mode 100644 index 00000000..63c4689d --- /dev/null +++ b/ext/docs/merge_node.md @@ -0,0 +1,40 @@ +# Merge Node + +**The Merge Node** provides the functionality to combine multiple input packets into a single output packet. It is useful for aggregating data from various input sources into one packet for further processing or transmission. + +## Specification + +- No additional arguments are required. + +## Ports + +- **in[*]**: Receives multiple input packets. Each input port accepts packets from different data sources and supports various formats. +- **out**: Outputs the result of merging the input packets into a single packet. +- **error**: Passes any errors encountered during the merging process. + +## Example + +```yaml +- kind: snippet + language: json + code: 0 + ports: + out: + - name: merge + port: in[0] + +- kind: snippet + language: json + code: 1 + ports: + out: + - name: merge + port: in[1] + +- kind: merge + name: merge + ports: + out: + - name: next + port: out +``` diff --git a/ext/docs/merge_node_kr.md b/ext/docs/merge_node_kr.md new file mode 100644 index 00000000..a33d05bf --- /dev/null +++ b/ext/docs/merge_node_kr.md @@ -0,0 +1,40 @@ +# Merge ๋…ธ๋“œ + +**Merge ๋…ธ๋“œ**๋Š” ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์ž…๋ ฅ ํŒจํ‚ท์„ ํ•˜๋‚˜๋กœ ํ†ตํ•ฉํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ๋‹ค์–‘ํ•œ ์ž…๋ ฅ ์†Œ์Šค์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜์—ฌ ํ•˜๋‚˜์˜ ํŒจํ‚ท์œผ๋กœ ํ•ฉ์น˜๊ณ  ์ฒ˜๋ฆฌํ•˜๊ฑฐ๋‚˜ ์ „๋‹ฌํ•  ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- ์ถ”๊ฐ€์ ์ธ ์ธ์ž๋ฅผ ์š”๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in[*]**: ์—ฌ๋Ÿฌ ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ์ž…๋ ฅ ํฌํŠธ๋Š” ๋ณ„๋„์˜ ๋ฐ์ดํ„ฐ ์†Œ์Šค์—์„œ ์ „๋‹ฌ๋˜๋Š” ํŒจํ‚ท์„ ๋ฐ›์œผ๋ฉฐ, ๋‹ค์–‘ํ•œ ํ˜•์‹์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. +- **out**: ์ž…๋ ฅ๋œ ํŒจํ‚ท๋“ค์„ ๋ณ‘ํ•ฉํ•œ ๊ฒฐ๊ณผ๋ฅผ ํ•˜๋‚˜์˜ ํŒจํ‚ท์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **error**: ๋ณ‘ํ•ฉ ๊ณผ์ •์—์„œ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: snippet + language: json + code: 0 + ports: + out: + - name: merge + port: in[0] + +- kind: snippet + language: json + code: 1 + ports: + out: + - name: merge + port: in[1] + +- kind: merge + name: merge + ports: + out: + - name: next + port: out +``` diff --git a/ext/docs/native_node.md b/ext/docs/native_node.md new file mode 100644 index 00000000..281a78b7 --- /dev/null +++ b/ext/docs/native_node.md @@ -0,0 +1,29 @@ +# Native Node + +**The Native Node** performs function call operations within the system. This node processes system calls based on the `opcode`, passing input packets to the function for execution and returning the result. + +## Specification + +- **opcode**: A string identifying the system operation to be invoked. It is associated with the specified function and determines the node's behavior. + +## Ports + +- **in**: Receives input packets and converts them into arguments for the specified function call. The payload of the packet is adjusted to match the function's parameters. +- **out**: Returns the result of the function call. If the function returns multiple values, the result is output as an array. +- **error**: Returns any errors encountered during the function call. If an error occurs, it outputs the error message. + +## Example + +```yaml +- kind: snippet + language: cel + code: 'has(self.body) ? self.body : null' + ports: + out: + - name: nodes_create + port: in + +- kind: native + name: nodes_create + opcode: nodes.create +``` diff --git a/ext/docs/native_node_kr.md b/ext/docs/native_node_kr.md new file mode 100644 index 00000000..21485a99 --- /dev/null +++ b/ext/docs/native_node_kr.md @@ -0,0 +1,29 @@ +# Native ๋…ธ๋“œ + +**Native ๋…ธ๋“œ**๋Š” ์‹œ์Šคํ…œ ๋‚ด๋ถ€์—์„œ ํ•จ์ˆ˜ ํ˜ธ์ถœ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๋…ธ๋“œ์ž…๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” `opcode`๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์‹œ์Šคํ…œ ํ˜ธ์ถœ์„ ์ฒ˜๋ฆฌํ•˜๋ฉฐ, ์ž…๋ ฅ ํŒจํ‚ท์„ ํ•จ์ˆ˜์— ์ „๋‹ฌํ•˜์—ฌ ์‹คํ–‰ํ•˜๊ณ , ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **opcode**: ํ˜ธ์ถœํ•  ์‹œ์Šคํ…œ ์ž‘์—…์„ ์‹๋ณ„ํ•˜๋Š” ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. ์ง€์ •๋œ ํ•จ์ˆ˜์™€ ์—ฐ๊ด€๋˜๋ฉฐ, ์ด ๊ฐ’์„ ํ†ตํ•ด ๋…ธ๋“œ์˜ ๋™์ž‘์„ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜์—ฌ ์ง€์ •๋œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์— ํ•„์š”ํ•œ ์ธ์ˆ˜๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ํŒจํ‚ท์˜ ํŽ˜์ด๋กœ๋“œ๋Š” ํ•จ์ˆ˜์˜ ๋งค๊ฐœ๋ณ€์ˆ˜์™€ ์ผ์น˜ํ•˜๋„๋ก ์กฐ์ •๋ฉ๋‹ˆ๋‹ค. +- **out**: ํ•จ์ˆ˜ ํ˜ธ์ถœ์˜ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ํ•จ์ˆ˜์˜ ๋ฐ˜ํ™˜๊ฐ’์ด ์—ฌ๋Ÿฌ ๊ฐœ์ผ ๊ฒฝ์šฐ, ๋ฐฐ์—ด๋กœ ํŒจํ‚ท์„ ์ƒ์„ฑํ•˜์—ฌ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **error**: ํ•จ์ˆ˜ ํ˜ธ์ถœ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: snippet + language: cel + code: 'has(self.body) ? self.body : null' + ports: + out: + - name: nodes_create + port: in + +- kind: native + name: nodes_create + opcode: nodes.create +``` diff --git a/ext/docs/nop_node.md b/ext/docs/nop_node.md new file mode 100644 index 00000000..0ad2cb9a --- /dev/null +++ b/ext/docs/nop_node.md @@ -0,0 +1,25 @@ +# NOP Node + +**The NOP Node** does not process input packets and simply responds with an empty packet. This node is used as a final stage in data processing flows and is useful for eliminating unnecessary outputs when no further processing is required. + +## Specification + +- No additional parameters are required. + +## Ports + +- **in**: Receives input packets from external sources and responds with an empty packet. + +## Example + +```yaml +- kind: print + filename: /dev/stdout + ports: + out: + - name: nop + port: in + +- kind: nop + name: nop +``` diff --git a/ext/docs/nop_node_kr.md b/ext/docs/nop_node_kr.md new file mode 100644 index 00000000..9fa1959f --- /dev/null +++ b/ext/docs/nop_node_kr.md @@ -0,0 +1,25 @@ +# NOP ๋…ธ๋“œ + +**NOP ๋…ธ๋“œ**๋Š” ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ฒ˜๋ฆฌํ•˜์ง€ ์•Š๊ณ  ๋‹จ์ˆœํžˆ ๋นˆ ํŒจํ‚ท์œผ๋กœ ์‘๋‹ตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ํ๋ฆ„์—์„œ ์ตœ์ข… ๋‹จ๊ณ„๋กœ ์‚ฌ์šฉ๋˜๋ฉฐ, ์ถ”๊ฐ€์ ์ธ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š” ์—†๋Š” ๊ฒฝ์šฐ ๋ถˆํ•„์š”ํ•œ ์ถœ๋ ฅ์„ ์ œ๊ฑฐํ•˜๋Š” ๋ฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- ์ถ”๊ฐ€์ ์ธ ์ธ์ž๋ฅผ ์š”๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์™ธ๋ถ€์—์„œ ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜์—ฌ ๋นˆ ํŒจํ‚ท์œผ๋กœ ์‘๋‹ตํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: print + filename: /dev/stdout + ports: + out: + - name: nop + port: in + +- kind: nop + name: nop +``` \ No newline at end of file diff --git a/ext/docs/print_node.md b/ext/docs/print_node.md new file mode 100644 index 00000000..20459b70 --- /dev/null +++ b/ext/docs/print_node.md @@ -0,0 +1,26 @@ +# Print Node + +**The Print Node** provides functionality for writing input data to a file in a specified format. This node uses a format to save data to a file, and the file name can be either a fixed value or dynamically set through the input packet. + +## Specification + +- **filename**: The name of the file where data will be recorded. If the filename is an empty string, the file name is dynamically set through the input packet. (Optional) + +## Ports + +- **in**: Receives input packets to be written to a file. + - If `filename` is provided: The packet includes the format and optionally arguments for writing to the file. + - If `filename` is not provided: The packet includes the file name, format, and optionally arguments for writing to the file. +- **out**: Returns a packet containing the number of bytes successfully written to the file. +- **error**: Returns any errors encountered during file writing. + +## Example + +```yaml +- kind: print + filename: /dev/stdout + ports: + out: + - name: next + port: in +``` diff --git a/ext/docs/print_node_kr.md b/ext/docs/print_node_kr.md new file mode 100644 index 00000000..4c35299b --- /dev/null +++ b/ext/docs/print_node_kr.md @@ -0,0 +1,26 @@ +# Print ๋…ธ๋“œ + +**Print ๋…ธ๋“œ**๋Š” ์ž…๋ ฅ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์ง€์ •๋œ ํฌ๋งท์— ๋งž์ถฐ ํŒŒ์ผ์— ๊ธฐ๋กํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํŒŒ์ผ์— ์ €์žฅํ•˜๊ธฐ ์œ„ํ•ด ํฌ๋งท์„ ์‚ฌ์šฉํ•˜๋ฉฐ, ํŒŒ์ผ ์ด๋ฆ„์€ ๊ณ ์ •๋œ ๊ฐ’ ๋˜๋Š” ์ž…๋ ฅ ํŒจํ‚ท์„ ํ†ตํ•ด ๋™์ ์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **filename**: ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ๋กํ•  ํŒŒ์ผ์˜ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. ๋นˆ ๋ฌธ์ž์—ด์ธ ๊ฒฝ์šฐ, ์ž…๋ ฅ ํŒจํ‚ท์„ ํ†ตํ•ด ๋™์ ์œผ๋กœ ํŒŒ์ผ ์ด๋ฆ„์ด ์„ค์ •๋ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ ํŒจํ‚ท์„ ๋ฐ›์•„ ํŒŒ์ผ์— ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค. + - `filename`์ด ์ œ๊ณต๋œ ๊ฒฝ์šฐ: ํŒจํ‚ท์€ ํŒŒ์ผ์— ๊ธฐ๋กํ•  ํฌ๋งท๊ณผ ์„ ํƒ์ ์œผ๋กœ ์ธ์ž๋“ค์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. + - `filename`์ด ์ œ๊ณต๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ: ํŒจํ‚ท์€ ํŒŒ์ผ ์ด๋ฆ„, ํฌ๋งท, ๊ทธ๋ฆฌ๊ณ  ์„ ํƒ์ ์œผ๋กœ ์ธ์ž๋“ค์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. +- **out**: ๋ฐ์ดํ„ฐ๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ ๊ธฐ๋ก๋œ ๊ฒฝ์šฐ, ๊ธฐ๋ก๋œ ๋ฐ”์ดํŠธ ์ˆ˜๋ฅผ ํฌํ•จํ•˜๋Š” ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. +- **error**: ํŒŒ์ผ ๊ธฐ๋ก ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: print + filename: /dev/stdout + ports: + out: + - name: next + port: in +``` diff --git a/ext/docs/router_node.md b/ext/docs/router_node.md new file mode 100644 index 00000000..d21db1d2 --- /dev/null +++ b/ext/docs/router_node.md @@ -0,0 +1,51 @@ +# Router Node + +**The Router Node** routes input packets to multiple output ports based on specified conditions. It directs packets to the appropriate port according to HTTP methods and paths. + +## Specification + +- **routes**: Defines the routing rules for packets. Each rule routes packets to a specific port based on HTTP method and path. + - **method**: The HTTP method to route (e.g., `GET`, `POST`). + - **path**: The HTTP path to route. + - **port**: The port to which packets are forwarded when the rule matches. + +## Ports + +- **in**: Receives input packets. + - **method**: HTTP method (e.g., `GET`, `POST`) + - **path**: The request path +- **out[*]**: Delivers packets according to routing rules. + - **method**: HTTP method (e.g., `GET`, `POST`) + - **path**: The request path + - **params**: Path variables +- **error**: Returns errors encountered during routing. + +## Example + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: router + port: in + +- kind: router + name: router + routes: + - method: GET + path: /api/data + port: out[0] + - method: POST + path: /api/submit + port: out[1] + ports: + out[0]: + - name: data + port: in + out[1]: + - name: submit + port: in +``` diff --git a/ext/docs/router_node_kr.md b/ext/docs/router_node_kr.md new file mode 100644 index 00000000..979d8def --- /dev/null +++ b/ext/docs/router_node_kr.md @@ -0,0 +1,51 @@ +# Router ๋…ธ๋“œ + +**Router ๋…ธ๋“œ**๋Š” ์ž…๋ ฅ ํŒจํ‚ท์„ ๋ผ์šฐํŒ…ํ•˜์—ฌ ์กฐ๊ฑด์— ๋งž๋Š” ์—ฌ๋Ÿฌ ์ถœ๋ ฅ ํฌํŠธ๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” HTTP ๋ฉ”์„œ๋“œ์™€ ๊ฒฝ๋กœ์— ๊ธฐ๋ฐ˜ํ•˜์—ฌ ํŒจํ‚ท์„ ์ ์ ˆํ•œ ํฌํŠธ๋กœ ๋ถ„๊ธฐํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **routes**: ํŒจํ‚ท์˜ ๋ผ์šฐํŒ… ๊ทœ์น™์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๊ทœ์น™์€ HTTP ๋ฉ”์„œ๋“œ์™€ ๊ฒฝ๋กœ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํŒจํ‚ท์„ ํŠน์ • ํฌํŠธ๋กœ ์ „์†กํ•ฉ๋‹ˆ๋‹ค. + - **method**: ๋ผ์šฐํŒ…ํ•  HTTP ๋ฉ”์„œ๋“œ (์˜ˆ: `GET`, `POST`). + - **path**: ๋ผ์šฐํŒ…ํ•  HTTP ๊ฒฝ๋กœ. + - **port**: ๊ทœ์น™์ด ์ถฉ์กฑ๋  ๋•Œ ํŒจํ‚ท์„ ์ „๋‹ฌํ•  ํฌํŠธ. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค. + - **method**: HTTP ๋ฉ”์„œ๋“œ (์˜ˆ: `GET`, `POST`) + - **path**: ์š”์ฒญ์˜ ๊ฒฝ๋กœ +- **out[*]**: ๋ผ์šฐํŒ… ๊ทœ์น™์— ๋”ฐ๋ผ ํŒจํ‚ท์„ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + - **method**: HTTP ๋ฉ”์„œ๋“œ (์˜ˆ: `GET`, `POST`) + - **path**: ์š”์ฒญ์˜ ๊ฒฝ๋กœ + - **params**: ๊ฒฝ๋กœ ๋ณ€์ˆ˜ +- **error**: ๋ผ์šฐํŒ… ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: router + port: in + +- kind: router + name: router + routes: + - method: GET + path: /api/data + port: out[0] + - method: POST + path: /api/submit + port: out[1] + ports: + out[0]: + - name: data + port: in + out[1]: + - name: submit + port: in +``` diff --git a/ext/docs/scan_node.md b/ext/docs/scan_node.md new file mode 100644 index 00000000..02a9f945 --- /dev/null +++ b/ext/docs/scan_node.md @@ -0,0 +1,26 @@ +# Scan Node + +**The Scan Node** reads data from a file and parses it according to a specified format. It uses the format included in the input packet to read and parse the data from the file and returns the parsed data in an output packet. + +## Specification + +- **filename**: The name of the file to read. If empty, the file name is set dynamically via the input packet. (Optional) + +## Ports + +- **in**: Receives input packets to read and parse data from the file. + - If `filename` is provided: The input packet contains the format for reading the data from the file. + - If `filename` is not provided: The input packet includes both the file name and the format. +- **out**: Returns a packet containing parsed data in the specified format when reading and parsing are successful. +- **error**: Returns errors encountered during file reading or data parsing. + +## Example + +```yaml +- kind: scan + filename: /dev/stdin + ports: + out: + - name: next + port: in +``` diff --git a/ext/docs/scan_node_kr.md b/ext/docs/scan_node_kr.md new file mode 100644 index 00000000..96398c0f --- /dev/null +++ b/ext/docs/scan_node_kr.md @@ -0,0 +1,26 @@ +# Scan ๋…ธ๋“œ + +**Scan ๋…ธ๋“œ**๋Š” ํŒŒ์ผ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์™€ ์ง€์ •๋œ ํฌ๋งท์— ๋”ฐ๋ผ ํŒŒ์‹ฑํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ์ž…๋ ฅ ํŒจํ‚ท์— ํฌํ•จ๋œ ํฌ๋งท์„ ์‚ฌ์šฉํ•˜์—ฌ ํŒŒ์ผ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ๊ณ , ํŒŒ์‹ฑ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์ถœ๋ ฅ ํŒจํ‚ท์œผ๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **filename**: ์ฝ์–ด์˜ฌ ํŒŒ์ผ์˜ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. ๋นˆ ๋ฌธ์ž์—ด์ธ ๊ฒฝ์šฐ, ์ž…๋ ฅ ํŒจํ‚ท์„ ํ†ตํ•ด ๋™์ ์œผ๋กœ ํŒŒ์ผ ์ด๋ฆ„์ด ์ง€์ •๋ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜์—ฌ ํŒŒ์ผ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ๊ณ  ํŒŒ์‹ฑํ•ฉ๋‹ˆ๋‹ค. + - `filename`์ด ์ œ๊ณต๋œ ๊ฒฝ์šฐ: ์ž…๋ ฅ ํŒจํ‚ท์—๋Š” ํŒŒ์ผ์—์„œ ์ฝ์–ด์˜ฌ ๋ฐ์ดํ„ฐ์˜ ํฌ๋งท์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. + - `filename`์ด ์ œ๊ณต๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ: ์ž…๋ ฅ ํŒจํ‚ท์—๋Š” ํŒŒ์ผ ์ด๋ฆ„๊ณผ ํฌ๋งท์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. +- **out**: ๋ฐ์ดํ„ฐ๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ ์ฝํžˆ๊ณ  ํŒŒ์‹ฑ๋œ ๊ฒฝ์šฐ, ํฌ๋งท์— ๋งž์ถ˜ ์ธ์ž๋“ค์„ ํฌํ•จํ•˜๋Š” ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. +- **error**: ํŒŒ์ผ ์ฝ๊ธฐ ๋˜๋Š” ๋ฐ์ดํ„ฐ ํŒŒ์‹ฑ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: scan + filename: /dev/stdin + ports: + out: + - name: next + port: in +``` diff --git a/ext/docs/session_node.md b/ext/docs/session_node.md new file mode 100644 index 00000000..ccb90dd3 --- /dev/null +++ b/ext/docs/session_node.md @@ -0,0 +1,54 @@ +# Session Node + +**The Session Node** is responsible for storing and managing information used in a process. It maintains session information and continuously manages the session state while the process is active. This allows for effective management of session-based data flows by querying and processing session information. + +## Specification + +- Additional arguments are not required. + +## Ports + +- **io**: Receives input packets to store as session information. +- **in**: Merges the input packet with stored session information to create and execute a new subprocess. The merged information and input packet are output as a single packet. +- **out**: Outputs the combined session information and input packet. + +## Example + +```yaml +- kind: snippet + language: javascript + code: | + export default function (args) { + return { + uid: args.uid, + }; + } + ports: + out: + - name: session + port: io + +- kind: snippet + language: javascript + code: | + export default function (args) { + return { + uid: args.uid, + }; + } + ports: + out: + - name: session + port: in + +- kind: session + name: session + ports: + out: + - name: next + port: out + +- kind: if + name: next + when: "self[0].uid == self[1].uid" +``` diff --git a/ext/docs/session_node_kr.md b/ext/docs/session_node_kr.md new file mode 100644 index 00000000..eaa7a3f7 --- /dev/null +++ b/ext/docs/session_node_kr.md @@ -0,0 +1,54 @@ +# Session ๋…ธ๋“œ + +**Session ๋…ธ๋“œ**๋Š” ํ”„๋กœ์„ธ์Šค์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์ •๋ณด๋ฅผ ์ €์žฅํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๋…ธ๋“œ์ž…๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ์„ธ์…˜ ์ •๋ณด๋ฅผ ์œ ์ง€ํ•˜๋ฉฐ, ํ”„๋กœ์„ธ์Šค๊ฐ€ ํ™œ์„ฑ ์ƒํƒœ์ธ ๋™์•ˆ ์„ธ์…˜ ์ƒํƒœ๋ฅผ ์ง€์†์ ์œผ๋กœ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์„ธ์…˜ ์ •๋ณด๋ฅผ ์กฐํšŒํ•˜๊ณ  ์ฒ˜๋ฆฌํ•˜์—ฌ, ์„ธ์…˜ ๊ธฐ๋ฐ˜์˜ ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ํšจ๊ณผ์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- ์ถ”๊ฐ€์ ์ธ ์ธ์ž๋ฅผ ์š”๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **io**: ์™ธ๋ถ€์—์„œ ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์„ธ์…˜ ์ •๋ณด๋กœ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. +- **in**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ €์žฅ๋œ ์„ธ์…˜ ์ •๋ณด์™€ ๋ณ‘ํ•ฉํ•˜์—ฌ ์ƒˆ๋กœ์šด ํ•˜์œ„ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์ •๋ณด์™€ ์ž…๋ ฅ ํŒจํ‚ท์„ ๋ณ‘ํ•ฉํ•˜์—ฌ ํ•˜๋‚˜์˜ ํŒจํ‚ท์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **out**: ์ €์žฅ๋œ ์„ธ์…˜ ์ •๋ณด์™€ ์ž…๋ ฅ ํŒจํ‚ท์„ ๋ณ‘ํ•ฉํ•˜์—ฌ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: snippet + language: javascript + code: | + export default function (args) { + return { + uid: args.uid, + }; + } + ports: + out: + - name: session + port: io + +- kind: snippet + language: javascript + code: | + export default function (args) { + return { + uid: args.uid, + }; + } + ports: + out: + - name: session + port: in + +- kind: session + name: session + ports: + out: + - name: next + port: out + +- kind: if + name: next + when: "self[0].uid == self[1].uid" +``` diff --git a/ext/docs/snippet_node.md b/ext/docs/snippet_node.md new file mode 100644 index 00000000..af05a83c --- /dev/null +++ b/ext/docs/snippet_node.md @@ -0,0 +1,30 @@ +# Snippet Node + +**The Snippet Node** executes code snippets written in various programming languages to process input packets and produce output. This node allows for flexible application of complex data processing logic and provides diverse data handling capabilities through dynamic code execution. + +## Specification + +- **language**: Specifies the programming language in which the code snippet is written. (e.g., `text`, `json`, `yaml`, `cel`, `javascript`, `typescript`) +- **code**: Provides the code snippet to be executed. + +## Ports + +- **in**: Receives the input packet and executes it using the provided code. +- **out**: Outputs the result of the code execution. +- **error**: Returns any errors encountered during code execution. + +## Example + +```yaml +- kind: snippet + language: javascript + code: | + export default function (args) { + return { + body: { + error: args.error() + }, + status: 400 + }; + } +``` diff --git a/ext/docs/snippet_node_kr.md b/ext/docs/snippet_node_kr.md new file mode 100644 index 00000000..ebafccd7 --- /dev/null +++ b/ext/docs/snippet_node_kr.md @@ -0,0 +1,30 @@ +# Snippet ๋…ธ๋“œ + +**Snippet ๋…ธ๋“œ**๋Š” ๋‹ค์–‘ํ•œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋กœ ์ž‘์„ฑ๋œ ์ฝ”๋“œ ์Šค๋‹ˆํŽซ์„ ์‹คํ–‰ํ•˜์—ฌ ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ๊ทธ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๋กœ์ง์„ ์œ ์—ฐํ•˜๊ฒŒ ์ ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋™์ ์œผ๋กœ ์ฝ”๋“œ ์‹คํ–‰์„ ํ†ตํ•ด ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ์˜ ๋‹ค์–‘์„ฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **language**: ์ฝ”๋“œ ์Šค๋‹ˆํŽซ์ด ์ž‘์„ฑ๋œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. (์˜ˆ: `text`, `json`, `yaml`, `cel`, `javascript`, `typescript`) +- **code**: ์‹คํ–‰ํ•  ์ฝ”๋“œ ์Šค๋‹ˆํŽซ์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ฝ”๋“œ๋กœ ์ „๋‹ฌํ•˜์—ฌ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. +- **out**: ์ฝ”๋“œ ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **error**: ์ฝ”๋“œ ์‹คํ–‰ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: snippet + language: javascript + code: | + export default function (args) { + return { + body: { + error: args.error() + }, + status: 400 + }; + } +``` \ No newline at end of file diff --git a/ext/docs/split_node.md b/ext/docs/split_node.md new file mode 100644 index 00000000..c6d6b0b9 --- /dev/null +++ b/ext/docs/split_node.md @@ -0,0 +1,25 @@ +# Split Node + +**The Split Node** provides the functionality to divide an input packet into multiple packets for processing. This node splits the input data according to a specified format and routes each split packet through different paths, allowing for efficient management of complex data flows. + +## Specification + +- No additional parameters are required. + +## Ports + +- **in**: Receives the input packet and splits it into multiple packets. If the input is not in array format, it will be output as a single packet. +- **out[*]**: Outputs the split packets through multiple ports. + +## Example + +```yaml +- kind: split + ports: + out[0]: + - name: next0 + port: in + out[1]: + - name: next1 + port: in +``` diff --git a/ext/docs/split_node_kr.md b/ext/docs/split_node_kr.md new file mode 100644 index 00000000..14d6d43d --- /dev/null +++ b/ext/docs/split_node_kr.md @@ -0,0 +1,25 @@ +# Split ๋…ธ๋“œ + +**Split ๋…ธ๋“œ**๋Š” ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ํŒจํ‚ท์œผ๋กœ ๋‚˜๋ˆ„์–ด ์ฒ˜๋ฆฌํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ์ž…๋ ฅ ๋ฐ์ดํ„ฐ๋ฅผ ์ง€์ •๋œ ํ˜•์‹์— ๋”ฐ๋ผ ๋ถ„ํ• ํ•˜๊ณ , ๊ฐ ๋ถ„๋ฆฌ๋œ ํŒจํ‚ท์„ ๋‹ค์–‘ํ•œ ๊ฒฝ๋กœ๋กœ ์ „๋‹ฌํ•˜์—ฌ ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ํ๋ฆ„์„ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- ์ถ”๊ฐ€์ ์ธ ์ธ์ž๋ฅผ ์š”๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜๊ณ  ์ด๋ฅผ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ํŒจํ‚ท์œผ๋กœ ๋ถ„๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ์ž…๋ ฅ์ด ๋ฐฐ์—ด ํ˜•์‹์ด ์•„๋‹Œ ๊ฒฝ์šฐ, ๋‹จ์ผ ํŒจํ‚ท์œผ๋กœ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค. +- **out[*]**: ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ๋ถ„ํ• ํ•˜์—ฌ ์—ฌ๋Ÿฌ ํฌํŠธ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: split + ports: + out[0]: + - name: next0 + port: in + out[1]: + - name: next1 + port: in +``` diff --git a/ext/docs/sql_node.md b/ext/docs/sql_node.md new file mode 100644 index 00000000..4d5d3252 --- /dev/null +++ b/ext/docs/sql_node.md @@ -0,0 +1,42 @@ +# SQL Node + +**The SQL Node** provides the functionality to interact with relational databases by executing SQL queries and processing data. This node executes SQL queries on the database and returns the results as packets. + +## Specification + +- **driver**: The name of the database driver, such as `"sqlite3"`, `"postgres"`, etc. +- **source**: The database connection string, provided in the format appropriate for the driver. +- **isolation**: Sets the transaction isolation level. The default value is `0`. (Optional) + +## Ports + +- **in**: Receives SQL queries and parameters to send requests to the database. +- **out**: Returns packets containing the results of the query execution. +- **error**: Returns any errors that occur during query execution. + +## Example + +```yaml +- kind: snippet + language: javascript + code: | + export default function (args) { + return [ + 'INSERT INTO USERS(name) VALUES (?)', + ["foo", "bar"] + ]; + } + ports: + out: + - name: sql + port: in + +- kind: sql + name: sql + driver: sqlite3 + source: file::memory:?cache=shared + ports: + out: + - name: next + port: in +``` diff --git a/ext/docs/sql_node_kr.md b/ext/docs/sql_node_kr.md new file mode 100644 index 00000000..f128fa0c --- /dev/null +++ b/ext/docs/sql_node_kr.md @@ -0,0 +1,42 @@ +# SQL ๋…ธ๋“œ + +**SQL ๋…ธ๋“œ**๋Š” ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์™€ ์ƒํ˜ธ์ž‘์šฉํ•˜์—ฌ SQL ์ฟผ๋ฆฌ๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” SQL ์ฟผ๋ฆฌ๋ฅผ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ ์‹คํ–‰ํ•˜๊ณ , ๊ฒฐ๊ณผ๋ฅผ ํŒจํ‚ท์œผ๋กœ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **driver**: ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋“œ๋ผ์ด๋ฒ„์˜ ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, `"sqlite3"`, `"postgres"` ๋“ฑ์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- **source**: ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—ฐ๊ฒฐ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. ๋“œ๋ผ์ด๋ฒ„์— ๋”ฐ๋ผ ์ ์ ˆํ•œ ํ˜•์‹์œผ๋กœ ์ œ๊ณต๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. +- **isolation**: ํŠธ๋žœ์žญ์…˜์˜ ๊ฒฉ๋ฆฌ ์ˆ˜์ค€์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์€ `0`์ž…๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) + +## ํฌํŠธ + +- **in**: SQL ์ฟผ๋ฆฌ์™€ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ๋ฐ›์•„์„œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์— ์š”์ฒญ์„ ๋ณด๋ƒ…๋‹ˆ๋‹ค. +- **out**: ์ฟผ๋ฆฌ ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ ํฌํ•จํ•˜๋Š” ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. +- **error**: ์ฟผ๋ฆฌ ์‹คํ–‰ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: snippet + language: javascript + code: | + export default function (args) { + return [ + 'INSERT INTO USERS(name) VALUES (?)', + ["foo", "bar"] + ]; + } + ports: + out: + - name: sql + port: in + +- kind: sql + name: sql + driver: sqlite3 + source: file::memory:?cache=shared + ports: + out: + - name: next + port: in +``` diff --git a/ext/docs/switch_node.md b/ext/docs/switch_node.md new file mode 100644 index 00000000..d28ac5d4 --- /dev/null +++ b/ext/docs/switch_node.md @@ -0,0 +1,33 @@ +# Switch Node + +**The Switch Node** provides the functionality to route input packets to one of several ports based on specified conditions. This node evaluates given conditions and directs packets to the appropriate port, supporting complex data flow control and flexible routing. + +## Specification + +- **matches**: A list of conditions for routing packets. Each condition defines a rule for routing packets to a specific port. + - **when**: An expression that defines the condition. It is compiled and executed using Common Expression Language (CEL). + - **port**: Specifies the port to route packets to when the condition is met. + +## Ports + +- **in**: Receives input packets and routes them based on conditions. +- **out[*]**: Outputs packets routed to the corresponding port based on conditions. +- **error**: Passes errors that occur during condition evaluation to the external system. + +## Example + +```yaml +- kind: switch + matches: + - when: "payload['status'] == 'success'" + port: out[0] + - when: "payload['status'] == 'error'" + port: out[1] + ports: + out[0]: + - name: success + port: in + out[1]: + - name: error + port: in +``` diff --git a/ext/docs/switch_node_kr.md b/ext/docs/switch_node_kr.md new file mode 100644 index 00000000..b19af5fb --- /dev/null +++ b/ext/docs/switch_node_kr.md @@ -0,0 +1,33 @@ +# Switch ๋…ธ๋“œ + +**Switch ๋…ธ๋“œ**๋Š” ์ž…๋ ฅ๋œ ํŒจํ‚ท์„ ์กฐ๊ฑด์— ๋”ฐ๋ผ ์—ฌ๋Ÿฌ ํฌํŠธ ์ค‘ ํ•˜๋‚˜๋กœ ๋ถ„๊ธฐํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” ์ง€์ •๋œ ์กฐ๊ฑด์„ ํ‰๊ฐ€ํ•˜์—ฌ ์ž…๋ ฅ ๋ฐ์ดํ„ฐ์— ๋งž๋Š” ํฌํŠธ๋กœ ํŒจํ‚ท์„ ์ „๋‹ฌํ•˜์—ฌ, ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ํ๋ฆ„ ์ œ์–ด์™€ ์œ ์—ฐํ•œ ๋ถ„๊ธฐ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **matches**: ํŒจํ‚ท์„ ๋ถ„๊ธฐํ•˜๊ธฐ ์œ„ํ•œ ์กฐ๊ฑด ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค. ๊ฐ ์กฐ๊ฑด์€ ํŒจํ‚ท์„ ํŠน์ • ํฌํŠธ๋กœ ๋ผ์šฐํŒ…ํ•˜๋Š” ๊ทœ์น™์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. + - **when**: ์กฐ๊ฑด์„ ์ •์˜ํ•˜๋Š” ํ‘œํ˜„์‹์ž…๋‹ˆ๋‹ค. `Common Expression Language (CEL)`์„ ์‚ฌ์šฉํ•˜์—ฌ ์ปดํŒŒ์ผ ๋ฐ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. + - **port**: ์กฐ๊ฑด์ด ์ถฉ์กฑ๋  ๋•Œ ํŒจํ‚ท์„ ๋ผ์šฐํŒ…ํ•  ํฌํŠธ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. + +## ํฌํŠธ + +- **in**: ์ž…๋ ฅ ํŒจํ‚ท์„ ์ˆ˜์‹ ํ•˜๊ณ  ์กฐ๊ฑด์— ๋”ฐ๋ผ ๋ถ„๊ธฐํ•ฉ๋‹ˆ๋‹ค. +- **out[*]**: ์กฐ๊ฑด์— ๋งž๋Š” ํฌํŠธ๋กœ ๋ถ„๊ธฐ๋œ ํŒจํ‚ท์„ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. +- **error**: ์กฐ๊ฑด ํ‰๊ฐ€ ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ์™ธ๋ถ€๋กœ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: switch + matches: + - when: "payload['status'] == 'success'" + port: out[0] + - when: "payload['status'] == 'error'" + port: out[1] + ports: + out[0]: + - name: success + port: in + out[1]: + - name: error + port: in +``` diff --git a/ext/docs/websocket_node.md b/ext/docs/websocket_node.md new file mode 100644 index 00000000..cea8efcb --- /dev/null +++ b/ext/docs/websocket_node.md @@ -0,0 +1,64 @@ +# WebSocket Node + +**The WebSocket Node** provides functionality for setting up WebSocket client connections and handling message transmission and reception using the WebSocket protocol. This node manages connections to a WebSocket server and processes data exchanges. + +## Specification + +- **url**: Defines the URL of the WebSocket server. (Optional) +- **timeout**: Sets the WebSocket handshake timeout period. (Optional) + +## Ports + +- **io**: Sets up the WebSocket connection. + - **scheme**: Scheme of the URL (e.g., `ws`, `wss`) + - **host**: Host of the request + - **path**: Path of the request +- **in**: Sends packets through the WebSocket connection. + - **type**: Type of the WebSocket packet + - **data**: Data of the WebSocket packet, analyzed and converted from raw bytes to an appropriate format +- **out**: Returns packets received through the WebSocket connection. + - **type**: Type of the WebSocket packet + - **data**: Data of the WebSocket packet, analyzed and converted from raw bytes to an appropriate format +- **error**: Returns errors encountered during WebSocket connection or data transmission and reception + +## Example + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: router + port: in + +- kind: router + name: router + routes: + - method: GET + path: /ws + port: out[0] + ports: + out[0]: + - name: gateway + port: io + - name: proxy + port: io + +- kind: gateway + name: gateway + protocol: websocket + ports: + out: + - name: proxy + port: in + +- kind: websocket + name: proxy + url: wss://echo.websocket.org/ + ports: + out: + - name: gateway + port: in +``` diff --git a/ext/docs/websocket_node_kr.md b/ext/docs/websocket_node_kr.md new file mode 100644 index 00000000..bd7997fe --- /dev/null +++ b/ext/docs/websocket_node_kr.md @@ -0,0 +1,64 @@ +# WebSocket ๋…ธ๋“œ + +**WebSocket ๋…ธ๋“œ**๋Š” WebSocket ํด๋ผ์ด์–ธํŠธ ์—ฐ๊ฒฐ์„ ์„ค์ •ํ•˜๊ณ , WebSocket ํ”„๋กœํ† ์ฝœ์„ ํ†ตํ•ด ๋ฉ”์‹œ์ง€๋ฅผ ์†ก์ˆ˜์‹ ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธ๋“œ๋Š” WebSocket ์„œ๋ฒ„์™€์˜ ์—ฐ๊ฒฐ์„ ๊ด€๋ฆฌํ•˜๋ฉฐ, ๋ฐ์ดํ„ฐ ์ „์†ก ๋ฐ ์ˆ˜์‹ ์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. + +## ๋ช…์„ธ + +- **url**: WebSocket ์„œ๋ฒ„์˜ URL์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) +- **timeout**: WebSocket ํ•ธ๋“œ์‰์ดํฌ ํƒ€์ž„์•„์›ƒ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. (์„ ํƒ ์‚ฌํ•ญ) + +## ํฌํŠธ + +- **io**: WebSocket ์—ฐ๊ฒฐ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. + - **scheme**: URL์˜ ์Šคํ‚ด (์˜ˆ: `ws`, `wss`) + - **host**: ์š”์ฒญ์˜ ํ˜ธ์ŠคํŠธ + - **path**: ์š”์ฒญ์˜ ๊ฒฝ๋กœ +- **in**: WebSocket ์—ฐ๊ฒฐ์„ ํ†ตํ•ด ํŒจํ‚ท์„ ์†ก์‹ ํ•ฉ๋‹ˆ๋‹ค. + - **type**: WebSocket ํŒจํ‚ท์˜ ํƒ€์ž… + - **data**: WebSocket ํŒจํ‚ท์˜ ๋ฐ์ดํ„ฐ๋กœ, ์›๋ณธ ๋ฐ”์ดํŠธ๋ฅผ ๋ถ„์„ํ•˜์—ฌ ์ ์ ˆํ•œ ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค. +- **out**: WebSocket ์—ฐ๊ฒฐ์„ ํ†ตํ•ด ์ˆ˜์‹ ๋œ ํŒจํ‚ท์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + - **type**: WebSocket ํŒจํ‚ท์˜ ํƒ€์ž… + - **data**: WebSocket ํŒจํ‚ท์˜ ๋ฐ์ดํ„ฐ๋กœ, ์›๋ณธ ๋ฐ”์ดํŠธ๋ฅผ ๋ถ„์„ํ•˜์—ฌ ์ ์ ˆํ•œ ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜๋ฉ๋‹ˆ๋‹ค. +- **error**: WebSocket ์—ฐ๊ฒฐ ๋˜๋Š” ๋ฐ์ดํ„ฐ ์†ก์ˆ˜์‹  ์ค‘ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +## ์˜ˆ์‹œ + +```yaml +- kind: listener + name: listener + protocol: http + port: 8000 + ports: + out: + - name: router + port: in + +- kind: router + name: router + routes: + - method: GET + path: /ws + port: out[0] + ports: + out[0]: + - name: gateway + port: io + - name: proxy + port: io + +- kind: gateway + name: gateway + protocol: websocket + ports: + out: + - name: proxy + port: in + +- kind: websocket + name: proxy + url: wss://echo.websocket.org/ + ports: + out: + - name: gateway + port: in +``` \ No newline at end of file diff --git a/ext/pkg/control/block.go b/ext/pkg/control/block.go index ed748452..4b3eadf0 100644 --- a/ext/pkg/control/block.go +++ b/ext/pkg/control/block.go @@ -17,7 +17,7 @@ type BlockNodeSpec struct { Specs []*spec.Unstructured `map:"specs"` } -// BlockNode is a node that handles multiple sub-nodes. +// BlockNode systematically manages complex data processing flows and executes multiple sub-nodes sequentially. type BlockNode struct { symbols []*symbol.Symbol inPorts map[string]*port.InPort @@ -36,14 +36,14 @@ func NewBlockNodeCodec(s *scheme.Scheme) scheme.Codec { return scheme.CodecWithType(func(spec *BlockNodeSpec) (node.Node, error) { symbols := make([]*symbol.Symbol, 0, len(spec.Specs)) for _, spec := range spec.Specs { - spec, err := s.Decode(spec) + decodedSpec, err := s.Decode(spec) if err != nil { for _, n := range symbols { n.Close() } return nil, err } - n, err := s.Compile(spec) + node, err := s.Compile(decodedSpec) if err != nil { for _, n := range symbols { n.Close() @@ -51,15 +51,15 @@ func NewBlockNodeCodec(s *scheme.Scheme) scheme.Codec { return nil, err } symbols = append(symbols, &symbol.Symbol{ - Spec: spec, - Node: n, + Spec: decodedSpec, + Node: node, }) } return NewBlockNode(symbols...), nil }) } -// BlockNodeSpec defines the specification for creating a BlockNode. +// NewBlockNode creates a new BlockNode with the specified symbols. func NewBlockNode(nodes ...*symbol.Symbol) *BlockNode { n := &BlockNode{ symbols: nodes, @@ -161,7 +161,7 @@ func (n *BlockNode) Out(name string) *port.OutPort { return nil } -// Close closes all ports associated with the node. +// Close closes all ports and sub-nodes associated with the BlockNode. func (n *BlockNode) Close() error { n.mu.RLock() defer n.mu.RUnlock() diff --git a/ext/pkg/control/call.go b/ext/pkg/control/call.go index b584a4e9..9ab22bee 100644 --- a/ext/pkg/control/call.go +++ b/ext/pkg/control/call.go @@ -10,12 +10,12 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// CallNodeSpec holds the specifications for creating a CallNode. +// CallNodeSpec holds the specification for creating a CallNode. type CallNodeSpec struct { spec.Meta `map:",inline"` } -// CallNode redirects packets from the input port to the intermediate port for processing by connected nodes, then outputs the results to the output port. +// CallNode processes an input packet and sends the result to multiple output ports. type CallNode struct { tracer *packet.Tracer inPort *port.InPort diff --git a/ext/pkg/control/fork.go b/ext/pkg/control/fork.go index 32de4a25..d8a475ae 100644 --- a/ext/pkg/control/fork.go +++ b/ext/pkg/control/fork.go @@ -10,12 +10,12 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// ForkNodeSpec holds the specifications for creating a ForkNode. +// ForkNodeSpec defines the specification for creating a ForkNode. type ForkNodeSpec struct { spec.Meta `map:",inline"` } -// ForkNode is a node that forks processes and manages packet forwarding between ports. +// ForkNode asynchronously branches the data processing flow into separate processes. type ForkNode struct { inPort *port.InPort outPort *port.OutPort @@ -75,7 +75,7 @@ func (n *ForkNode) Close() error { n.inPort.Close() n.outPort.Close() n.errPort.Close() - + return nil } diff --git a/ext/pkg/control/if.go b/ext/pkg/control/if.go index 4066698e..2f74780f 100644 --- a/ext/pkg/control/if.go +++ b/ext/pkg/control/if.go @@ -12,13 +12,13 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// IfNodeSpec holds specifications for creating an IfNode. +// IfNodeSpec defines the specifications for creating an IfNode. type IfNodeSpec struct { spec.Meta `map:",inline"` When string `map:"when"` } -// IfNode represents a node that evaluates a condition and routes packets based on the result. +// IfNode evaluates a condition and routes packets based on the result. type IfNode struct { *node.OneToManyNode condition func(any) (bool, error) @@ -54,11 +54,12 @@ func (n *IfNode) action(_ *process.Process, inPck *packet.Packet) ([]*packet.Pac inPayload := inPck.Payload() input := types.InterfaceOf(inPayload) - if ok, err := n.condition(input); err != nil { + ok, err := n.condition(input) + if err != nil { return nil, packet.New(types.NewError(err)) - } else if ok { + } + if ok { return []*packet.Packet{inPck, nil}, nil - } else { - return []*packet.Packet{nil, inPck}, nil } + return []*packet.Packet{nil, inPck}, nil } diff --git a/ext/pkg/control/loop.go b/ext/pkg/control/loop.go index 1387fa31..8576db30 100644 --- a/ext/pkg/control/loop.go +++ b/ext/pkg/control/loop.go @@ -10,16 +10,16 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// LoopNodeSpec holds the specifications for creating a LoopNode. +// LoopNodeSpec defines the specifications for creating a LoopNode. type LoopNodeSpec struct { spec.Meta `map:",inline"` } -// LoopNode represents a node that Loops over input data in batches. +// LoopNode processes input data in batches, splitting packets into sub-packets and handling them accordingly. type LoopNode struct { tracer *packet.Tracer inPort *port.InPort - outPorts []*port.OutPort + outPorts [2]*port.OutPort errPort *port.OutPort } @@ -39,7 +39,7 @@ func NewLoopNode() *LoopNode { n := &LoopNode{ tracer: packet.NewTracer(), inPort: port.NewIn(), - outPorts: []*port.OutPort{port.NewOut(), port.NewOut()}, + outPorts: [2]*port.OutPort{port.NewOut(), port.NewOut()}, errPort: port.NewOut(), } diff --git a/ext/pkg/control/merge.go b/ext/pkg/control/merge.go index d2e2c485..8a1704f9 100644 --- a/ext/pkg/control/merge.go +++ b/ext/pkg/control/merge.go @@ -9,12 +9,12 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// MergeNodeSpec holds the specifications for creating a MergeNode. +// MergeNodeSpec defines the specifications for creating a MergeNode. type MergeNodeSpec struct { spec.Meta `map:",inline"` } -// MergeNode represents a node that Merges multiple input packets into a single output packet. +// MergeNode represents a node that merges multiple input packets into a single output packet. type MergeNode struct { *node.ManyToOneNode } diff --git a/ext/pkg/control/session.go b/ext/pkg/control/session.go index ae1b6ec7..e1f7d6d0 100644 --- a/ext/pkg/control/session.go +++ b/ext/pkg/control/session.go @@ -10,7 +10,7 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// SessionNodeSpec defines the specification for creating a NOPNode. +// SessionNodeSpec defines the specification for creating a SessionNode. type SessionNodeSpec struct { spec.Meta `map:",inline"` } diff --git a/ext/pkg/control/snippet.go b/ext/pkg/control/snippet.go index d8e376df..f56b7e15 100644 --- a/ext/pkg/control/snippet.go +++ b/ext/pkg/control/snippet.go @@ -10,14 +10,14 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// SnippetNodeSpec holds the specifications for creating a SnippetNode. +// SnippetNodeSpec defines the specifications for creating a SnippetNode. type SnippetNodeSpec struct { spec.Meta `map:",inline"` Language string `map:"language,omitempty"` Code string `map:"code"` } -// SnippetNode represents a node that executes code snippets in various language. +// SnippetNode represents a node that executes code snippets in various languages. type SnippetNode struct { *node.OneToOneNode fn func(any) (any, error) diff --git a/ext/pkg/control/split.go b/ext/pkg/control/split.go index b7eec4af..d3bcd9e9 100644 --- a/ext/pkg/control/split.go +++ b/ext/pkg/control/split.go @@ -9,7 +9,7 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// SplitNodeSpec defines the specifications for creating a SpliteNode. +// SplitNodeSpec defines the specifications for creating a SplitNode. type SplitNodeSpec struct { spec.Meta `map:",inline"` } diff --git a/ext/pkg/io/print.go b/ext/pkg/io/print.go index db31a4c0..3c049272 100644 --- a/ext/pkg/io/print.go +++ b/ext/pkg/io/print.go @@ -28,7 +28,7 @@ type PrintNode struct { mu sync.RWMutex } -// DynPrintNode writes data to a file whose name and format are specified in the payload. +// DynPrintNode writes data to a file whose name and format string are specified in the payload. type DynPrintNode struct { *node.OneToOneNode fs FileSystem diff --git a/ext/pkg/io/scan.go b/ext/pkg/io/scan.go index 807df576..010708b7 100644 --- a/ext/pkg/io/scan.go +++ b/ext/pkg/io/scan.go @@ -29,7 +29,7 @@ type ScanNode struct { mu sync.RWMutex } -// DynScanNode reads from a file whose name and format are specified in the payload. +// DynScanNode reads from a file whose name and format string are specified in the payload. type DynScanNode struct { *node.OneToOneNode fs FileSystem diff --git a/ext/pkg/io/sql.go b/ext/pkg/io/sql.go index 75d86b54..6856a336 100644 --- a/ext/pkg/io/sql.go +++ b/ext/pkg/io/sql.go @@ -15,7 +15,7 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// SQLNodeSpec holds the specifications for creating a SQLNode. +// SQLNodeSpec defines the specifications for creating a SQLNode. type SQLNodeSpec struct { spec.Meta `map:",inline"` Driver string `map:"driver"` diff --git a/ext/pkg/network/gateway.go b/ext/pkg/network/gateway.go index 89b131c8..4fa5da9d 100644 --- a/ext/pkg/network/gateway.go +++ b/ext/pkg/network/gateway.go @@ -17,7 +17,7 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// GatewayNodeSpec holds the specifications for creating a GatewayNode. +// GatewayNodeSpec defines the specifications for creating a GatewayNode. type GatewayNodeSpec struct { spec.Meta `map:",inline"` Protocol string `map:"protocol"` diff --git a/ext/pkg/network/http.go b/ext/pkg/network/http.go index 8cfc5ed4..8513d5af 100644 --- a/ext/pkg/network/http.go +++ b/ext/pkg/network/http.go @@ -18,7 +18,7 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// HTTPNodeSpec holds the specifications for creating an HTTPNode. +// HTTPNodeSpec defines the specifications for creating an HTTPNode. type HTTPNodeSpec struct { spec.Meta `map:",inline"` URL string `map:"url"` diff --git a/ext/pkg/network/listener.go b/ext/pkg/network/listener.go index 15ef626e..4a27b87f 100644 --- a/ext/pkg/network/listener.go +++ b/ext/pkg/network/listener.go @@ -23,7 +23,7 @@ import ( "golang.org/x/net/http2/h2c" ) -// ListenNodeSpec holds the specifications for creating a ListenNode. +// ListenNodeSpec defines the specifications for creating a ListenNode. type ListenNodeSpec struct { spec.Meta `map:",inline"` Protocol string `map:"protocol"` diff --git a/ext/pkg/network/websocket.go b/ext/pkg/network/websocket.go index 239c5b18..b621735a 100644 --- a/ext/pkg/network/websocket.go +++ b/ext/pkg/network/websocket.go @@ -20,7 +20,7 @@ import ( "github.com/siyul-park/uniflow/pkg/types" ) -// WebSocketNodeSpec holds the specifications for creating a WebSocketNode. +// WebSocketNodeSpec defines the specifications for creating a WebSocketNode. type WebSocketNodeSpec struct { spec.Meta `map:",inline"` URL string `map:"url"`