move code to dagger-core

This commit is contained in:
2023-02-05 22:26:58 +01:00
parent 9f0021b708
commit ec0d0b22e6
18 changed files with 132 additions and 33 deletions

View File

@@ -0,0 +1,20 @@
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize, PartialEq)]
pub struct ConnectParams {
pub port: u64,
pub session_token: String,
}
impl ConnectParams {
pub fn new(port: u64, session_token: &str) -> Self {
Self {
port,
session_token: session_token.to_string(),
}
}
pub fn url(&self) -> String {
format!("http://127.0.0.1:{}/query", self.port)
}
}