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 docs for minio #149

Merged
merged 2 commits into from
Jul 26, 2021
Merged
Changes from 1 commit
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
68 changes: 67 additions & 1 deletion docs/go-storage/services/minio.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
[MinIO](https://min.io)

## Project

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

## Config

### Servicer

#### Available Pairs

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

#### Examples

Init servicer (see [this page](go-storage/operations/index.md#how-to-initialize-a-servicerstorager) for details)

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

srv, err := services.NewServicerFromString("minio://?credential=hmac:access_key:secret_key&endpoint=https:host:port")
aeinrw marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
log.Fatalf("minio new service: %v", err)
}
```

### Storager

#### Available Pairs

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

## Examples

Init storager (see [this page](go-storage/operations/index.md#how-to-initialize-a-servicerstorager) for details)

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

store, err := services.NewStoragerFromString("minio://<bucket_name>/<work_dir>?credential=hmac:<access_key>:<secret_key>&endpoint=https:<host>:<port>")
if err != nil {
log.Fatalf("minio new storager: %v", err)
}
```

## Implementation

This service implements following interfaces:

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

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

- [Copier](../operations/copy.md)

- [Reacher](../operations/reach.md)