cloud drive: add list buckets
This commit is contained in:
@@ -205,6 +205,7 @@ func (az *azureRemoteStorageClient) UpdateFileMetadata(loc *remote_pb.RemoteStor
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (az *azureRemoteStorageClient) DeleteFile(loc *remote_pb.RemoteStorageLocation) (err error) {
|
||||
key := loc.Path[1:]
|
||||
containerURL := az.serviceURL.NewContainerURL(loc.Bucket)
|
||||
@@ -214,3 +215,17 @@ func (az *azureRemoteStorageClient) DeleteFile(loc *remote_pb.RemoteStorageLocat
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (az *azureRemoteStorageClient) ListBuckets() (buckets []*remote_storage.Bucket, err error) {
|
||||
resp, err := az.ListBuckets()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("list buckets: %v", err)
|
||||
}
|
||||
for _, b := range resp {
|
||||
buckets = append(buckets, &remote_storage.Bucket{
|
||||
Name: b.Name,
|
||||
CreatedAt: b.CreatedAt,
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user