summaryrefslogtreecommitdiff
path: root/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'testing.go')
-rw-r--r--testing.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing.go b/testing.go
new file mode 100644
index 0000000..8286abc
--- /dev/null
+++ b/testing.go
@@ -0,0 +1,15 @@
+package s3
+
+func (fs *Fs) listBuckets() ([]string, error) {
+ ctx, cancel := fs.contextWithTimeout()
+ defer cancel()
+ bucketInfos, err := fs.client.ListBuckets(ctx)
+ if err != nil {
+ return nil, err
+ }
+ buckets := make([]string, 0, len(bucketInfos))
+ for _, bi := range bucketInfos {
+ buckets = append(buckets, bi.Name)
+ }
+ return buckets, nil
+}