stub
parent
53b7d78207
commit
bba471c2bb
|
|
@ -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") },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
pub mod config;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
let cfg = config::build_config();
|
||||||
|
println!("{:?}", cfg);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
streams:
|
streams:
|
||||||
input:
|
input:
|
||||||
engine:
|
engine:
|
||||||
type: stdin
|
name: stdin
|
||||||
output:
|
output:
|
||||||
engine:
|
engine:
|
||||||
type: stdout
|
name: stdout
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue