-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use ::rucat_client::engine::create_engine; | ||
use ::rucat_common::engine::{CreateEngineRequest, EngineType}; | ||
use rucat_common::tokio; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), reqwest::Error> { | ||
let request = CreateEngineRequest { | ||
name: "spark0".to_owned(), | ||
engine_type: EngineType::Spark, | ||
version: "3.0.0".to_owned(), | ||
config: None, | ||
}; | ||
let id = create_engine(&request).await?; | ||
println!("Engine created with id: {}", id); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! Functions for managing the engine. | ||
use ::rucat_common::engine::{CreateEngineRequest, EngineId}; | ||
|
||
pub async fn create_engine(request: &CreateEngineRequest) -> Result<EngineId, reqwest::Error> { | ||
let client = reqwest::Client::new(); | ||
let id: EngineId = client | ||
.post("http://localhost:3000/engine") | ||
.json(request) | ||
.send() | ||
.await? | ||
.json() | ||
.await?; | ||
|
||
Ok(id) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod engine; |
This file was deleted.
Oops, something went wrong.