Skip to content

Commit

Permalink
fix: add toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 9, 2024
1 parent 0033aa3 commit dfcdf8b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2024-05-12"
25 changes: 25 additions & 0 deletions src/driver/driver.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::Dag;
use anyhow::Result;

pub trait NHandler {
//pause graph running for now
fn pause(&mut self) -> Result<()>;

//restart paused graph
fn restart(&mut self) -> Result<()>;

//stop resource about this graph
fn stop(&mut self) -> Result<()>;
}

pub trait PipelineController {
fn get_node(&self, name: &str) -> Option<Box<dyn NHandler>>;
}

pub trait Driver {
//deploy graph to cluster
fn deploy(&mut self, graph: &Dag) -> Result<Box<dyn PipelineController>>;

//clean all resource about this graph
fn clean(&mut self) -> Result<()>;
}
14 changes: 14 additions & 0 deletions src/driver/kube.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use super::Driver;
use crate::Dag;
use anyhow::Result;
pub struct KubeDriver {}

impl Driver for KubeDriver {
fn deploy(&mut self, graph: &Dag) -> Result<Box<dyn super::PipelineController>> {
todo!()
}

fn clean(&mut self) -> Result<()> {
todo!()
}
}
4 changes: 4 additions & 0 deletions src/driver/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mod driver;
pub mod kube;

pub use driver::*;

0 comments on commit dfcdf8b

Please sign in to comment.