Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update swift docs #4327

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/src/services/swift/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ use crate::raw::*;
use crate::*;

/// [OpenStack Swift](https://docs.openstack.org/api-ref/object-store/#)'s REST API support.
/// For more information about swift-compatible services, refer to [Compatible Services](#compatible-services).
#[doc = include_str!("docs.md")]
#[doc = include_str!("compatible_services.md")]
#[derive(Default, Clone)]
pub struct SwiftBuilder {
endpoint: Option<String>,
Expand Down
23 changes: 15 additions & 8 deletions website/docs/services/swift.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
title: Swift
---

[OpenStack Swift](https://docs.openstack.org/api-ref/object-store/) service support.
[OpenStack Swift](https://docs.openstack.org/api-ref/object-store/) and compatible services support.

For more information about swift-compatible services, refer to [Compatible Services](#compatible-services).

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

Expand All @@ -25,13 +27,14 @@ use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<()> {
let mut map = HashMap::new();
map.insert("endpoint".to_string(), "http://127.0.0.1:8080".to_string());
map.insert("account".to_string(), "test_account".to_string());

map.insert("endpoint".to_string(), "http://127.0.0.1:8080/v1/AUTH_test".to_string());
map.insert("container".to_string(), "test_container".to_string());
map.insert("token".to_string(), "test_token".to_string());
map.insert("root".to_string(), "/".to_string());

let op: Operator = Operator::via_map(Scheme::Swift, map)?;

Ok(())
}
```
Expand All @@ -41,10 +44,10 @@ async fn main() -> Result<()> {

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

async function main() {
const op = new Operator("swift", {
endpoint: "http://127.0.0.1:8080",
account: "test_account",
endpoint: "http://127.0.0.1:8080/v1/AUTH_test",
container: "test_container",
token: "test_token",
root: "/",
Expand All @@ -57,14 +60,18 @@ async function main() {

```python
import opendal

op = opendal.Operator("swift",
endpoint="http://127.0.0.1:8080"
account="test_account",
endpoint="http://127.0.0.1:8080/v1/AUTH_test"
container="test_container",
token="test_token",
root="/",
)
```

</TabItem>
</Tabs>
</Tabs>

import CompatibleServices from '../../../core/src/services/swift/compatible_services.md'

<CompatibleServices components={props.components} />
Loading