Cacache
Cacache services support.
Capabilities
This service can be used to:
- stat
- read
- write
- create_dir
- delete
- copy
- rename
- list
-
presign - blocking
Configuration
datadir
: Set the path to the cacache data directory
You can refer to [CacacheBuilder
]'s docs for more information
Example
Via Builder
use anyhow::Result;
use opendal::services::Cacache;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
let mut builder = Cacache::default();
builder.datadir("/tmp/opendal/cacache");
let op: Operator = Operator::new(builder)?.finish();
Ok(())
}
Via Config
- Rust
- Node.js
- Python
use anyhow::Result;
use opendal::services::Cacache;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
let mut map = HashMap::new();
map.insert("datadir".to_string(), "/tmp/opendal/cacache".to_string());
let op: Operator = Operator::via_map(Scheme::Cacache, map)?;
Ok(())
}
import { Operator } from require('opendal');
async function main() {
const op = new Operator("cacache", {
datadir: '/tmp/opendal/cacache'
});
}
import opendal
op = opendal.Operator("cacache", {
"datadir": "/tmp/opendal/cacache"
})