use laravel::config::Section;
#[derive(Debug, Clone, Section)]
pub struct TemplateEngineConfig {
#[env("TEMPLATE_ENGINE_LOCALE", default = "en".to_owned())]
pub locale: String,
#[env("TEMPLATE_ENGINE_CURRENCY", default = "USD".to_owned())]
pub currency: String,
#[env("TEMPLATE_ENGINE_QUEUE_CONNECTION")]
pub queue_connection: Option<String>,
#[env("TEMPLATE_ENGINE_QUEUE")]
pub queue: Option<String>,
#[env("TEMPLATE_ENGINE_FUEL", default = 2_000_000)]
pub fuel: u64,
#[env("TEMPLATE_ENGINE_MAX_OUTPUT", default = 2 * 1024 * 1024)]
pub max_output: usize,
#[env("TEMPLATE_ENGINE_TIMEOUT_MS", default = 2_000)]
pub timeout_ms: u64,
#[env("TEMPLATE_ENGINE_MAX_DEPTH", default = 10)]
pub max_depth: usize,
#[env("TEMPLATE_ENGINE_MAX_LENGTH", default = 200_000)]
pub max_length: usize,
#[env("TEMPLATE_ENGINE_TEST_PREFIX", default = "[Test] ".to_owned())]
pub test_prefix: String,
}
pub(crate) fn config() -> TemplateEngineConfig {
laravel::config().section::<TemplateEngineConfig>().clone()
}