Skip to main content

TiKV

TiKV services support.

Capabilities

This service can be used to:

  • stat
  • read
  • write
  • create_dir
  • delete
  • copy
  • rename
  • list
  • scan
  • presign
  • blocking

Configuration

  • endpoints: Set the endpoints to the tikv cluster
  • insecure: Set the insecure flag to the tikv cluster
  • ca_path: Set the ca path to the tikv connection
  • cert_path: Set the cert path to the tikv connection
  • key_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

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(())
}