set hostname when connecting to config-server (#712)

This commit is contained in:
kevin
2025-03-23 19:53:49 +08:00
committed by GitHub
parent 2b909e04ea
commit 8dc8c7d9e2
6 changed files with 22 additions and 5 deletions
+7 -1
View File
@@ -19,13 +19,15 @@ use crate::{
pub struct Controller {
token: String,
hostname: String,
instance_map: DashMap<uuid::Uuid, NetworkInstance>,
}
impl Controller {
pub fn new(token: String) -> Self {
pub fn new(token: String, hostname: String) -> Self {
Controller {
token,
hostname,
instance_map: DashMap::new(),
}
}
@@ -80,6 +82,10 @@ impl Controller {
pub fn token(&self) -> String {
self.token.clone()
}
pub fn hostname(&self) -> String {
self.hostname.clone()
}
}
#[async_trait::async_trait]