Skip to content

Commit b1e80d2

Browse files
committed
feat: added flow_definition as new definition reader and moved the definitions service into its own feature
1 parent c4cc75a commit b1e80d2

File tree

7 files changed

+525
-176
lines changed

7 files changed

+525
-176
lines changed

Cargo.lock

Lines changed: 38 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,27 @@ homepage = "https://code0.tech"
88
license = "Apache-2.0"
99

1010
[dependencies]
11-
tucana = { version = "0.0.39", features = ["aquila"] }
11+
tucana = { version = "0.0.41", features = ["aquila"] }
1212
async-trait = "0.1.85"
1313
log = "0.4.24"
1414
tonic = "0.14.1"
1515
dotenv = "0.15.0"
16-
code0-definition-reader = "0.0.18"
1716
tonic-health = "0.14.1"
1817
async-nats = "0.45.0"
1918
futures-core = "0.3.31"
2019
regex = "1.11.2"
2120
serde_json = "1.0.143"
21+
walkdir = "2.5.0"
22+
serde = "1.0.228"
2223

2324
[lib]
2425
doctest = true
2526

2627
[features]
2728
default = ["all"]
2829
flow_definition = []
30+
flow_service = ["flow_definition"]
2931
flow_config = []
3032
flow_health = []
3133
flow_validator = []
32-
all = ["flow_definition", "flow_config", "flow_health", "flow_validator"]
34+
all = ["flow_definition", "flow_config", "flow_health", "flow_validator", "flow_service"]

src/flow_definition/error/mod.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use std::io;
2+
use std::path::PathBuf;
3+
4+
#[derive(Debug)]
5+
pub enum ReaderError {
6+
JsonError {
7+
path: PathBuf,
8+
error: serde_json::Error,
9+
},
10+
ReadFeatureError {
11+
path: String,
12+
source: Box<ReaderError>,
13+
},
14+
ReadDirectoryError {
15+
path: PathBuf,
16+
error: io::Error,
17+
},
18+
ReadFileError {
19+
path: PathBuf,
20+
error: io::Error,
21+
},
22+
DirectoryEntryError(io::Error),
23+
}

src/flow_definition/feature/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use serde::Deserialize;
2+
use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition};
3+
4+
#[derive(Deserialize, Debug, Clone)]
5+
pub struct Feature {
6+
pub name: String,
7+
pub data_types: Vec<DefinitionDataType>,
8+
pub flow_types: Vec<FlowType>,
9+
pub functions: Vec<RuntimeFunctionDefinition>,
10+
}

0 commit comments

Comments
 (0)