From d2174ab3e35bfb43be0fbcf1567033deeac277c7 Mon Sep 17 00:00:00 2001 From: Kaiyuan Liu Date: Mon, 27 Sep 2021 12:16:34 +0800 Subject: [PATCH] docs: Update README (#18) * Update Readme.md * Add integration test badge to readme * Integration test badge fix Co-authored-by: Xuanwo --- README.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a9807e8..cd83d22 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,41 @@ -## go-service-storj +[![Build Status](https://github.com/beyondstorage/go-service-storj/workflows/Unit%20Test/badge.svg?branch=master)](https://github.com/beyondstorage/go-service-storj/actions?query=workflow%3A%22Unit+Test%22) +[![Integration Tests](https://teamcity.beyondstorage.io/app/rest/builds/buildType:(id:Services_Storj_IntegrationTest)/statusIcon)](https://teamcity.beyondstorage.io/buildConfiguration/Services_Storj_IntegrationTest) +[![License](https://img.shields.io/badge/license-apache%20v2-blue.svg)](https://github.com/Xuanwo/storage/blob/master/LICENSE) +[![](https://img.shields.io/matrix/beyondstorage@go-storage:matrix.org.svg?logo=matrix)](https://matrix.to/#/#beyondstorage@go-storage:matrix.org) + +# go-service-storj [Storj DCS] (Decentralized Cloud Storage) support for [go-storage]. [Storj DCS]: https://www.storj.io -[go-storage]: https://github.com/beyondstorage/go-storage \ No newline at end of file +[go-storage]: https://github.com/beyondstorage/go-storage + +## Install + +```go +go get github.com/beyondstorage/go-service-storj +``` + +## Usage + +```go +import ( + "log" + + _ "github.com/beyondstorage/go-service-storj" + "github.com/beyondstorage/go-storage/v4/services" +) + +func main() { + store, err := services.NewStoragerFromString("storj://bucket_name/path/to/workdir") + 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/storj) about go-service-storj. \ No newline at end of file