Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjusting iapyx after newest changes and clean up
- Loading branch information
Showing
9 changed files
with
131 additions
and
27 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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod interactive; | ||
pub mod load; | ||
pub mod proxy; |
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,45 @@ | ||
use structopt::StructOpt; | ||
use thiserror::Error; | ||
use crate::backend::ProxyServerError; | ||
use crate::backend::ProxyServerStub; | ||
use std::fs::File; | ||
use std::io::Read; | ||
use std::path::Path; | ||
use std::path::PathBuf; | ||
use jortestkit::file; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum IapyxProxyCommandError { | ||
#[error("proxy error")] | ||
ProxyError(#[from] crate::backend::ProxyServerError), | ||
} | ||
|
||
#[derive(StructOpt, Debug)] | ||
pub struct IapyxProxyCommand { | ||
|
||
#[structopt(short = "a", long = "address", default_value = "127.0.0.1:8000")] | ||
pub address: String, | ||
|
||
#[structopt(short = "v", long = "vit-address", default_value = "127.0.0.1:3030")] | ||
pub vit_address: String, | ||
|
||
#[structopt(short = "n", long = "node-address", default_value = "127.0.0.1:8080")] | ||
pub node_address: String, | ||
|
||
#[structopt(short = "b", long = "block0")] | ||
pub block0_path: PathBuf | ||
|
||
} | ||
|
||
impl IapyxProxyCommand { | ||
pub fn build(&self) -> Result<ProxyServerStub, IapyxProxyCommandError> { | ||
let proxy_address = self.address.clone(); | ||
let vit_address = self.vit_address.clone(); | ||
let node_address = self.node_address.clone(); | ||
let block0_path = self.block0_path.clone(); | ||
|
||
Ok(ProxyServerStub::new(proxy_address,vit_address,node_address,file::get_file_as_byte_vec(&block0_path))?) | ||
} | ||
} | ||
|
||
|
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
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
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