store: implement s3 blob store (#2005)
This commit is contained in:
parent
01d9bb6a59
commit
c1d09f7c41
6
blob.go
6
blob.go
@ -126,11 +126,7 @@ func (b *blobStore) Delete(key string, opts ...store.BlobOption) error {
|
||||
// check for the namespaces bucket
|
||||
bucket := tx.Bucket([]byte(options.Namespace))
|
||||
if bucket == nil {
|
||||
return store.ErrNotFound
|
||||
}
|
||||
|
||||
if bucket.Get([]byte(key)) == nil {
|
||||
return store.ErrNotFound
|
||||
return nil
|
||||
}
|
||||
|
||||
return bucket.Delete([]byte(key))
|
||||
|
@ -60,12 +60,12 @@ func TestBlobStore(t *testing.T) {
|
||||
|
||||
t.Run("DeleteIncorrectNamespace", func(t *testing.T) {
|
||||
err := blob.Delete("hello", store.BlobNamespace("bar"))
|
||||
assert.Equal(t, store.ErrNotFound, err, "Error should be not found")
|
||||
assert.Nil(t, err, "Error should be nil")
|
||||
})
|
||||
|
||||
t.Run("DeleteCorrectNamespaceIncorrectKey", func(t *testing.T) {
|
||||
err := blob.Delete("world", store.BlobNamespace("micro"))
|
||||
assert.Equal(t, store.ErrNotFound, err, "Error should be not found")
|
||||
assert.Nil(t, err, "Error should be nil")
|
||||
})
|
||||
|
||||
t.Run("DeleteCorrectNamespace", func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user