mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-13 03:13:29 +02:00
move code to dagger-core
This commit is contained in:
20
crates/dagger-core/src/connect_params.rs
Normal file
20
crates/dagger-core/src/connect_params.rs
Normal 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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user