pub struct CaddyTemplateRenderingService { /* private fields */ }Expand description
Service for rendering Caddy TLS proxy templates
This service encapsulates the logic for building Caddy contexts from user configuration, including:
- Extracting TLS-enabled services (Tracker API, HTTP Trackers, Health Check API, Grafana)
- Building
CaddyContextwith Let’s Encrypt configuration - Conditional rendering (only when HTTPS + TLS services are configured)
Implementations§
Source§impl CaddyTemplateRenderingService
impl CaddyTemplateRenderingService
Sourcepub fn from_paths(
templates_dir: PathBuf,
build_dir: PathBuf,
clock: Arc<dyn Clock>,
) -> Self
pub fn from_paths( templates_dir: PathBuf, build_dir: PathBuf, clock: Arc<dyn Clock>, ) -> Self
Create a new service with explicit dependencies
§Arguments
templates_dir- Directory containing template source filesbuild_dir- Directory where rendered templates will be writtenclock- Clock service for timestamps
Sourcepub fn render(
&self,
user_inputs: &UserInputs,
) -> Result<Option<PathBuf>, CaddyTemplateRenderingServiceError>
pub fn render( &self, user_inputs: &UserInputs, ) -> Result<Option<PathBuf>, CaddyTemplateRenderingServiceError>
Render Caddy templates if HTTPS and TLS services are configured
This method builds the complete Caddy context by extracting all
TLS-enabled services from the user configuration. Returns None
if HTTPS is not configured or no services have TLS enabled.
§Arguments
user_inputs- Complete user configuration
§Returns
Some(PathBuf) with path to the rendered Caddy build directory if
HTTPS + TLS services are configured, or None if Caddy should not
be deployed.
§Errors
Returns error if template rendering fails
Auto Trait Implementations§
impl !RefUnwindSafe for CaddyTemplateRenderingService
impl !UnwindSafe for CaddyTemplateRenderingService
impl Freeze for CaddyTemplateRenderingService
impl Send for CaddyTemplateRenderingService
impl Sync for CaddyTemplateRenderingService
impl Unpin for CaddyTemplateRenderingService
impl UnsafeUnpin for CaddyTemplateRenderingService
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request