pub struct GatewayManager {
pub config: GatewayConfig,
pub db: Arc<Database>,
pub lan: LanDiscovery,
/* private fields */
}Expand description
Top-level coordinator for the gateway subsystem.
Fields§
§config: GatewayConfig§db: Arc<Database>§lan: LanDiscoveryImplementations§
Source§impl GatewayManager
impl GatewayManager
pub fn new(config: GatewayConfig, db: Arc<Database>) -> Self
pub async fn start(&self) -> CiabResult<()>
pub async fn shutdown(&self) -> CiabResult<()>
pub async fn status(&self) -> CiabResult<GatewayStatus>
Sourcepub async fn prepare_provider(
&self,
provider: &str,
) -> CiabResult<ProviderPrepareResult>
pub async fn prepare_provider( &self, provider: &str, ) -> CiabResult<ProviderPrepareResult>
Prepare (download/install/validate) a tunnel provider.
pub async fn create_token( &self, name: String, scopes: Vec<TokenScope>, expires_secs: Option<u64>, ) -> CiabResult<(String, ClientToken)>
pub async fn validate_token(&self, raw_token: &str) -> CiabResult<ClientToken>
pub async fn revoke_token(&self, token_id: &Uuid) -> CiabResult<()>
pub async fn list_tokens(&self) -> CiabResult<Vec<ClientToken>>
pub async fn get_token(&self, token_id: &Uuid) -> CiabResult<ClientToken>
pub async fn create_tunnel( &self, sandbox_id: Option<Uuid>, tunnel_type: TunnelType, local_port: u16, public_url: Option<String>, ) -> CiabResult<GatewayTunnel>
pub async fn stop_tunnel(&self, tunnel_id: &Uuid) -> CiabResult<()>
pub async fn list_tunnels(&self) -> CiabResult<Vec<GatewayTunnel>>
pub async fn get_tunnel(&self, tunnel_id: &Uuid) -> CiabResult<GatewayTunnel>
pub async fn expose_sandbox( &self, sandbox_id: Uuid, token_name: Option<String>, expires_secs: Option<u64>, scope: Option<TokenScope>, local_port: u16, ) -> CiabResult<ExposeResult>
Auto Trait Implementations§
impl !Freeze for GatewayManager
impl !RefUnwindSafe for GatewayManager
impl Send for GatewayManager
impl Sync for GatewayManager
impl Unpin for GatewayManager
impl UnsafeUnpin for GatewayManager
impl !UnwindSafe for GatewayManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more