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() {
|
||||
println!("Hello, world!");
|
||||
let cfg = config::build_config();
|
||||
println!("{:?}", cfg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"streams": {
|
||||
"input": {
|
||||
"engine": {
|
||||
"type": "kinesis",
|
||||
"name": "kinesis",
|
||||
"kinesis": {
|
||||
"aws-region": "us-east-2",
|
||||
"aws-arn": "arn:aws:::us-east-2"
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"output": {
|
||||
"engine": {
|
||||
"type": "kafka",
|
||||
"name": "kafka",
|
||||
"kafka": {
|
||||
"topic": "topic-name"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
streams:
|
||||
input:
|
||||
engine:
|
||||
type: stdin
|
||||
name: stdin
|
||||
output:
|
||||
engine:
|
||||
type: stdout
|
||||
name: stdout
|
||||
|
|
|
|||
Loading…
Reference in New Issue