Add ListObjects (for backup dir deletions)

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
Andy Goldstein
2017-09-11 15:40:48 -04:00
parent 5c9ffae88f
commit 193000e487
5 changed files with 108 additions and 2 deletions
+45
View File
@@ -19,12 +19,34 @@ package test
import io "io"
import mock "github.com/stretchr/testify/mock"
import time "time"
// ObjectStorageAdapter is an autogenerated mock type for the ObjectStorageAdapter type
type ObjectStorageAdapter struct {
mock.Mock
}
// CreateSignedURL provides a mock function with given fields: bucket, key, ttl
func (_m *ObjectStorageAdapter) CreateSignedURL(bucket string, key string, ttl time.Duration) (string, error) {
ret := _m.Called(bucket, key, ttl)
var r0 string
if rf, ok := ret.Get(0).(func(string, string, time.Duration) string); ok {
r0 = rf(bucket, key, ttl)
} else {
r0 = ret.Get(0).(string)
}
var r1 error
if rf, ok := ret.Get(1).(func(string, string, time.Duration) error); ok {
r1 = rf(bucket, key, ttl)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteObject provides a mock function with given fields: bucket, key
func (_m *ObjectStorageAdapter) DeleteObject(bucket string, key string) error {
ret := _m.Called(bucket, key)
@@ -85,6 +107,29 @@ func (_m *ObjectStorageAdapter) ListCommonPrefixes(bucket string, delimiter stri
return r0, r1
}
// ListObjects provides a mock function with given fields: bucket, prefix
func (_m *ObjectStorageAdapter) ListObjects(bucket string, prefix string) ([]string, error) {
ret := _m.Called(bucket, prefix)
var r0 []string
if rf, ok := ret.Get(0).(func(string, string) []string); ok {
r0 = rf(bucket, prefix)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(bucket, prefix)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PutObject provides a mock function with given fields: bucket, key, body
func (_m *ObjectStorageAdapter) PutObject(bucket string, key string, body io.ReadSeeker) error {
ret := _m.Called(bucket, key, body)