change dependencies to be more sharable
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
use crate::controller::Controller;
|
||||
|
||||
impl Controller {
|
||||
pub async fn add_domain_to_dns(&self, domain: &str) -> Result<(), Box<dyn std::error::Error>> {
|
||||
pub(in crate::controller) async fn add_domain_to_dns(
|
||||
&self,
|
||||
domain: &str,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
self.dns_manager.add_domain(domain, self.pub_addr).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn del_domain_to_dns(&self, domain: &str) -> Result<(), Box<dyn std::error::Error>> {
|
||||
pub(in crate::controller) async fn del_domain_to_dns(
|
||||
&self,
|
||||
domain: &str,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
self.dns_manager.del_domain(domain).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
};
|
||||
|
||||
impl Controller {
|
||||
pub async fn load_container(
|
||||
pub(in crate::controller) async fn load_container(
|
||||
&self,
|
||||
docker_id: Option<String>,
|
||||
domain: String,
|
||||
@@ -31,7 +31,7 @@ impl Controller {
|
||||
self.started
|
||||
}
|
||||
|
||||
pub async fn prune_given_container(
|
||||
pub(in crate::controller) async fn prune_given_container(
|
||||
&self,
|
||||
container: Container,
|
||||
) -> Result<String, Box<dyn Error>> {
|
||||
@@ -41,7 +41,7 @@ impl Controller {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn stop_given_container(
|
||||
pub(in crate::controller) async fn stop_given_container(
|
||||
&self,
|
||||
container: Container,
|
||||
) -> Result<String, bollard::errors::Error> {
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
use log::error;
|
||||
|
||||
impl Controller {
|
||||
pub async fn load_container_and_bind(
|
||||
pub(in crate::controller) async fn load_container_and_bind(
|
||||
&self,
|
||||
docker_id: Option<String>,
|
||||
domain: String,
|
||||
@@ -39,7 +39,7 @@ impl Controller {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn start_container_from_instance(&self, instance: Instance) {
|
||||
pub(in crate::controller) async fn start_container_from_instance(&self, instance: Instance) {
|
||||
let image = match self
|
||||
.storage
|
||||
.lock()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::{controller::Controller, mcproxy_client};
|
||||
|
||||
impl Controller {
|
||||
pub async fn bind_container_in_proxy(
|
||||
pub(in crate::controller) async fn bind_container_in_proxy(
|
||||
&self,
|
||||
domain: &str,
|
||||
ip: &str,
|
||||
@@ -12,7 +12,7 @@ impl Controller {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn unbind_container_in_proxy(
|
||||
pub(in crate::controller) async fn unbind_container_in_proxy(
|
||||
&self,
|
||||
domain: &str,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
Reference in New Issue
Block a user