5 configuration options · available in Rust, Python, Node.js, Java
use opendal::Operator;
let op = Operator::via_iter("moka", [
])?;
use opendal::Operator;
let op = Operator::via_iter("moka", [
// Name for this cache instance.
// ("name".to_string(), "...".to_string()),
// Sets the max capacity of the cache.
//
// Refer to [`moka::future::CacheBuilder::max_capacity`](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.max_capacity)
// ("max_capacity".to_string(), "1000".to_string()),
// Sets the time to live of the cache.
//
// Refer to [`moka::future::CacheBuilder::time_to_live`](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_live)
// ("time_to_live".to_string(), "...".to_string()),
// Sets the time to idle of the cache.
//
// Refer to [`moka::future::CacheBuilder::time_to_idle`](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_idle)
// ("time_to_idle".to_string(), "...".to_string()),
// root path of this backend
// ("root".to_string(), "...".to_string()),
])?;
Every option is passed as a string key; OpenDAL parses it into the right type. Some services may require building the binding with the matching services-* feature enabled.
| Key | Type | Required | Description |
|---|---|---|---|
name | string | no | Name for this cache instance. |
max_capacity | integer | no | Sets the max capacity of the cache.
Refer to [moka::future::CacheBuilder::max_capacity](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.max_capacity) |
time_to_live | string | no | Sets the time to live of the cache.
Refer to [moka::future::CacheBuilder::time_to_live](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_live) |
time_to_idle | string | no | Sets the time to idle of the cache.
Refer to [moka::future::CacheBuilder::time_to_idle](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_idle) |
root | string | no | root path of this backend |