diff --git a/README.md b/README.md index 6d54b52..443710c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,37 @@ -# go-service-dropbox - [![Build Status](https://github.com/beyondstorage/go-service-dropbox/workflows/Unit%20Test/badge.svg?branch=master)](https://github.com/beyondstorage/go-service-dropbox/actions?query=workflow%3A%22Unit+Test%22) [![License](https://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/Xuanwo/storage/blob/master/LICENSE) -[![go storage dev](https://img.shields.io/matrix/go-service-dropbox:aos.dev.svg?server_fqdn=chat.aos.dev&label=%23go-service-dropbox%3Aaos.dev&logo=matrix)](https://matrix.to/#/#go-service-dropbox:aos.dev) +[![](https://img.shields.io/matrix/beyondstorage@go-storage:matrix.org.svg?logo=matrix)](https://matrix.to/#/#beyondstorage@go-storage:matrix.org) + +# go-service-dropbox -dropbox services support for [go-storage](https://github.com/beyondstorage/go-storage) +[Dropbox](https://www.dropbox.com) service support for [go-storage](https://github.com/beyondstorage/go-storage). ## Install ```go go get github.com/beyondstorage/go-service-dropbox/v2 ``` + +## Usage + +```go +import ( + "log" + + _ "github.com/beyondstorage/go-service-dropbox/v2" + "github.com/beyondstorage/go-storage/v4/services" +) + +func main() { + store, err := services.NewStoragerFromString("dropbox:///path/to/workdir?credential=apikey:") + if err != nil { + log.Fatal(err) + } + + // Write data from io.Reader into hello.txt + n, err := store.Write("hello.txt", r, length) +} +``` + +- See more examples in [go-storage-example](https://github.com/beyondstorage/go-storage-example). +- Read [more docs](https://beyondstorage.io/docs/go-storage/services/dropbox) about go-service-dropbox.