feat: add basic structure
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
[package]
|
||||
name = "char"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
@@ -6,3 +6,4 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
eyre = { workspace = true }
|
||||
|
@@ -1,14 +1,28 @@
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
pub mod std;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
pub trait Action {}
|
||||
pub trait Plugin {}
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
pub struct CharBuilder;
|
||||
|
||||
impl CharBuilder {
|
||||
pub fn new() -> Self {
|
||||
CharBuilder
|
||||
}
|
||||
|
||||
pub fn add_context<C>(mut self, context: C) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_action(mut self, action: impl Action) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn add_plugin(mut self, plugin: impl Plugin) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn execute(mut self) -> eyre::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
7
crates/char_sdk/src/std/dagger/mod.rs
Normal file
7
crates/char_sdk/src/std/dagger/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
pub struct Context {}
|
||||
|
||||
impl Default for Context {
|
||||
fn default() -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
9
crates/char_sdk/src/std/k8s/mod.rs
Normal file
9
crates/char_sdk/src/std/k8s/mod.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
pub struct Plugin {}
|
||||
|
||||
impl crate::Plugin for Plugin {}
|
||||
|
||||
impl Default for Plugin {
|
||||
fn default() -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
2
crates/char_sdk/src/std/mod.rs
Normal file
2
crates/char_sdk/src/std/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
pub mod dagger;
|
||||
pub mod k8s;
|
Reference in New Issue
Block a user