Skip to main content

build_cache_path

Function build_cache_path 

Source
pub fn build_cache_path(
    cache_root: &str,
    plugin_id: &str,
    domain: &str,
    key: &str,
) -> Result<String, HostApiError>
Expand description

构建本地缓存文件路径:<cache_root>/<plugin_id>/<domain>/<key>。 校验 domain 与 key(拒绝空串、“.”、“..” 与路径穿越),策略同 build_resource_path。 缓存根目录为宿主 app data 下的 plugin-cache/,不经 StorageService。 供宿主实现 PluginHost 缓存操作时使用。