lintel-schema-cache
Disk-backed cache for JSON Schema files. Fetches schemas over HTTP and stores them locally for fast subsequent lookups.
Features
- Transparent caching — schemas are stored as
<cache_dir>/<hash>.jsonwhere<hash>is a deterministic hash of the URI - Pluggable HTTP — bring your own HTTP client via the
HttpClienttrait, or use the built-inUreqClient - jsonschema integration — implements both
jsonschema::Retrieveandjsonschema::AsyncRetrievefor seamless use as a schema resolver
Usage
use ;
let cache = new;
// Use cache.fetch(uri) to retrieve schemas — returns (Value, CacheStatus)
// CacheStatus: Hit (from disk), Miss (fetched and cached), or Disabled (no cache dir)
Custom HTTP Client
use ;
;
let cache = new;
License
Apache-2.0