TiKV
TiKV services support.
Capabilities
This service can be used to:
- stat
- read
- write
- create_dir
- delete
- copy
- rename
-
list -
presign -
blocking
Configuration
endpoints
: Set the endpoints to the tikv clusterinsecure
: Set the insecure flag to the tikv clusterca_path
: Set the ca path to the tikv connectioncert_path
: Set the cert path to the tikv connectionkey_path
: Set the key path to the tikv connection
You can refer to [TikvBuilder
]'s docs for more information
Example
Via Builder
use anyhow::Result;
use opendal::services::Tikv;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
let mut builder = Tikv::default();
builder.endpoints(vec!["127.0.0.1:2379".to_string()]);
let op: Operator = Operator::new(builder)?.finish();
Ok(())
}
Via Config
- Rust
- Node.js
- Python
use anyhow::Result;
use opendal::Operator;
use opendal::Scheme;
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<()> {
let mut config = HashMap::new();
config.insert("endpoints".to_string(), "127.0.0.1:2379".to_string());
let op: Operator = Operator::via_map(Scheme::TiKV, config)?;
Ok(())
}
import { Operator } from "opendal";
async function main() {
const config = {
endpoints: "127.0.0.1:2379",
};
const op = new Operator("tikv", config);
}
import opendal
config = {
"endpoints": "127.0.0.1:2379",
}
op = opendal.Operator("tikv", **config)