|
1 | | -//! Remote schema caching module. |
| 1 | +//! Caching module for eure. |
2 | 2 | //! |
3 | | -//! This module provides caching for remote schema files fetched over HTTP(S). |
| 3 | +//! This module provides caching infrastructure with support for multiple cache types. |
4 | 4 | //! |
5 | 5 | //! # Module Organization |
6 | 6 | //! |
|
10 | 10 | //! # Cache Layout |
11 | 11 | //! |
12 | 12 | //! The cache is stored in the platform-specific cache directory (via `directories` crate): |
13 | | -//! - macOS: `~/Library/Caches/dev.eure.eure/schemas/` |
14 | | -//! - Linux: `~/.cache/eure/schemas/` |
15 | | -//! - Windows: `C:\Users\<User>\AppData\Local\eure\eure\cache\schemas\` |
| 13 | +//! - macOS: `~/Library/Caches/dev.eure.eure/` |
| 14 | +//! - Linux: `~/.cache/eure/` |
| 15 | +//! - Windows: `C:\Users\<User>\AppData\Local\eure\eure\cache\` |
16 | 16 | //! |
17 | 17 | //! Override with `$EURE_CACHE_DIR` environment variable. |
18 | 18 | //! |
19 | | -//! Files are organized with 2-level directory sharding to prevent overcrowding: |
| 19 | +//! Cache types are stored in subdirectories: |
20 | 20 | //! |
21 | 21 | //! ```text |
22 | | -//! ~/Library/Caches/dev.eure.eure/schemas/ # (macOS example) |
23 | | -//! eure.dev/ |
24 | | -//! a1/ |
25 | | -//! b2/ |
26 | | -//! a1b2c3d4-eure-schema.schema.eure # content |
27 | | -//! a1b2c3d4-eure-schema.schema.eure.meta # metadata (JSON) |
| 22 | +//! ~/Library/Caches/dev.eure.eure/ # base_cache_dir() (macOS example) |
| 23 | +//! https/ # https_cache_dir() - HTTPS fetched content |
| 24 | +//! eure.dev/ |
| 25 | +//! a1/ |
| 26 | +//! b2/ |
| 27 | +//! a1b2c3d4-schema.eure # content |
| 28 | +//! a1b2c3d4-schema.eure.meta # metadata (JSON) |
| 29 | +//! # (future: compile/, build/, etc.) |
28 | 30 | //! ``` |
29 | 31 | //! |
30 | 32 | //! # Example (native only) |
@@ -61,7 +63,7 @@ mod storage; |
61 | 63 | #[cfg(feature = "native")] |
62 | 64 | pub use error::CacheError; |
63 | 65 | #[cfg(feature = "native")] |
64 | | -pub use fetch::{CacheOptions, FetchResult, default_cache_dir, fetch}; |
| 66 | +pub use fetch::{CacheOptions, FetchResult, base_cache_dir, fetch, https_cache_dir}; |
65 | 67 | #[cfg(feature = "native")] |
66 | 68 | pub use gc::{clean, clean_with_dir, gc, gc_with_dir, parse_duration, parse_size}; |
67 | 69 | #[cfg(feature = "native")] |
|
0 commit comments