master
Bel LaPointe 2023-03-16 14:12:08 -06:00
parent 53b7d78207
commit bba471c2bb
4 changed files with 41 additions and 5 deletions

33
src/config.rs Normal file
View File

@ -0,0 +1,33 @@
#[derive(Debug)]
pub struct Config {
streams: Streams,
}
#[derive(Debug)]
struct Streams {
input: Stream,
output: Stream,
}
#[derive(Debug)]
struct Stream {
engine: Engine,
}
#[derive(Debug)]
struct Engine {
name: String,
}
pub fn build_config() -> Config {
return Config {
streams: Streams{
input: Stream {
engine: Engine{ name: String::from("stdin") },
},
output: Stream {
engine: Engine{ name: String::from("stdout") },
},
},
}
}

View File

@ -1,3 +1,6 @@
pub mod config;
fn main() { fn main() {
println!("Hello, world!"); let cfg = config::build_config();
println!("{:?}", cfg);
} }

View File

@ -2,7 +2,7 @@
"streams": { "streams": {
"input": { "input": {
"engine": { "engine": {
"type": "kinesis", "name": "kinesis",
"kinesis": { "kinesis": {
"aws-region": "us-east-2", "aws-region": "us-east-2",
"aws-arn": "arn:aws:::us-east-2" "aws-arn": "arn:aws:::us-east-2"
@ -11,7 +11,7 @@
}, },
"output": { "output": {
"engine": { "engine": {
"type": "kafka", "name": "kafka",
"kafka": { "kafka": {
"topic": "topic-name" "topic": "topic-name"
} }

View File

@ -1,7 +1,7 @@
streams: streams:
input: input:
engine: engine:
type: stdin name: stdin
output: output:
engine: engine:
type: stdout name: stdout