use super::*;
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct StaticFilesConfig {
pub(crate) root_dir: PathBuf,
pub(crate) mount_prefix: String,
pub(crate) index_file: String,
#[get(type(clone))]
pub(crate) spa_fallback: Option<String>,
pub(crate) cache_control: String,
#[get(type(copy))]
pub(crate) serve_precompressed: bool,
#[get(type(copy))]
pub(crate) allow_dotfiles: bool,
#[get(type(copy))]
pub(crate) max_cache_bytes: usize,
#[get(type(copy))]
pub(crate) max_file_cache_bytes: usize,
}
#[derive(Clone, Debug)]
pub(crate) struct CachedFile {
pub(crate) bytes: Vec<u8>,
pub(crate) etag: String,
pub(crate) content_type: &'static str,
pub(crate) content_encoding: Option<&'static str>,
pub(crate) modified_ms: u64,
}
pub(crate) struct StaticFilesRuntimeInner {
pub(crate) config: StaticFilesConfig,
pub(crate) canonical_root: PathBuf,
pub(crate) normalized_prefix: String,
pub(crate) cached_bytes: AtomicUsize,
pub(crate) cache_shards: StaticCacheShardArray,
}
#[derive(Clone)]
pub struct StaticFilesRuntime {
pub(crate) inner: Arc<StaticFilesRuntimeInner>,
}
#[derive(Clone)]
pub struct StaticFilesPlugin {
pub(crate) runtime: StaticFilesRuntime,
}
#[derive(Clone, Copy, Debug, Default)]
#[hyperlane::request_middleware(-55)]
pub struct StaticFilesHook;