-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(services/storj): Move services storj back (#929)
* Add storj back * Add storj back * Update comment for doc
- Loading branch information
1 parent
429fc4f
commit 78cb8c4
Showing
16 changed files
with
1,379 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Services Test Storj" | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'services/storj/**' | ||
pull_request: | ||
paths: | ||
- 'services/storj/**' | ||
|
||
jobs: | ||
services_test_storj: | ||
name: "Services Test Storj" | ||
runs-on: self-hosted | ||
|
||
strategy: | ||
matrix: | ||
go: [ "1.16", "1.17" ] | ||
|
||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Load secret | ||
uses: 1password/load-secrets-action@v1 | ||
env: | ||
STORAGE_STORJ_CREDENTIAL: op://Engineering/Storj/testing/credential | ||
STORAGE_STORJ_NAME: op://Engineering/Storj/testing/name | ||
STORAGE_STORJ_LOCATION: op://Engineering/Storj/testing/location | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
env: | ||
STORAGE_STORJ_INTEGRATION_TEST: on | ||
working-directory: services/storj | ||
run: make integration_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
coverage.* | ||
bin/ | ||
Makefile.env | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
SHELL := /bin/bash | ||
|
||
-include Makefile.env | ||
|
||
.PHONY: all check format lint build test generate tidy | ||
|
||
help: | ||
@echo "Please use \`make <target>\` where <target> is one of" | ||
@echo " check to do static check" | ||
@echo " build to create bin directory and build" | ||
@echo " generate to generate code" | ||
@echo " test to run test" | ||
|
||
check: vet | ||
|
||
format: | ||
go fmt ./... | ||
|
||
vet: | ||
go vet ./... | ||
|
||
generate: | ||
@echo "generate code" | ||
go generate ./... | ||
go fmt ./... | ||
|
||
build: tidy generate check | ||
go build ./... | ||
|
||
test: | ||
go test -race -coverprofile=coverage.txt -covermode=atomic -v . | ||
go tool cover -html="coverage.txt" -o "coverage.html" | ||
|
||
integration_test: | ||
go test -race -count=1 -covermode=atomic -v ./tests | ||
|
||
tidy: | ||
go mod tidy | ||
go mod verify | ||
|
||
clean: | ||
@echo "clean generated files" | ||
find . -type f -name 'generated.go' -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export STORAGE_STORJ_INTEGRATION_TEST=on | ||
export STORAGE_STORJ_CREDENTIAL=apikey:key | ||
export STORAGE_STORJ_NAME=bucketname | ||
export STORAGE_STORJ_LOCATION=location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[![Services Test Storj](https://github.com/beyondstorage/go-storage/actions/workflows/services-test-storj.yml/badge.svg)](https://github.com/beyondstorage/go-storage/actions/workflows/services-test-storj.yml) | ||
|
||
# storj | ||
|
||
[Storj DCS] (Decentralized Cloud Storage) support for [go-storage]. | ||
|
||
[Storj DCS]: https://www.storj.io | ||
[go-storage]: https://github.com/beyondstorage/go-storage | ||
|
||
## Install | ||
|
||
```go | ||
go get go.beyondstorage.io/services/storj | ||
``` | ||
|
||
## Usage | ||
|
||
```go | ||
import ( | ||
"log" | ||
|
||
_ "go.beyondstorage.io/services/storj" | ||
"go.beyondstorage.io/v5/services" | ||
) | ||
s | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
Package storj provided support for Storj Decentralized Cloud Storage(https://www.storj.io). | ||
*/ | ||
package storj | ||
|
||
//go:generate go run -tags tools go.beyondstorage.io/v5/cmd/definitions service.toml |
Oops, something went wrong.