Skip to content

Commit

Permalink
docs: Add docs on website for redb service (#3301)
Browse files Browse the repository at this point in the history
Signed-off-by: Manjusaka <[email protected]>
  • Loading branch information
Zheaoli authored Oct 16, 2023
1 parent e46550b commit 0792d1d
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions website/docs/services/redb.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: Redb
---

[Redb](https://github.com/cberner/redb) services support.

import Docs from '../../../core/src/services/redb/docs.md'

<Docs components={props.components} />

### Via Config

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="rust" label="Rust" default>

```rust
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("datadir".to_string(), "/tmp/opendal/redb".to_string());

let op: Operator = Operator::via_map(Scheme::Redb, config)?;
Ok(())
}
```

</TabItem>
<TabItem value="node.js" label="Node.js">

```javascript
import { Operator } from "opendal";

async function main() {
const config = {
datadir: "/tmp/opendal/redb",
};
const op = new Operator("redb", config);
}
```

</TabItem>
<TabItem value="python" label="Python">

```python
import opendal

config = {
"datadir": "/tmp/opendal/redb",
}

op = opendal.Operator("redb", **config)
```

</TabItem>
</Tabs>

0 comments on commit 0792d1d

Please sign in to comment.