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: Add documentation for service bos and obs #229

Merged
merged 1 commit into from
Sep 9, 2021
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Jetbrain IDE
.idea
*.iml
60 changes: 60 additions & 0 deletions docs/go-storage/services/bos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[Baidu Object Storage](https://cloud.baidu.com/product/bos.html)

## Project

<https://github.com/beyondstorage/go-service-bos>

## Config

### Servicer

| Name | Required | Comments |
| ---- | -------- | -------- |
| [credential](../pairs/credential.md) | Y | only support `hmac` protocol |
| [endpoint](../pairs/endpoint.md) | Y | specific domain to access this storager |

### Storager

| Name | Required | Comments |
| ---- | -------- | -------- |
| [name](../pairs/name.md) | Y | bucket name |
| [work_dir](../pairs/work_dir.md) | N | work dir |

## Example

Init servicer (see [this page](../operations/index.md) for details)

```go
import (
_ "github.com/beyondstorage/go-service-bos"
"github.com/beyondstorage/go-storage/v4/services"
)

srv, err := services.NewServicerFromString("bos://?credential=hmac:access_key_id:secret_access_key&endpoint=https:<region>.bcebos.com")
if err != nil {
log.Fatalf("bos new service: %v", err)
}
```

Init storager (see [this page](../operations/index.md) for details)

```go
import (
_ "github.com/beyondstorage/go-service-bos"
"github.com/beyondstorage/go-storage/v4/services"
)

store, err := services.NewStoragerFromString("bos://<bucket_name>/path/to/workdir?credential=hmac:access_key_id:secret_access_key&endpoint=https:<region>.bcebos.com")
if err != nil {
log.Fatalf("bos new service: %v", err)
}
```

## Implementation

This service implements following interfaces:

- [Servicer](../operations/servicer/index.md)

- [Storager](../operations/storager/index.md)

60 changes: 60 additions & 0 deletions docs/go-storage/services/obs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[Huawei Object Storage Service](https://www.huaweicloud.com/product/obs.html)

## Project

<https://github.com/beyondstorage/go-service-obs>

## Config

### Servicer

| Name | Required | Comments |
| ---- | -------- | -------- |
| [credential](../pairs/credential.md) | Y | only support `hmac` protocol |
| [endpoint](../pairs/endpoint.md) | Y | specific domain to access this storager |

### Storager

| Name | Required | Comments |
| ---- | -------- | -------- |
| [name](../pairs/name.md) | Y | bucket name |
| [work_dir](../pairs/work_dir.md) | N | work dir |

## Example

Init servicer (see [this page](../operations/index.md) for details)

```go
import (
_ "github.com/beyondstorage/go-service-obs"
"github.com/beyondstorage/go-storage/v4/services"
)

srv, err := services.NewServicerFromString("obs://?credential=hmac:access_key_id:secret_access_key&endpoint=https:obs.<region>.myhuaweicloud.com")
if err != nil {
log.Fatalf("obs new service: %v", err)
}
```

Init storager (see [this page](../operations/index.md) for details)

```go
import (
_ "github.com/beyondstorage/go-service-obs"
"github.com/beyondstorage/go-storage/v4/services"
)

store, err := services.NewStoragerFromString("obs://<bucket_name>/path/to/workdir?credential=hmac:access_key_id:secret_access_key&endpoint=https:obs.<region>.myhuaweicloud.com")
if err != nil {
log.Fatalf("obs new service: %v", err)
}
```

## Implementation

This service implements following interfaces:

- [Servicer](../operations/servicer/index.md)

- [Storager](../operations/storager/index.md)