pub struct DomainManager { /* private fields */ }Expand description
Domain management service.
Implementations§
Source§impl DomainManager
impl DomainManager
Sourcepub fn new(
pool: PgPool,
verification_service: Arc<DomainVerificationService>,
) -> Self
pub fn new( pool: PgPool, verification_service: Arc<DomainVerificationService>, ) -> Self
Create a new domain manager.
Sourcepub async fn create_domain(
&self,
tenant_id: Uuid,
req: CreateDomainRequest,
) -> ProxyResult<DomainResponse>
pub async fn create_domain( &self, tenant_id: Uuid, req: CreateDomainRequest, ) -> ProxyResult<DomainResponse>
Create a new domain for a tenant.
Sourcepub async fn get_domain(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<Option<DomainResponse>>
pub async fn get_domain( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<Option<DomainResponse>>
Get a domain by ID for a tenant.
Sourcepub async fn list_domains(&self, tenant_id: Uuid) -> ProxyResult<Vec<Domain>>
pub async fn list_domains(&self, tenant_id: Uuid) -> ProxyResult<Vec<Domain>>
List all domains for a tenant.
Sourcepub async fn delete_domain(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<bool>
pub async fn delete_domain( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<bool>
Delete a domain.
Sourcepub async fn verify_domain(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<VerificationResult>
pub async fn verify_domain( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<VerificationResult>
Verify a domain.
Sourcepub async fn enable_domain(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<bool>
pub async fn enable_domain( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<bool>
Enable a verified domain.
Sourcepub async fn disable_domain(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<bool>
pub async fn disable_domain( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<bool>
Disable a domain.
Sourcepub async fn create_route(
&self,
domain_id: Uuid,
tenant_id: Uuid,
req: CreateDomainRouteRequest,
) -> ProxyResult<DomainRoute>
pub async fn create_route( &self, domain_id: Uuid, tenant_id: Uuid, req: CreateDomainRouteRequest, ) -> ProxyResult<DomainRoute>
Create a route for a domain.
Sourcepub async fn get_route(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<Option<DomainRoute>>
pub async fn get_route( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<Option<DomainRoute>>
Get a route by ID.
Sourcepub async fn list_routes_for_domain(
&self,
domain_id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<Vec<DomainRoute>>
pub async fn list_routes_for_domain( &self, domain_id: Uuid, tenant_id: Uuid, ) -> ProxyResult<Vec<DomainRoute>>
List routes for a domain.
Sourcepub async fn update_route(
&self,
id: Uuid,
tenant_id: Uuid,
req: UpdateDomainRouteRequest,
) -> ProxyResult<Option<DomainRoute>>
pub async fn update_route( &self, id: Uuid, tenant_id: Uuid, req: UpdateDomainRouteRequest, ) -> ProxyResult<Option<DomainRoute>>
Update a route.
Sourcepub async fn delete_route(&self, id: Uuid, tenant_id: Uuid) -> ProxyResult<bool>
pub async fn delete_route(&self, id: Uuid, tenant_id: Uuid) -> ProxyResult<bool>
Delete a route.
Sourcepub async fn create_upstream(
&self,
tenant_id: Uuid,
req: CreateUpstreamRequest,
) -> ProxyResult<DomainUpstream>
pub async fn create_upstream( &self, tenant_id: Uuid, req: CreateUpstreamRequest, ) -> ProxyResult<DomainUpstream>
Create an upstream for a tenant.
Sourcepub async fn get_upstream(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<Option<DomainUpstream>>
pub async fn get_upstream( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<Option<DomainUpstream>>
Get an upstream by ID.
Sourcepub async fn list_upstreams(
&self,
tenant_id: Uuid,
) -> ProxyResult<Vec<DomainUpstream>>
pub async fn list_upstreams( &self, tenant_id: Uuid, ) -> ProxyResult<Vec<DomainUpstream>>
List upstreams for a tenant.
Sourcepub async fn update_upstream(
&self,
id: Uuid,
tenant_id: Uuid,
req: UpdateUpstreamRequest,
) -> ProxyResult<Option<DomainUpstream>>
pub async fn update_upstream( &self, id: Uuid, tenant_id: Uuid, req: UpdateUpstreamRequest, ) -> ProxyResult<Option<DomainUpstream>>
Update an upstream.
Sourcepub async fn delete_upstream(
&self,
id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<bool>
pub async fn delete_upstream( &self, id: Uuid, tenant_id: Uuid, ) -> ProxyResult<bool>
Delete an upstream.
Sourcepub async fn add_backend(
&self,
upstream_id: Uuid,
tenant_id: Uuid,
req: CreateBackendRequest,
) -> ProxyResult<DomainBackend>
pub async fn add_backend( &self, upstream_id: Uuid, tenant_id: Uuid, req: CreateBackendRequest, ) -> ProxyResult<DomainBackend>
Add a backend to an upstream.
Sourcepub async fn remove_backend(
&self,
backend_id: Uuid,
upstream_id: Uuid,
tenant_id: Uuid,
) -> ProxyResult<bool>
pub async fn remove_backend( &self, backend_id: Uuid, upstream_id: Uuid, tenant_id: Uuid, ) -> ProxyResult<bool>
Remove a backend from an upstream.
Sourcepub async fn get_tenant_usage(
&self,
tenant_id: Uuid,
) -> ProxyResult<TenantUsage>
pub async fn get_tenant_usage( &self, tenant_id: Uuid, ) -> ProxyResult<TenantUsage>
Get tenant usage statistics.
Auto Trait Implementations§
impl !RefUnwindSafe for DomainManager
impl !UnwindSafe for DomainManager
impl Freeze for DomainManager
impl Send for DomainManager
impl Sync for DomainManager
impl Unpin for DomainManager
impl UnsafeUnpin for DomainManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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