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

Added Support Backblaze #62

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Cloudstorage is an library for working with Cloud Storage (Google, AWS, Azure) and SFTP, Local Files.
It provides a unified api for local files, sftp and Cloud files that aids testing and operating on multiple cloud storage.

[![Code Coverage](https://codecov.io/gh/lytics/cloudstorage/branch/master/graph/badge.svg)](https://codecov.io/gh/lytics/cloudstorage)
[![GoDoc](https://godoc.org/github.com/lytics/cloudstorage?status.svg)](http://godoc.org/github.com/lytics/cloudstorage)
[![Build Status](https://travis-ci.org/lytics/cloudstorage.svg?branch=master)](https://travis-ci.org/lytics/cloudstorage)
[![Go ReportCard](https://goreportcard.com/badge/lytics/cloudstorage)](https://goreportcard.com/report/lytics/cloudstorage)
[![Code Coverage](https://codecov.io/gh/dvriesman/cloudstorage/branch/master/graph/badge.svg)](https://codecov.io/gh/dvriesman/cloudstorage)
[![GoDoc](https://godoc.org/github.com/dvriesman/cloudstorage?status.svg)](http://godoc.org/github.com/dvriesman/cloudstorage)
[![Build Status](https://travis-ci.org/dvriesman/cloudstorage.svg?branch=master)](https://travis-ci.org/dvriesman/cloudstorage)
[![Go ReportCard](https://goreportcard.com/badge/dvriesman/cloudstorage)](https://goreportcard.com/report/dvriesman/cloudstorage)

**Features**
* Provide single unified api for multiple cloud (google, azure, aws) & local files.
Expand All @@ -24,7 +24,7 @@ Note: For these examples all errors are ignored, using the `_` for them.
##### Creating a Store object:
```go
// This is an example of a local storage object:
// See(https://github.com/lytics/cloudstorage/blob/master/google/google_test.go) for a GCS example:
// See(https://github.com/dvriesman/cloudstorage/blob/master/google/google_test.go) for a GCS example:
config := &cloudstorage.Config{
Type: localfs.StoreType,
AuthMethod: localfs.AuthFileSystem,
Expand Down Expand Up @@ -98,14 +98,14 @@ resp, _ := transferer.NewTransfer(config)

```

See [testsuite.go](https://github.com/lytics/cloudstorage/blob/master/testutils/testutils.go) for more examples
See [testsuite.go](https://github.com/dvriesman/cloudstorage/blob/master/testutils/testutils.go) for more examples

## Testing

Due to the way integration tests act against a cloud bucket and objects; run tests without parallelization.

```
cd $GOPATH/src/github.com/lytics/cloudstorage
cd $GOPATH/src/github.com/dvriesman/cloudstorage
go test -p 1 ./...
```

8 changes: 6 additions & 2 deletions awss3/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"

"github.com/lytics/cloudstorage"
"github.com/lytics/cloudstorage/csbufio"
"github.com/dvriesman/cloudstorage"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dvriesman I assume this can not be merged here with changed import paths

"github.com/dvriesman/cloudstorage/csbufio"
)

const (
Expand Down Expand Up @@ -705,3 +705,7 @@ func (o *object) Release() error {
os.Remove(o.cachepath)
return nil
}

func (o *object) AcquireLease(uid string) (string, error) {
return "", nil
}
6 changes: 3 additions & 3 deletions awss3/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/araddon/gou"
"github.com/bmizerany/assert"

"github.com/lytics/cloudstorage"
"github.com/lytics/cloudstorage/awss3"
"github.com/lytics/cloudstorage/testutils"
"github.com/dvriesman/cloudstorage"
"github.com/dvriesman/cloudstorage/awss3"
"github.com/dvriesman/cloudstorage/testutils"
)

/*
Expand Down
4 changes: 2 additions & 2 deletions azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"github.com/araddon/gou"
"google.golang.org/api/iterator"

"github.com/lytics/cloudstorage"
"github.com/lytics/cloudstorage/azure"
"github.com/dvriesman/cloudstorage"
"github.com/dvriesman/cloudstorage/azure"
)

/*
Expand Down
4 changes: 2 additions & 2 deletions azure/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/araddon/gou"
"google.golang.org/api/iterator"

"github.com/lytics/cloudstorage"
"github.com/lytics/cloudstorage/azure"
"github.com/dvriesman/cloudstorage"
"github.com/dvriesman/cloudstorage/azure"
)

/*
Expand Down
11 changes: 9 additions & 2 deletions azure/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/pborman/uuid"
"golang.org/x/net/context"

"github.com/lytics/cloudstorage"
"github.com/lytics/cloudstorage/csbufio"
"github.com/dvriesman/cloudstorage"
"github.com/dvriesman/cloudstorage/csbufio"
)

const (
Expand Down Expand Up @@ -532,6 +532,13 @@ func (o *object) SetMetaData(meta map[string]string) {
o.metadata = meta
}


func (o *object) AcquireLease(uid string) (string, error) {
options := &az.LeaseOptions{}
return o.o.AcquireLease(-1, uid, options)
}


func (o *object) Delete() error {
return o.fs.Delete(context.Background(), o.name)
}
Expand Down
6 changes: 3 additions & 3 deletions azure/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/araddon/gou"
"github.com/stretchr/testify/assert"

"github.com/lytics/cloudstorage"
"github.com/lytics/cloudstorage/azure"
"github.com/lytics/cloudstorage/testutils"
"github.com/dvriesman/cloudstorage"
"github.com/dvriesman/cloudstorage/azure"
"github.com/dvriesman/cloudstorage/testutils"
)

/*
Expand Down
Binary file added backblaze/debug.test
Binary file not shown.
Loading