Skip to main content

mini-moka

4 configuration options · available in Rust, Python, Node.js, Java

Quick start
use opendal::Operator;

let op = Operator::via_iter("mini-moka", [
])?;
All configuration options (copy & trim)
Full reference
use opendal::Operator;

let op = Operator::via_iter("mini-moka", [
// Sets the max capacity of the cache.
//
// Refer to [`mini-moka::sync::CacheBuilder::max_capacity`](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.max_capacity)
// ("max_capacity".to_string(), "1000".to_string()),

// Sets the time to live of the cache.
//
// Refer to [`mini-moka::sync::CacheBuilder::time_to_live`](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_live)
// ("time_to_live".to_string(), "...".to_string()),

// Sets the time to idle of the cache.
//
// Refer to [`mini-moka::sync::CacheBuilder::time_to_idle`](https://docs.rs/mini-moka/latest/mini_moka/sync/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.

Configuration reference

General4
KeyTypeRequiredDescription
max_capacityintegernoSets the max capacity of the cache. Refer to [mini-moka::sync::CacheBuilder::max_capacity](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.max_capacity)
time_to_livestringnoSets the time to live of the cache. Refer to [mini-moka::sync::CacheBuilder::time_to_live](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_live)
time_to_idlestringnoSets the time to idle of the cache. Refer to [mini-moka::sync::CacheBuilder::time_to_idle](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_idle)
rootstringnoroot path of this backend