|
@ -8,6 +8,7 @@ import ( |
|
|
"io" |
|
|
"io" |
|
|
"strings" |
|
|
"strings" |
|
|
"sync" |
|
|
"sync" |
|
|
|
|
|
"time" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func ParseLocationName(remote string) (locationName string) { |
|
|
func ParseLocationName(remote string) (locationName string) { |
|
@ -65,6 +66,11 @@ func FormatLocation(loc *remote_pb.RemoteStorageLocation) string { |
|
|
|
|
|
|
|
|
type VisitFunc func(dir string, name string, isDirectory bool, remoteEntry *filer_pb.RemoteEntry) error |
|
|
type VisitFunc func(dir string, name string, isDirectory bool, remoteEntry *filer_pb.RemoteEntry) error |
|
|
|
|
|
|
|
|
|
|
|
type Bucket struct { |
|
|
|
|
|
Name string |
|
|
|
|
|
CreatedAt time.Time |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
type RemoteStorageClient interface { |
|
|
type RemoteStorageClient interface { |
|
|
Traverse(loc *remote_pb.RemoteStorageLocation, visitFn VisitFunc) error |
|
|
Traverse(loc *remote_pb.RemoteStorageLocation, visitFn VisitFunc) error |
|
|
ReadFile(loc *remote_pb.RemoteStorageLocation, offset int64, size int64) (data []byte, err error) |
|
|
ReadFile(loc *remote_pb.RemoteStorageLocation, offset int64, size int64) (data []byte, err error) |
|
@ -73,6 +79,7 @@ type RemoteStorageClient interface { |
|
|
WriteFile(loc *remote_pb.RemoteStorageLocation, entry *filer_pb.Entry, reader io.Reader) (remoteEntry *filer_pb.RemoteEntry, err error) |
|
|
WriteFile(loc *remote_pb.RemoteStorageLocation, entry *filer_pb.Entry, reader io.Reader) (remoteEntry *filer_pb.RemoteEntry, err error) |
|
|
UpdateFileMetadata(loc *remote_pb.RemoteStorageLocation, oldEntry *filer_pb.Entry, newEntry *filer_pb.Entry) (err error) |
|
|
UpdateFileMetadata(loc *remote_pb.RemoteStorageLocation, oldEntry *filer_pb.Entry, newEntry *filer_pb.Entry) (err error) |
|
|
DeleteFile(loc *remote_pb.RemoteStorageLocation) (err error) |
|
|
DeleteFile(loc *remote_pb.RemoteStorageLocation) (err error) |
|
|
|
|
|
ListBuckets() ([]*Bucket, error) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
type RemoteStorageClientMaker interface { |
|
|
type RemoteStorageClientMaker interface { |
|
|