with executors WIP
This commit is contained in:
18
crates/octopush_core/src/executor/default_executor.rs
Normal file
18
crates/octopush_core/src/executor/default_executor.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::schema::models::Action;
|
||||
|
||||
use super::executor::Executor;
|
||||
|
||||
pub struct DefaultExecutor;
|
||||
|
||||
#[async_trait]
|
||||
impl Executor for DefaultExecutor {
|
||||
async fn execute(&self, action: Action) -> eyre::Result<()> {
|
||||
match action {
|
||||
Action::Go { entry } => todo!(),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
12
crates/octopush_core/src/executor/executor.rs
Normal file
12
crates/octopush_core/src/executor/executor.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::schema::models::Action;
|
||||
|
||||
#[async_trait]
|
||||
pub trait Executor {
|
||||
async fn execute(&self, action: Action) -> eyre::Result<()>;
|
||||
}
|
||||
|
||||
pub type DynExecutor = Arc<dyn Executor + Send + Sync>;
|
1
crates/octopush_core/src/executor/executors/mod.rs
Normal file
1
crates/octopush_core/src/executor/executors/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod golang;
|
3
crates/octopush_core/src/executor/mod.rs
Normal file
3
crates/octopush_core/src/executor/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub mod default_executor;
|
||||
pub mod executor;
|
||||
mod executors;
|
@@ -1,3 +1,4 @@
|
||||
pub mod git;
|
||||
pub mod storage;
|
||||
pub mod schema;
|
||||
pub mod executor;
|
||||
|
Reference in New Issue
Block a user